Project

General

Profile

Pix » History » Version 27

iri, 03/29/2011 12:30 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 25 iri
h2. _gtkPixMimes
23
24
Returns the list of supported mime types.
25
26
Prototype : *fun [] [[S r1] r1]*
27
28
+Return+ : [[S r1] r1] : for each format, returns the list of associated mime types.
29
30
h2. _gtkPixFormatsFull
31
32
Returns infos to all supported pix formats.
33
34
Prototype : *fun [] [[S [S r1] [S r1] S S I] r1]*
35
36
+Return+ : [[S [S r1] [S r1] S S I] r1] : a list of tuples. For each supported pix format, the tuple gives :
37
38
* its name;
39
* the list of supported mime-types;
40
* the list of currently used extensions;
41
* a short description;
42
* its license : "LGPL", "GPL", "QPL", "GPL/QPL", or "other"
43
* its state : get if this format has been disabled (1) or not (0). See _gtkPixFormatDisable below
44
45 26 iri
h2. _gtkPixFormatDisable
46
47
Disables or enables an image format.
48
If a format is disabled, this format image won't be loaded.
49
50
Prototype : *fun [S I] I*
51
52
table.
53
|*name*|S|the name of the format, e.g. : "jpeg" or "tiff"|
54
|*value*|I|1 to disable, 0 to enable|
55
56
+Return+ : I : the new state or nil if error
57
58 27 iri
h2. _gtkPixGetInfo
59
60
Returns some informations on an image file (typically before load it).
61
62
Prototype : *fun [P] [I I [S S I]]*
63
64
table.
65
|*name*|P|a read referenced file|
66
67
+Return+ : [I I [S S I]] : 
68
* the width of the image
69
* the height of the image
70
** the name of the format (jpeg, tiff,png, gif, ...)
71
** the license of the format
72
** the state of the format : 1 if disabled, else 0
73
74
If the format is not recognized or if an error is occured, the function returns nil.
75 21 iri
76 19 iri
77 14 iri
h1. Static image
78
79 1 iri
h2. _gtkPixNew
80
81
create a new pix object
82
83
Prototype : *fun [Chn P I [I I I]] ObjGtkPix*
84
85
table.
86
|*channel*|Chn|a channel|
87
|*filename*|P|an image filename|
88
|*mode*|I|Mode. Should be at 0.|
89
|*tuple*|[I I I]|the width (or nil to not constraint it),|
90
| | |the height (or nil to not constraint it),|
91
| | |the ratio (1 to keep it)|
92
93
+Return+ : ObjGtkPix : a new pix object or nil if an error occurs
94
95
h2. _gtkPixScale
96
97
Scale
98
99
Prototype : *fun [ObjGtkPix I I I I] ObjGtkPix*
100
101
table.
102
|*pix*|ObjGtkPix|a valid pix object| |
103
|*width*|I|the new width| |
104
|*height*|I|the new height| |
105 2 iri
|*mode*|I|an algorithm at your choice :|SCOL_GTK_PIX_INTERP_BILINEAR (default) : |
106 1 iri
| | | |SCOL_GTK_PIX_INTERP_NEAREST : |
107
| | | |SCOL_GTK_PIX_INTERP_TILES : |
108
| | | |SCOL_GTK_PIX_INTERP_HYPER : |
109 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.|
110 1 iri
111
+Return+ : ObjGtkPix : a *new* pix object or nil if an error occurs.
112
113
h2. _gtkPixScaleEx
114
115
Not implemented yet.
116
117
+Return+ : always nil.
118 3 iri
119
h2. _gtkPixRotate
120
121
Performs a rotation
122
123
Prototype : *fun [ObjGtkPix I I] ObjGtkPix*
124
125
table.
126 4 iri
|*pix*|ObjGtkPix|a pix object|
127 3 iri
|*angle*|I|0, 90, 180 or 270 degrees. Others values are ignored|
128
|*flag*|I|0 if the new pix Scol object is created with the rotated pix|
129
| | |1 if the new pix replaces the pix in the curent pix object _pix_|
130
131
+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
132 1 iri
133 5 iri
h2. _gtkPixFlip
134
135
Performs a flip to a pix object
136
137
Prototype : *fun [ObjGtkPix I I] ObjGtkPix*
138
139
table.
140
|*pix*|ObjGtkPix|a pix object|
141
|*flip*|I|SCOL_GTK_PIX_FLIP_HORIZONTAL or SCOL_GTK_PIX_FLIP_VERTICAL. Other value are ignored.|
142
|*flag*|I|0 if the new pix Scol object is created with the flipped pix|
143
| | |1 if the new pix replaces the pix in the curent pix object _pix_|
144
145
+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
146
147 6 iri
h2. _gtkPixAddAlpha
148
149
Adds an alpha channel to an existing pix object.
150
If the tuple is not nil, then the color specified by it will be assigned zero opacity.
151
For example, if the tuple is equals at [255, 255, 255], all white pixels will become fully transparent.
152
153
Prototype : *fun [ObjGtkPix [I I I] I] ObjGtkPix*
154
155
table.
156
|*pix*|ObjGtkPix|a pix object|
157
|*rgb*|[I I I]|red, green and blue value (0->255). or nil (see above)|
158
|*flag*|I|0 if the new pix Scol object is created with the new pix|
159
| | |1 if the new pix replaces the pix in the curent pix object _pix_|
160
161
+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
162
163 7 iri
h2. _gtkPixCopyArea
164
165
Copies a rectangular area from _srcpix_ to _destpix_.
166
167
Prototype : *fun [ObjGtkPix I I I I ObjGtkPix I I] ObjGtkPix*
168
169
table.
170
|*srcpix*|ObjGtkPix|a source pix object|
171
|*srcx*|I|x coordinate in _srcpix_|
172
|*srcy*|I|y coordinate in _srcpix_|
173
|*srcwidth*|I|width to copy from _srcpix_|
174
|*srcheight*|I|height to copy from _srcpix_|
175 8 iri
|*destpix*|ObjGtkPix|a destination pix object. If nil, a new pix object will be created in the current channel|
176 7 iri
|*destx*|I|x coordinate in _destpix_|
177
|*desty*|I|y coordinate in _destpix_|
178
179
+Return+ : ObjGtkPix : the destination pix object or nil if error
180
181 9 iri
h2. _gtkPixSaturation
182
183
Modifies the saturation to a pix object
184
185
Prototype : *fun [ObjPixGtk I] ObjGtkPix*
186
187 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.
188 9 iri
189
+Return+ : ObjGtkPix : the same pix object or nil if an error is occured.
190
191 13 iri
h2. _gtkPixPixelate
192
193
Pixelates a pix object.
194
195
TODO.
196
197 12 iri
h2. _gtkPixFill
198
199
Fill a pix object with a given color.
200
201
Prototype : *fun [ObjGtkPix I] ObjGtkPix*
202
203
Value : I : Format is : RRGGBBAA. If pix hasn't an alpha channel, AA is ignored
204
205
+Return+ : ObjGtkPix : the same pix object or nil if an error is occured.
206 14 iri
207 16 iri
h2. _gtkPixGetSize
208
209
Returns the width and the height of a pix object
210
211
Prototype : *fun [ObjGtkPix] [I I]*
212
213
+Return+ : [I I] : the width and the height or nil if error
214
215 17 iri
h2. _gtkPixGetChannels
216
217
Prototype : *fun [ObjGtkPix] [I I I]*
218
219
+Return+ [I I I] :
220
* the number of channels of the pix object
221
* if the pix object has an alpha channel (1) or not (0)
222
* and the number of bits per color
223
224 16 iri
225
226 14 iri
227
228
h1. Animated image
229
230 18 iri
The static functions *should not* be used to the animated pix object.
231
232 14 iri
h2. _gtkPixAnimLoad
233
234
Loads an animated image file.
235
236
Prototype : *fun [Chn P] ObjGtkPix*
237
238
+Return+ : a new pix object or nil if an error occurs.
239 12 iri
240 15 iri
h2. _gtkPixAnimNew
241
242
Creates a new animated pix from a list of static pix.
243
244
Prototype : *fun [Chn [ObjGtkPix r1] I I I I] ObjGtkPix*
245
246
table.
247
|*channel*|Chn|any channel to create the Scol object|
248
|*list*|[ObjGtkPix r1]|a list of static pix object. These pix must have the same width ad height than the animation, else are ignored|
249
|*width*|I|the width of the animated image|
250
|*height*|I|the height of the animated image|
251
|*rate*|I|the speed of the animation, in frames per second. By default, it's 1|
252
|*loop*|I|1 (default) if the animation should loop indefinitely when it reaches the end, else 0|
253
254
+Return+ ObjGtkPix : a new pix object, or nil if error
255
256 20 iri
h2. _gtkPixAnimGetSize
257
258
Returns the size of an animated pix object
259
260
Prototype : *fun [ObjGtkPix] [I I]*
261
262
+Return+ [I I] : the width and the height. if error, returns nil.
263
264
h2. _gtkPixAnimGetStatic
265
266
Gets the pix static object if the animated pix object is unanimated
267
268
Prototype : *fun [ObjGtkPix] ObjGtkPix*
269
270
This functions takes to argument an animated pix object (via _gtkPixAnimLoad or _gtkPixAnimNew).
271
If there is *no animation*, then, the functions returns a *new* static pix object. Otherwise, nil is returned.
272
273
274 6 iri
275 5 iri
276 1 iri
277
Return [[Api]]