Pix » History » Version 24
iri, 03/27/2011 03:11 PM
1 | 1 | iri | h1. Pix |
---|---|---|---|
2 | |||
3 | Images resources. |
||
4 | |||
5 | {{toc}} |
||
6 | |||
7 | 19 | iri | h2. _gtkPixFree |
8 | |||
9 | Destroys a pix object (static or animated) |
||
10 | |||
11 | Prototype : *fun [ObjGtkPix] I* |
||
12 | |||
13 | +Return+ : I : always 0 except if error, it returns nil |
||
14 | |||
15 | 21 | iri | h2. _gtkPixFormats |
16 | |||
17 | 23 | iri | Returns a list of all supported pix formats to the current system. |
18 | 24 | iri | On MS Windows, these formats are mostly currently supported : +ani+ (Windows Animated Cursor), +png+ (Portable Network Graphic), +wbmp+ (Wireless Bitmap Image File), +pnm+ (Portable anymap bitmap), +ras+ (Sun Raster Graphic), +xpm+ (X11 Pixmap Graphic), +xbm+ (X BitMap), +tga+ (Targa Graphic), +pcx+ (Paintbrush Bitmap), +icns+ (Mac OS X Icon), +qtif+ (QuickTime Image File), +ico+ (ms windows icon file), +wmf+ (Windows Metafile), +emf+ (Enhanced Windows Metafile), +bmp+ (Bitmap Image), +gif+ (Graphical Interchange Format), +jpeg+ (Joint Photographic Experts Group), +tiff+ (Tagged Image File Format), ... |
19 | 21 | iri | |
20 | 22 | iri | Prototype : *fun [] [S r1]* |
21 | 21 | iri | |
22 | |||
23 | 19 | iri | |
24 | 14 | iri | h1. Static image |
25 | |||
26 | 1 | iri | h2. _gtkPixNew |
27 | |||
28 | create a new pix object |
||
29 | |||
30 | Prototype : *fun [Chn P I [I I I]] ObjGtkPix* |
||
31 | |||
32 | table. |
||
33 | |*channel*|Chn|a channel| |
||
34 | |*filename*|P|an image filename| |
||
35 | |*mode*|I|Mode. Should be at 0.| |
||
36 | |*tuple*|[I I I]|the width (or nil to not constraint it),| |
||
37 | | | |the height (or nil to not constraint it),| |
||
38 | | | |the ratio (1 to keep it)| |
||
39 | |||
40 | +Return+ : ObjGtkPix : a new pix object or nil if an error occurs |
||
41 | |||
42 | h2. _gtkPixScale |
||
43 | |||
44 | Scale |
||
45 | |||
46 | Prototype : *fun [ObjGtkPix I I I I] ObjGtkPix* |
||
47 | |||
48 | table. |
||
49 | |*pix*|ObjGtkPix|a valid pix object| | |
||
50 | |*width*|I|the new width| | |
||
51 | |*height*|I|the new height| | |
||
52 | 2 | iri | |*mode*|I|an algorithm at your choice :|SCOL_GTK_PIX_INTERP_BILINEAR (default) : | |
53 | 1 | iri | | | | |SCOL_GTK_PIX_INTERP_NEAREST : | |
54 | | | | |SCOL_GTK_PIX_INTERP_TILES : | |
||
55 | | | | |SCOL_GTK_PIX_INTERP_HYPER : | |
||
56 | 3 | iri | |*flag*|I|if 1, the pix in the pix object _pix_ will be destroyed.|If 0, the pix object _pix_ will be kept and a new pix object will be created.| |
57 | 1 | iri | |
58 | +Return+ : ObjGtkPix : a *new* pix object or nil if an error occurs. |
||
59 | |||
60 | h2. _gtkPixScaleEx |
||
61 | |||
62 | Not implemented yet. |
||
63 | |||
64 | +Return+ : always nil. |
||
65 | 3 | iri | |
66 | h2. _gtkPixRotate |
||
67 | |||
68 | Performs a rotation |
||
69 | |||
70 | Prototype : *fun [ObjGtkPix I I] ObjGtkPix* |
||
71 | |||
72 | table. |
||
73 | 4 | iri | |*pix*|ObjGtkPix|a pix object| |
74 | 3 | iri | |*angle*|I|0, 90, 180 or 270 degrees. Others values are ignored| |
75 | |*flag*|I|0 if the new pix Scol object is created with the rotated pix| |
||
76 | | | |1 if the new pix replaces the pix in the curent pix object _pix_| |
||
77 | |||
78 | +Return+ : ObjGtkPix : a rotated pix in the (new or same) pix object or the same pix object if the value is bad or nil if an error occurs |
||
79 | 1 | iri | |
80 | 5 | iri | h2. _gtkPixFlip |
81 | |||
82 | Performs a flip to a pix object |
||
83 | |||
84 | Prototype : *fun [ObjGtkPix I I] ObjGtkPix* |
||
85 | |||
86 | table. |
||
87 | |*pix*|ObjGtkPix|a pix object| |
||
88 | |*flip*|I|SCOL_GTK_PIX_FLIP_HORIZONTAL or SCOL_GTK_PIX_FLIP_VERTICAL. Other value are ignored.| |
||
89 | |*flag*|I|0 if the new pix Scol object is created with the flipped pix| |
||
90 | | | |1 if the new pix replaces the pix in the curent pix object _pix_| |
||
91 | |||
92 | +Return+ : ObjGtkPix : a flipped pix in the (new or same) pix object or the same pix object if the value is bad or nil if an error occurs |
||
93 | |||
94 | 6 | iri | h2. _gtkPixAddAlpha |
95 | |||
96 | Adds an alpha channel to an existing pix object. |
||
97 | If the tuple is not nil, then the color specified by it will be assigned zero opacity. |
||
98 | For example, if the tuple is equals at [255, 255, 255], all white pixels will become fully transparent. |
||
99 | |||
100 | Prototype : *fun [ObjGtkPix [I I I] I] ObjGtkPix* |
||
101 | |||
102 | table. |
||
103 | |*pix*|ObjGtkPix|a pix object| |
||
104 | |*rgb*|[I I I]|red, green and blue value (0->255). or nil (see above)| |
||
105 | |*flag*|I|0 if the new pix Scol object is created with the new pix| |
||
106 | | | |1 if the new pix replaces the pix in the curent pix object _pix_| |
||
107 | |||
108 | +Return+ : ObjGtkPix : a new pix in the (new or same) pix object or the same pix object if the value is bad or nil if an error occurs |
||
109 | |||
110 | 7 | iri | h2. _gtkPixCopyArea |
111 | |||
112 | Copies a rectangular area from _srcpix_ to _destpix_. |
||
113 | |||
114 | Prototype : *fun [ObjGtkPix I I I I ObjGtkPix I I] ObjGtkPix* |
||
115 | |||
116 | table. |
||
117 | |*srcpix*|ObjGtkPix|a source pix object| |
||
118 | |*srcx*|I|x coordinate in _srcpix_| |
||
119 | |*srcy*|I|y coordinate in _srcpix_| |
||
120 | |*srcwidth*|I|width to copy from _srcpix_| |
||
121 | |*srcheight*|I|height to copy from _srcpix_| |
||
122 | 8 | iri | |*destpix*|ObjGtkPix|a destination pix object. If nil, a new pix object will be created in the current channel| |
123 | 7 | iri | |*destx*|I|x coordinate in _destpix_| |
124 | |*desty*|I|y coordinate in _destpix_| |
||
125 | |||
126 | +Return+ : ObjGtkPix : the destination pix object or nil if error |
||
127 | |||
128 | 9 | iri | h2. _gtkPixSaturation |
129 | |||
130 | Modifies the saturation to a pix object |
||
131 | |||
132 | Prototype : *fun [ObjPixGtk I] ObjGtkPix* |
||
133 | |||
134 | 11 | iri | Value (I) : Between - 100 and 0, saturation is reduced (-> greyscale), between 0 and 100, the saturation is increased (vivid colors). With 0, the saturation is unchanged. |
135 | 9 | iri | |
136 | +Return+ : ObjGtkPix : the same pix object or nil if an error is occured. |
||
137 | |||
138 | 13 | iri | h2. _gtkPixPixelate |
139 | |||
140 | Pixelates a pix object. |
||
141 | |||
142 | TODO. |
||
143 | |||
144 | 12 | iri | h2. _gtkPixFill |
145 | |||
146 | Fill a pix object with a given color. |
||
147 | |||
148 | Prototype : *fun [ObjGtkPix I] ObjGtkPix* |
||
149 | |||
150 | Value : I : Format is : RRGGBBAA. If pix hasn't an alpha channel, AA is ignored |
||
151 | |||
152 | +Return+ : ObjGtkPix : the same pix object or nil if an error is occured. |
||
153 | 14 | iri | |
154 | 16 | iri | h2. _gtkPixGetSize |
155 | |||
156 | Returns the width and the height of a pix object |
||
157 | |||
158 | Prototype : *fun [ObjGtkPix] [I I]* |
||
159 | |||
160 | +Return+ : [I I] : the width and the height or nil if error |
||
161 | |||
162 | 17 | iri | h2. _gtkPixGetChannels |
163 | |||
164 | Prototype : *fun [ObjGtkPix] [I I I]* |
||
165 | |||
166 | +Return+ [I I I] : |
||
167 | * the number of channels of the pix object |
||
168 | * if the pix object has an alpha channel (1) or not (0) |
||
169 | * and the number of bits per color |
||
170 | |||
171 | 16 | iri | |
172 | |||
173 | 14 | iri | |
174 | |||
175 | h1. Animated image |
||
176 | |||
177 | 18 | iri | The static functions *should not* be used to the animated pix object. |
178 | |||
179 | 14 | iri | h2. _gtkPixAnimLoad |
180 | |||
181 | Loads an animated image file. |
||
182 | |||
183 | Prototype : *fun [Chn P] ObjGtkPix* |
||
184 | |||
185 | +Return+ : a new pix object or nil if an error occurs. |
||
186 | 12 | iri | |
187 | 15 | iri | h2. _gtkPixAnimNew |
188 | |||
189 | Creates a new animated pix from a list of static pix. |
||
190 | |||
191 | Prototype : *fun [Chn [ObjGtkPix r1] I I I I] ObjGtkPix* |
||
192 | |||
193 | table. |
||
194 | |*channel*|Chn|any channel to create the Scol object| |
||
195 | |*list*|[ObjGtkPix r1]|a list of static pix object. These pix must have the same width ad height than the animation, else are ignored| |
||
196 | |*width*|I|the width of the animated image| |
||
197 | |*height*|I|the height of the animated image| |
||
198 | |*rate*|I|the speed of the animation, in frames per second. By default, it's 1| |
||
199 | |*loop*|I|1 (default) if the animation should loop indefinitely when it reaches the end, else 0| |
||
200 | |||
201 | +Return+ ObjGtkPix : a new pix object, or nil if error |
||
202 | |||
203 | 20 | iri | h2. _gtkPixAnimGetSize |
204 | |||
205 | Returns the size of an animated pix object |
||
206 | |||
207 | Prototype : *fun [ObjGtkPix] [I I]* |
||
208 | |||
209 | +Return+ [I I] : the width and the height. if error, returns nil. |
||
210 | |||
211 | h2. _gtkPixAnimGetStatic |
||
212 | |||
213 | Gets the pix static object if the animated pix object is unanimated |
||
214 | |||
215 | Prototype : *fun [ObjGtkPix] ObjGtkPix* |
||
216 | |||
217 | This functions takes to argument an animated pix object (via _gtkPixAnimLoad or _gtkPixAnimNew). |
||
218 | If there is *no animation*, then, the functions returns a *new* static pix object. Otherwise, nil is returned. |
||
219 | |||
220 | |||
221 | 6 | iri | |
222 | 5 | iri | |
223 | 1 | iri | |
224 | Return [[Api]] |