corona  1.0.2
Public Member Functions
corona::SimpleImage Class Reference

#include <SimpleImage.h>

Inheritance diagram for corona::SimpleImage:
Inheritance graph
[legend]
Collaboration diagram for corona::SimpleImage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SimpleImage (int width, int height, PixelFormat format, byte *pixels, byte *palette=0, int palette_size=0, PixelFormat palette_format=PF_DONTCARE)
 ~SimpleImage ()
int COR_CALL getWidth ()
int COR_CALL getHeight ()
PixelFormat COR_CALL getFormat ()
void *COR_CALL getPixels ()
void *COR_CALL getPalette ()
int COR_CALL getPaletteSize ()
PixelFormat COR_CALL getPaletteFormat ()

Detailed Description

Basic, flat, simple image. Has a width, a height, a pixel format, and a 2D array of pixels (one-byte packing).

The constructor takes a pixel buffer (and optionally a palette) which it then owns and delete[]'s when the image is destroyed.

Definition at line 19 of file SimpleImage.h.


Constructor & Destructor Documentation

corona::SimpleImage::SimpleImage ( int  width,
int  height,
PixelFormat  format,
byte pixels,
byte palette = 0,
int  palette_size = 0,
PixelFormat  palette_format = PF_DONTCARE 
) [inline]

Creates a new image, setting all properties.

Parameters:
widthwidth of the new image
heightheight of the new image
formatformat that the pixels are stored in
pixelspixel buffer that the SimpleImage takes ownership of. it should be width*height*sizeof(pixel) bytes.
palettepalette color buffer
palette_sizenumber of entries in palette
palette_formatcolor format palette is stored as

Definition at line 35 of file SimpleImage.h.

Destroys the image, freeing the owned pixel buffer and palette.

Definition at line 55 of file SimpleImage.h.


Member Function Documentation

int COR_CALL corona::SimpleImage::getWidth ( ) [inline, virtual]

Get image width.

Returns:
image width

Implements corona::Image.

Definition at line 60 of file SimpleImage.h.

int COR_CALL corona::SimpleImage::getHeight ( ) [inline, virtual]

Get image height.

Returns:
image height

Implements corona::Image.

Definition at line 64 of file SimpleImage.h.

PixelFormat COR_CALL corona::SimpleImage::getFormat ( ) [inline, virtual]

Get pixel format.

Returns:
pixel format

Implements corona::Image.

Definition at line 68 of file SimpleImage.h.

void* COR_CALL corona::SimpleImage::getPixels ( ) [inline, virtual]

Get pixel buffer. The pixels are packed in the format defined by the image's pixel format.

Returns:
pointer to first element in pixel buffer

Implements corona::Image.

Definition at line 72 of file SimpleImage.h.

void* COR_CALL corona::SimpleImage::getPalette ( ) [inline, virtual]

Get the palette. Pixels are packed in the format defined by getPaletteFormat().

Returns:
pointer to first palette entry

Implements corona::Image.

Definition at line 76 of file SimpleImage.h.

int COR_CALL corona::SimpleImage::getPaletteSize ( ) [inline, virtual]

Get the number of entries in the palette.

Returns:
number of palette entries

Implements corona::Image.

Definition at line 80 of file SimpleImage.h.

PixelFormat COR_CALL corona::SimpleImage::getPaletteFormat ( ) [inline, virtual]

Get the format of the colors in the palette.

Returns:
pixel format of palette entries

Implements corona::Image.

Definition at line 84 of file SimpleImage.h.


The documentation for this class was generated from the following file: