Rasterfarm-SDK
|
#include <image.h>
Public Types | |
enum | Format { RGB_565 , RGB_888 , BGR_888 , RGBA_8888 , BGRA_8888 , RGBA_5551 , RGBA_4444 , BGRA_4444 , ALPHA_8 , GRAY_8 , GRAY_16 , GRAY_ALPHA_8_8 , GRAY_ALPHA_15_1 , DEPTH_8 , DEPTH_16 , DEPTH_24 } |
Public Member Functions | |
Image (const char *filename) | |
virtual | ~Image () |
virtual Byte * | allocAndCreatePixels ()=0 |
virtual void | save (const char *file)=0 |
uint | getWidth () const |
uint | getHeight () const |
Format | getFormat () const |
Byte * | getData () const |
Static Public Member Functions | |
static Image * | createImage (const char *filename) |
static bool | isValid (const char *filename, const ByteArray &magic) |
static size_t | byteSize (PixelFormat pixelFormat) |
static Format | convert (PixelFormat pixelFormat) |
static bool | hasAlpha (PixelFormat pixelFormat) |
static PixelFormat | removeAlpha (PixelFormat pixelFormat) |
Public Attributes | |
size_t | dataSize |
Protected Attributes | |
uint | width |
uint | height |
uint | channels |
Format | format |
Byte * | pData |
ADT Class for managing image data. Derived-types would include jpeg, png,
ADT for Image decoding.
enum Image::Format |
Image::Image | ( | const char * | filename | ) |
|
virtual |
|
pure virtual |
Creates a new array of pixels on the heap. Caller must delete as this data is not managed.
Implemented in JpegImage, PngImage, TgaCompressedImage, TgaImage, and TgaUncompressedImage.
|
static |
Get the number of bytes per pixel for a given PixelFormat.
|
static |
Get the number of bytes per pixel for a given PixelFormat.
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
|
static |
|
static |
Get the alpha-less format best matches the given Format containing an alpha component.
|
pure virtual |
Saves a texture to the filesystem.
Pointer | to texture. |
The | texture's target-data to save. If not specified the QUAD target will be selected. |
Implemented in JpegImage, PngImage, TgaImage, and TgaUncompressedImage.
|
protected |
Also known as components (eg. red, green, blue, alpha)
size_t Image::dataSize |
|
protected |
|
protected |
|
protected |
|
protected |