Typedefs | |
typedef struct lraspi_Image | lraspi_Image |
Enumerations | |
enum | lraspi_FilterMode { LRASPI_FILTER_NEAREST = 0 , LRASPI_FILTER_BILINEAR , LRASPI_FILTER_TRILINEAR } |
Functions | |
lraspi_Image * | lraspi_image_new (const char *image_file) |
Loads an image file onto the memory. More... | |
void | lraspi_image_free (lraspi_Image *image) |
Releases an image from memory. More... | |
int | lraspi_image_getwidth (lraspi_Image *image) |
Gets the current width (in pixels) of the image. More... | |
int | lraspi_image_getinitialwidth (lraspi_Image *image) |
Gets the width (in pixels) of the image. More... | |
int | lraspi_image_getheight (lraspi_Image *image) |
Gets the current height (in pixels) of the image. More... | |
int | lraspi_image_getinitialheight (lraspi_Image *image) |
Gets the height (in pixels) of the image. More... | |
void | lraspi_image_resize (lraspi_Image *image, int height, int width) |
Resizes the image. More... | |
float | lraspi_image_getrotation (lraspi_Image *image) |
Gets the rotation angle (in radians) of the image. More... | |
void | lraspi_image_rotate (lraspi_Image *image, float angle) |
Rotates the image. More... | |
bool | lraspi_image_isvflip (lraspi_Image *image) |
Checks if the image is vertically flipped. More... | |
void | lraspi_image_vflip (lraspi_Image *image, bool vflip) |
Flips the image vertically. More... | |
bool | lraspi_image_ishflip (lraspi_Image *image) |
Checks if the image is horizontally flipped. More... | |
void | lraspi_image_hflip (lraspi_Image *image, bool hflip) |
Flips the image vertically. More... | |
lraspi_FilterMode | lraspi_image_getfilter (lraspi_Image *image) |
Gets the image filter. More... | |
void | lraspi_image_setfilter (lraspi_Image *image, lraspi_FilterMode filter) |
Sets the image filter. More... | |
lraspi_Colour * | lraspi_image_getpixel (lraspi_Image *image, int x, int y) |
Gets the colour pixel of the image. More... | |
void | lraspi_image_setpixel (lraspi_Image *image, lraspi_Colour *colour, int x, int y) |
Sets the colour pixel of the image. More... | |
const char * | lraspi_image_tostring (lraspi_Image *image) |
Gets the string representation of the image. | |
Image loading and manipulation
typedef struct lraspi_Image lraspi_Image |
Represents a image object
enum lraspi_FilterMode |
void lraspi_image_free | ( | lraspi_Image * | image | ) |
Releases an image from memory.
image | The image which will be released. |
lraspi_FilterMode lraspi_image_getfilter | ( | lraspi_Image * | image | ) |
Gets the image filter.
image | An image object. |
int lraspi_image_getheight | ( | lraspi_Image * | image | ) |
Gets the current height (in pixels) of the image.
image | An image object. |
int lraspi_image_getinitialheight | ( | lraspi_Image * | image | ) |
Gets the height (in pixels) of the image.
image | An image object. |
int lraspi_image_getinitialwidth | ( | lraspi_Image * | image | ) |
Gets the width (in pixels) of the image.
image | An image object. |
lraspi_Colour* lraspi_image_getpixel | ( | lraspi_Image * | image, |
int | x, | ||
int | y | ||
) |
Gets the colour pixel of the image.
image | An image object. |
x | x-axis image position (in pixels). |
y | y-axis image position (in pixels). |
float lraspi_image_getrotation | ( | lraspi_Image * | image | ) |
Gets the rotation angle (in radians) of the image.
image | An image object. |
int lraspi_image_getwidth | ( | lraspi_Image * | image | ) |
Gets the current width (in pixels) of the image.
image | An image object. |
void lraspi_image_hflip | ( | lraspi_Image * | image, |
bool | hflip | ||
) |
Flips the image vertically.
image | An image object. |
hflip | True to flip the image horizontally, false otherwise. |
bool lraspi_image_ishflip | ( | lraspi_Image * | image | ) |
Checks if the image is horizontally flipped.
image | An image object. |
bool lraspi_image_isvflip | ( | lraspi_Image * | image | ) |
Checks if the image is vertically flipped.
image | An image object. |
lraspi_Image* lraspi_image_new | ( | const char * | image_file | ) |
Loads an image file onto the memory.
image_file | Path of the image file. |
void lraspi_image_resize | ( | lraspi_Image * | image, |
int | height, | ||
int | width | ||
) |
Resizes the image.
image | An image object. |
width | The new width (in pixels). |
height | The new height (in pixels). |
void lraspi_image_rotate | ( | lraspi_Image * | image, |
float | angle | ||
) |
Rotates the image.
image | An image object. |
angle | The new value (in radians). |
void lraspi_image_setfilter | ( | lraspi_Image * | image, |
lraspi_FilterMode | filter | ||
) |
Sets the image filter.
image | An image object. |
filter | The filter to apply to the image. |
void lraspi_image_setpixel | ( | lraspi_Image * | image, |
lraspi_Colour * | colour, | ||
int | x, | ||
int | y | ||
) |
Sets the colour pixel of the image.
image | An image object. |
colour | An colour object. |
x | x-axis image position (in pixels). |
y | y-axis image position (in pixels). |
void lraspi_image_vflip | ( | lraspi_Image * | image, |
bool | vflip | ||
) |
Flips the image vertically.
image | An image object. |
vflip | True to flip the image vertically, false otherwise. |