#include <caimagemanipulation.h>
Public Member Functions | |
| CAImageManipulation () | |
| Constructor. | |
| ~CAImageManipulation () | |
| Destructor. | |
Static Public Member Functions | |
| static CL_Surface * | rotate (CL_Surface *surface, float angle, bool exact=true, bool green=true) |
| Returns a pointer to a new image, based on 'surface' but rotated by an angle of 'degrees' degrees. | |
| static CL_Surface * | flip (CL_Surface *surface, bool horizontal) |
| Returns a pointer to a new image, based on 'surface' but fliped horizontal or vertical. | |
| static CL_Surface * | changeHSV (CL_Surface *surface, int hue, int saturation, int value) |
| Returns a pointer to a new image, based on 'surface' but with changed hue. | |
| static void | clearCanvas (CL_Canvas *canvas) |
| Clears a canvas to transparent. | |
| static void | greenToTransparent (CL_Canvas *canvas) |
| Uses the green channel as transparency. | |
| static void | rgbToHsv (int r, int g, int b, int *h, int *s, int *v) |
| Converts an RGB color to a HSV color. | |
| static void | hsvToRgb (int h, int s, int v, int *r, int *g, int *b) |
| Converts an HSV color to a RGB color. | |
| static void | getExactColor (unsigned char *data, int width, int height, float x, float y, int *r, int *g, int *b, int *a, bool exact=true) |
| Gets the 'exact' color of a position in the image. | |
| static int | getCoordinateX (int width, int pos) |
| Gets a x coordinate from a data position in a 4bpp image. | |
| static int | getCoordinateY (int width, int pos) |
| Gets a y coordinate from a data position in a 4bpp image. | |
| static int | getDataPosition (int width, int x, int y) |
| Gets the data position (index of unsigned char* array) from a given x/y coordinate. | |
| static float | getDistance (float x1, float y1, float x2, float y2) |
| Returns the distance from one point to an other. | |
Benjamin Winkler <bentsch@mail.com>
|
||||||||||||||||||||
|
Returns a pointer to a new image, based on 'surface' but with changed hue. Changing the hue means to "rotate" the color spectrum. You can read more about the HSV color model on the Internet. This method is used to change the color of a sprite (e.g. a car or another object). I sudggest to make the basic images in a red color-spectrum and create all other colors from it. For examples, please visit the Trophy homepage developer corner (http://trophy.sourceforge.net)
|
|
||||||||||||
|
Returns a pointer to a new image, based on 'surface' but fliped horizontal or vertical.
|
|
||||||||||||
|
Gets a x coordinate from a data position in a 4bpp image.
|
|
||||||||||||
|
Gets a y coordinate from a data position in a 4bpp image.
|
|
||||||||||||||||
|
Gets the data position (index of unsigned char* array) from a given x/y coordinate.
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Gets the 'exact' color of a position in the image. The position can be 'between' pixels. The color gets calculated as an intelligent mixture of the hit pixel and the pixels around.
|
|
|
Uses the green channel as transparency. Due to a bug with transparency introduced with ClanLib 0.5 |
|
||||||||||||||||||||
|
Returns a pointer to a new image, based on 'surface' but rotated by an angle of 'degrees' degrees.
|
1.4.4