Project

General

Profile

Pix » History » Version 25

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