Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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 Methods

 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 18 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:
width width of the new image
height height of the new image
format format that the pixels are stored in
pixels pixel buffer that the SimpleImage takes ownership of. it should be width*height*sizeof(pixel) bytes.
palette palette color buffer
palette_size number of entries in palette
palette_format color format palette is stored as

Definition at line 34 of file SimpleImage.h.

corona::SimpleImage::~SimpleImage   [inline]
 

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

Definition at line 54 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 59 of file SimpleImage.h.

References COR_CALL.

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

Get image height.

Returns:
image height

Implements corona::Image.

Definition at line 63 of file SimpleImage.h.

References COR_CALL.

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

Get pixel format.

Returns:
pixel format

Implements corona::Image.

Definition at line 67 of file SimpleImage.h.

References COR_CALL, and corona::PixelFormat.

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 71 of file SimpleImage.h.

References COR_CALL.

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 75 of file SimpleImage.h.

References COR_CALL.

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 79 of file SimpleImage.h.

References COR_CALL.

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 83 of file SimpleImage.h.

References COR_CALL, and corona::PixelFormat.


The documentation for this class was generated from the following file:
Generated on Thu Oct 2 13:00:18 2003 for corona by doxygen1.3-rc1