#include <Image.h>
Public Types | |
enum | Format { RGB, RGBA } |
Public Member Functions | |
unsigned char * | getData () const |
Format | getFormat () const |
unsigned int | getHeight () const |
unsigned int | getWidth () const |
Static Public Member Functions | |
static Image * | create (const char *path) |
static Image * | create (unsigned int width, unsigned int height, Format format, unsigned char *data=NULL) |
Defines an image buffer of RGB or RGBA color data.
Currently only supports loading from .png image files.
Defines the set of supported color formats.
static Image* gameplay::Image::create | ( | const char * | path | ) | [static] |
Creates an image from the image file at the given path.
path | The path to the image file. |
static Image* gameplay::Image::create | ( | unsigned int | width, |
unsigned int | height, | ||
Format | format, | ||
unsigned char * | data = NULL |
||
) | [static] |
Creates an image from the data provided
width | The width of the image data. |
height | The height of the image data. |
format | The format of the image data. |
data | The image data. If NULL, the data will be allocated. |
unsigned char* gameplay::Image::getData | ( | ) | const [inline] |
Gets the image's raw pixel data.
Format gameplay::Image::getFormat | ( | ) | const [inline] |
Gets the image's format.
unsigned int gameplay::Image::getHeight | ( | ) | const [inline] |
Gets the height of the image.
unsigned int gameplay::Image::getWidth | ( | ) | const [inline] |
Gets the width of the image.