Project

General

Profile

Pix » History » Version 20

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