|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Developers Corner
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
static CL_Surface* |
rotate( |
CL_Surface* surface, |
This method creates a new surface based on the given one
with a rotated angle. The original surface gets not changed. The size
(width/height) of the new surface is equal to the size of the original
surface.
If 'exact' is true, the result is smoother. If 'exact' is false, the method
is much faster but the result might be not as good.
Example:
Original |
Rotated |
Rotated |
|
|
|
|
static CL_Surface* |
flip( |
CL_Surface* surface, |
This method creates a new surface which is a flipped
copy of the original one. The original surface gets not changed.
If 'horizonal' is true, the surface gets flipped horizontal (left to
right and vice versa). Otherwise, the surface gets flipped vertical
(upside down)
|
static CL_Surface* |
changeHSV( |
CL_Surface* surface, |
With this method, you can change the hue (H), saturation (S) and the value (V) of the image.
Changing the 'hue' means to rotate the color in the rainbow color spectrum. This is often used for color-cycling effects or to change the color of objects. In the example below, the car is saved on disk in red. With this method, all cars in other colors can be generated from this image at runtime. The valid range for this parameter is 0...360.
The 'saturation' is the color strength of the image. A very low value results in a gray-scale image. The valid range is -100...100
The 'value' gives the lightness of the image. A high value results in a bright image while a low value results in a darker image. The valid range is -100...100.
Example:
Original |
Hue 60 |
Hue 120 |
Hue 180 |
Hue 240 |
Hue 300 |
|
|
|
|
|
|
Sat. -100 |
Sat. -66 |
Sat. -33 |
Sat. 33 |
Sat. 66 |
Sat. 100 |
|
|
|
|
|
|
Val. -100 |
Val. -66 |
Val. -33 |
Val. 33 |
Val. 66 |
Val. 100 |
|
|
|
|
|
|
|
|