1 | ;;;; imlib2-eggdoc.scm |
---|
2 | |
---|
3 | (use eggdoc) |
---|
4 | |
---|
5 | (define license |
---|
6 | "Copyright (c) 2005, 2006, Peter Bex (peter.bex@xs4all.nl) |
---|
7 | All rights reserved. |
---|
8 | |
---|
9 | Redistribution and use in source and binary forms, with or without |
---|
10 | modification, are permitted provided that the following conditions |
---|
11 | are met: |
---|
12 | 1. Redistributions of source code must retain the above copyright |
---|
13 | notice, this list of conditions and the following disclaimer. |
---|
14 | 2. Redistributions in binary form must reproduce the above copyright |
---|
15 | notice, this list of conditions and the following disclaimer in the |
---|
16 | documentation and/or other materials provided with the distribution. |
---|
17 | 3. Neither the name of Peter Bex nor the names of any contributors may |
---|
18 | be used to endorse or promote products derived from this software |
---|
19 | without specific prior written permission. |
---|
20 | |
---|
21 | THIS SOFTWARE IS PROVIDED BY PETER BEX AND CONTRIBUTORS ``AS IS'' AND ANY |
---|
22 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
---|
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
---|
24 | DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE |
---|
25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
---|
27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
---|
28 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
29 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
30 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
31 | SUCH DAMAGE.") |
---|
32 | |
---|
33 | (define doc |
---|
34 | `((eggdoc:begin |
---|
35 | (name "imlib2") |
---|
36 | (description (p "Chicken bindings for the " |
---|
37 | (url "http://enlightenment.sourceforge.net/doxy/imlib2/index.html" "imlib2") |
---|
38 | " image library.")) |
---|
39 | (author (url "mailto:peter.bex@xs4all.nl" "Peter Bex")) |
---|
40 | (history |
---|
41 | (version "0.6" "Fix for wrong variable names.") |
---|
42 | (version "0.5" "Fix define/clone bug; thanks to Graham Fawcett") |
---|
43 | (version "0.4" "Fix finalizer bug; set correct context before freeing") |
---|
44 | (version "0.3" "Set GC finalizers on all functions that create new " |
---|
45 | "imlib objects and allow linking against imlib2 that was " |
---|
46 | "compiled without X and converted documentation to eggdoc.") |
---|
47 | (version "0.2" (code "imlib:alpha-set!") " wasn't exported") |
---|
48 | (version "0.1" "beta release")) |
---|
49 | (requires (url "syntax-case.html" "syntax-case")) |
---|
50 | (usage) |
---|
51 | (download "imlib2.egg") |
---|
52 | |
---|
53 | (documentation |
---|
54 | (p "Note: Not all imlib functionality is provided by this egg yet!") |
---|
55 | (subsection "Image creation, destruction and friends" |
---|
56 | (procedure "(imlib:create width height)" |
---|
57 | "Returns a new " (code "imlib:image") " object which " |
---|
58 | "describes a transparent image of the given size.") |
---|
59 | (procedure "(imlib:image? img)" |
---|
60 | "Determine if the given " (code "img") " object is " |
---|
61 | "an imlib image.") |
---|
62 | (procedure "(imlib:destroy img)" |
---|
63 | "Destroy the given image.") |
---|
64 | (procedure "(imlib:clone img)" |
---|
65 | "Create a fresh copy of the image object " (code "img")) |
---|
66 | (procedure "(imlib:load filename)" |
---|
67 | "Returns a new " (code "imlib:image") " object which " |
---|
68 | "describes the image stored in the file " |
---|
69 | (code "filename") ". This automatically uses the correct " |
---|
70 | "loader, as determined by Imlib2 on the basis of the " |
---|
71 | "file's extension.") |
---|
72 | (procedure "(imlib:save img filename)" |
---|
73 | "Store the imlib image object described by " (code "img") |
---|
74 | " in the file " (code "filename") ". The right loader " |
---|
75 | "is automatically selected by Imlib2 if you haven't " |
---|
76 | "set it explicitly with " (code "imlib:format-set!") ".")) |
---|
77 | |
---|
78 | (subsection "Image properties" |
---|
79 | (procedure "(imlib:format img)" |
---|
80 | "Request the currently set format for the image, or " |
---|
81 | (code "#f") " if no format has been associated with " |
---|
82 | "it yet.") |
---|
83 | (procedure "(imlib:format-set! img format)" |
---|
84 | "Explicitly set the file format on the image for " |
---|
85 | "subsequent calls to " (code "imlib:save") ". The " |
---|
86 | (code "format") " argument is passed to the loaders " |
---|
87 | "in the same way a file extension would be.") |
---|
88 | (procedure "(imlib:width img)" |
---|
89 | "Returns the width of the supplied image, in pixels.") |
---|
90 | (procedure "(imlib:height img)" |
---|
91 | "Returns the height of the supplied image, in pixels.") |
---|
92 | (procedure "(imlib:filename img)" |
---|
93 | "Returns the original filename for the image, if it " |
---|
94 | "was loaded from a file. Otherwise it returns " |
---|
95 | (code "#f") ".") |
---|
96 | (procedure "(imlib:alpha? img)" |
---|
97 | "Does the image have an alpha layer?") |
---|
98 | (procedure "(imlib:alpha-set! img value)" |
---|
99 | "Enable or disable alpha layer support for the image.") |
---|
100 | (procedure "(imlib:track-changes-on-disk img)" |
---|
101 | "From now on, track changes on disk to the file that " |
---|
102 | "is associated with " (code "img") ". By default, all " |
---|
103 | "images are cached by imlib2 in such a way that closing " |
---|
104 | "and reopening it just pulls it from cache instead of " |
---|
105 | "really loading it. Unfortunately, there's no way to " |
---|
106 | "request the status of this option or disable it.")) |
---|
107 | |
---|
108 | (subsection "Image manipulation operations" |
---|
109 | (subsubsection "Orientation" |
---|
110 | (procedure "(imlib:flip-horizontal img)" |
---|
111 | "Create a new, horizontally flipped, copy of " |
---|
112 | (code "img") ".") |
---|
113 | (procedure "(imlib:flip-horizontal! img)" |
---|
114 | "Destructively flip " (code "img") " horizontally.") |
---|
115 | (procedure "(imlib:flip-vertical img)" |
---|
116 | "Create a new, vertically flipped, copy of " |
---|
117 | (code "img") ".") |
---|
118 | (procedure "(imlib:flip-vertical! img)" |
---|
119 | "Destructively flip " (code "img") " vertically.") |
---|
120 | (procedure "(imlib:flip-diagonal img)" |
---|
121 | "Create a new, diagonally flipped, copy of " |
---|
122 | (code "img") ". This works like transposing a matrix.") |
---|
123 | (procedure "(imlib:flip-diagonal! img)" |
---|
124 | "Destructively flip " (code "img") " diagonally.") |
---|
125 | (procedure "(imlib:orientate img orientation)" |
---|
126 | "Create a new, orientated copy of " (code "img") |
---|
127 | ". According to imlib2 documentation, this function " |
---|
128 | "rotates the image by 90 degrees " (code "orientation") |
---|
129 | " times. However, the function accepts values " |
---|
130 | "between 0 and 7, inclusive. What values 4-7 do, I'm " |
---|
131 | "not really sure of. They appear to rotate the image " |
---|
132 | (code "(mod orientation 3)") " times 90 degrees, but " |
---|
133 | "flip it as well.")) |
---|
134 | |
---|
135 | (subsubsection "Texture/retouching functions" |
---|
136 | (procedure "(imlib:sharpen img radius)" |
---|
137 | "Create a new, sharpened copy of " (code "img") ". The " |
---|
138 | (code "radius") " argument is an integer number " |
---|
139 | "indicating the degree of sharpening that has to take " |
---|
140 | "place. I am not sure what a negative value means, but " |
---|
141 | "it is allowed.") |
---|
142 | (procedure "(imlib:sharpen! img radius)" |
---|
143 | "Destructively sharpen an image.") |
---|
144 | (procedure "(imlib:blur img radius)" |
---|
145 | "Create a new, blurred copy of " (code "img") ". The " |
---|
146 | (code "radius") " argument is a positive integer " |
---|
147 | "indicating the blur matrix radius, so 0 has no effect.") |
---|
148 | (procedure "(imlib:blur! img radius)" |
---|
149 | "Destructively blur an image.") |
---|
150 | (procedure "(imlib:tile img)" |
---|
151 | "Create a new copy of " (code "img") " adjusted in such " |
---|
152 | "a way around the edges, such that it is suitable for " |
---|
153 | "use in repeating (\"tiled\") patterns on all sides.") |
---|
154 | (procedure "(imlib:tile! img)" |
---|
155 | "Destructively tile an image.") |
---|
156 | (procedure "(imlib:tile-horizontal img)" |
---|
157 | "Create a new copy of " (code "img") " adjusted on " |
---|
158 | "the left and right edges so it can be used for " |
---|
159 | "horizontally repeating patterns.") |
---|
160 | (procedure "(imlib:tile-horizontal! img)" |
---|
161 | "Destructively tile an image horizontally.") |
---|
162 | (procedure "(imlib:tile-vertical img)" |
---|
163 | "Create a new copy of " (code "img") " adjusted on " |
---|
164 | "the top and bottom edges so it can be used for " |
---|
165 | "vertically repeating patterns.") |
---|
166 | (procedure "(imlib:tile-vertical! img)" |
---|
167 | "Destructively tile an image vertically.") |
---|
168 | (procedure "(imlib:crop img x y width height)" |
---|
169 | "Create a new, cropped copy of " (code "img") ". The " |
---|
170 | (code "x") " and " (code "y") " parameters indicate " |
---|
171 | "the upper left pixel of the new image. The " |
---|
172 | (code "width") " and " (code "height") " parameters " |
---|
173 | "indicate the size of the new image. Returns " |
---|
174 | (code "#f") " on failure. " |
---|
175 | (strong "Note: This function will return an image of " |
---|
176 | "the requested size, but with undefined contents " |
---|
177 | "if you pass it arguments that lie outside the " |
---|
178 | "image! I am still unsure if this is a bug or " |
---|
179 | "feature.")) |
---|
180 | (procedure "(imlib:scale img width height)" |
---|
181 | "Create a new, scaled copy of the image.") |
---|
182 | (procedure "(imlib:crop&scale img src-x src-y src-width src-height dest-width dest-height)" |
---|
183 | "Create a new, cropped " (em "and") " scaled copy of " |
---|
184 | (code "img") ". The arguments " (code "src-x") ", " |
---|
185 | (code "src-y") ", " (code "src-width") " and " |
---|
186 | (code "src-height") " indicate cropping dimensions as " |
---|
187 | "per " (code "imlib:crop") ", in the original image. " |
---|
188 | "The " (code "dest-width") " and " (code "dest-height") |
---|
189 | " arguments indicate the new image's width and height."))) |
---|
190 | |
---|
191 | (subsection "Pixel query functions" |
---|
192 | (procedure "(imlib:pixel/rgba img x y)" |
---|
193 | "Returns the RGBA (red, green, blue, alpha) color values " |
---|
194 | "for the image at the specified pixel coordinate as 4 " |
---|
195 | "values.") |
---|
196 | (procedure "(imlib:pixel/hsva img x y)" |
---|
197 | "Returns the HSVA (hue, saturation, value, alpha) color " |
---|
198 | "values for the image at the specified pixel coordinate " |
---|
199 | "as 4 values.") |
---|
200 | (procedure "(imlib:pixel/hlsa img x y)" |
---|
201 | "Returns the HLSA (hue, lightness, saturation, alpha) " |
---|
202 | "color values for the image at the specified pixel " |
---|
203 | "coordinate as 4 values.") |
---|
204 | (procedure "(imlib:pixel/cmya img x y)" |
---|
205 | "Returns the CMYA (cyan, magenta, yellow, alpha) " |
---|
206 | "color values for the image at the specified pixel " |
---|
207 | "coordinate as 4 values.")) |
---|
208 | |
---|
209 | (subsection "Color specifiers" |
---|
210 | (p "Note: This could use some more work. Perhaps the functions from" |
---|
211 | "the previous section should return values of these types instead.") |
---|
212 | (procedure "(imlib:color? color)" |
---|
213 | "Is the specified object an imlib color specifier?") |
---|
214 | (procedure "(imlib:color/rgba r g b a)" |
---|
215 | "Create a color specifier for the given RGBA values.") |
---|
216 | (procedure "(imlib:color/hsva h s v a)" |
---|
217 | "Create a color specifier for the given HSVA values.") |
---|
218 | (procedure "(imlib:color/hlsa h l s a)" |
---|
219 | "Create a color specifier for the given HLSA values.") |
---|
220 | (procedure "(imlib:color/cmya c m y a)" |
---|
221 | "Create a color specifier for the given CMYA values.")) |
---|
222 | |
---|
223 | (subsection "Drawing functions" |
---|
224 | (procedure "(imlib:draw-pixel img color x y)" |
---|
225 | "Draw a pixel in the given image on the given coordinates " |
---|
226 | "with the given color specifier.") |
---|
227 | (procedure "(imlib:draw-line img color x1 y1 x2 y2)" |
---|
228 | "Draw a line in the image from the coordinates (" |
---|
229 | (code "x1") "," (code "y1") ") to (" (code "x2") "," |
---|
230 | (code "y2") ".") |
---|
231 | (procedure "(imlib:draw-rectangle img color x y width height)" |
---|
232 | "Draw a one-pixel wide outline of a rectangle with " |
---|
233 | "the given color. The " (code "x") " and " (code "y") |
---|
234 | " coordinates are of the upper left corner of the " |
---|
235 | "rectangle.") |
---|
236 | (procedure "(imlib:fill-rectangle img color x y width height)" |
---|
237 | "Same as " (code "imlib:draw-rectangle") ", but " |
---|
238 | "filled in."))) |
---|
239 | |
---|
240 | (license ,license)))) |
---|
241 | |
---|
242 | (eggdoc->html doc) |
---|