#include <caimagemanipulation.h>
Public Members | |||
![]() | ![]() | CAImageManipulation () | |
![]() | ![]() | Constructor. | |
![]() | ![]() | ~CAImageManipulation () | |
![]() | ![]() | Destructor. | |
Static Public Members | |||
![]() | ![]() | CL_Surface* | rotate ( CL_Surface* surface, float angle, bool exact=true ) |
![]() | ![]() | Returns a pointer to a new image, based on 'surface' but rotated by an angle of 'degrees' degrees. More... | |
![]() | ![]() | CL_Surface* | flip ( CL_Surface* surface, bool horizontal ) |
![]() | ![]() | Returns a pointer to a new image, based on 'surface' but fliped horizontal or vertical. More... | |
![]() | ![]() | 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. More... | |
![]() | ![]() | void | rgbToHsv ( int r, int g, int b, int *h, int *s, int *v ) |
![]() | ![]() | Converts an RGB color to a HSV color. | |
![]() | ![]() | void | hsvToRgb ( int h, int s, int v, int *r, int *g, int *b ) |
![]() | ![]() | Converts an HSV color to a RGB color. | |
![]() | ![]() | 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. More... | |
![]() | ![]() | int | getCoordinateX ( int width, int pos ) |
![]() | ![]() | Gets a x coordinate from a data position in a 4bpp image. More... | |
![]() | ![]() | int | getCoordinateY ( int width, int pos ) |
![]() | ![]() | Gets a y coordinate from a data position in a 4bpp image. More... | |
![]() | ![]() | int | getDataPosition ( int width, int x, int y ) |
![]() | ![]() | Gets the data position (index of unsigned char* array) from a given x/y coordinate
| |
![]() | ![]() | float | getDistance ( float x1, float y1, float x2, float y2 ) |
![]() | ![]() | Returns the distance from one point to an other. | |
CL_Surface * CAImageManipulation::rotate (CL_Surface * surface, float angle, bool exact = true) [static]
|
Returns a pointer to a new image, based on 'surface' but rotated by an angle of 'degrees' degrees.
CL_Surface * CAImageManipulation::flip (CL_Surface * surface, bool horizontal) [static]
|
Returns a pointer to a new image, based on 'surface' but fliped horizontal or vertical.
CL_Surface * CAImageManipulation::changeHSV (CL_Surface * surface, int hue, int saturation, int value) [static]
|
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://)
void CAImageManipulation::getExactColor (unsigned char * data, int width, int height, float x, float y, int * r, int * g, int * b, int * a, bool exact = true) [static]
|
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.
int CAImageManipulation::getCoordinateX (int width, int pos) [static]
|
Gets a x coordinate from a data position in a 4bpp image.
int CAImageManipulation::getCoordinateY (int width, int pos) [static]
|
Gets a y coordinate from a data position in a 4bpp image.
written by Dimitri van Heesch, © 1997-1999