The Image class provides basic RGB565 image handing capabilities. More...
#include <Image.h>
Public Member Functions | |
void | clear (int nRed, int nGreen, int nBlue) |
Clears the bitmap with the given RGB color. | |
void | clear (unsigned short nColor) |
Clears the bitmap with the given RGB565 color. | |
void | drawImage (int nX, int nY, const Image *nImage, int nSx0, int nSy0, int nSx1, int nSy1, bool nTransparent=false) |
Draws another bitmap inside this bitmap. | |
void | drawImage (int nX, int nY, const Image *nImage, bool nTransparent=false) |
Draws another bitmap inside this bitmap. | |
void | drawLine (int x1, int y1, int x2, int y2, unsigned short col) |
Renders a straight line from x1/y1 to x2/y1 with the color 'col'. | |
void | drawLine (int x1, int y1, int x2, int y2, int r, int g, int b) |
Renders a straight line from x1/y1 to x2/y1 with the color (r,g,b). | |
void | fillRect (int nX0, int nY0, int nX1, int nY1, int nRed, int nGreen, int nBlue, int nTransparency=0) |
Fills a rectangle with the given color ans transparency. | |
void | fillRect (int nX0, int nY0, int nX1, int nY1, unsigned short nColor, int nTransparency=0) |
Fills a rectangle with the given color ans transparency. | |
unsigned short | getColorKey () const |
int | getHeight () const |
Returns the height of the image. | |
unsigned short | getPixel (int nX, int nY) const |
Returns a pixel. | |
unsigned short * | getPixels () |
Returns the pixel buffer. | |
const unsigned short * | getPixels () const |
Returns the pixel buffer. | |
int | getWidth () const |
Returns the width of the image. | |
void | setPixel (int x, int y, unsigned short col) |
Sets a pixel. | |
void | setPixel (int x, int y, int r, int g, int b) |
Sets a pixel. | |
void | setPixels (int nWidth, int nHeight, unsigned short *nPixels, bool nPixelsOwner) |
Sets a new pixel buffer. | |
void | setTransparentColor (int nRed, int nGreen, int nBlue) |
Sets the color key that is treated as transparent. | |
virtual | ~Image () |
Static Public Member Functions | |
static Image * | createFromPixelBuffer (int nWidth, int nHeight, unsigned short *nPixels, bool nOwner) |
Creates an Image object directly from a pixel buffer. | |
Protected Member Functions | |
Image (int nWidth, int nHeight, unsigned short *nPixels, bool nPixelsOwner) | |
Image (Image *nImage) | |
Protected Attributes | |
unsigned short | colorKey |
int | height |
unsigned short * | pixels |
bool | pixelsOwner |
int | width |
The Image class provides basic RGB565 image handing capabilities.
virtual PN::Image::~Image | ( | ) | [inline, virtual] |
PN::Image::Image | ( | int | nWidth, |
int | nHeight, | ||
unsigned short * | nPixels, | ||
bool | nPixelsOwner | ||
) | [inline, protected] |
PN::Image::Image | ( | Image * | nImage | ) | [inline, protected] |
void PN::Image::clear | ( | int | nRed, |
int | nGreen, | ||
int | nBlue | ||
) |
void PN::Image::clear | ( | unsigned short | nColor | ) |
Image * PN::Image::createFromPixelBuffer | ( | int | nWidth, |
int | nHeight, | ||
unsigned short * | nPixels, | ||
bool | nOwner | ||
) | [static] |
void PN::Image::drawImage | ( | int | nX, |
int | nY, | ||
const Image * | nImage, | ||
int | nSx0, | ||
int | nSy0, | ||
int | nSx1, | ||
int | nSy1, | ||
bool | nTransparent = false |
||
) |
Draws another bitmap inside this bitmap.
nImage is rendered to the position nX/nY. nSx0/nSy0 and nSx1/nSy1 present the left-top and bottom-right rectangle position of nImage that is used for blitting. If nTransparent is true, then nImage's transparent color is not copied with the other pixels.
void PN::Image::drawImage | ( | int | nX, |
int | nY, | ||
const Image * | nImage, | ||
bool | nTransparent = false |
||
) |
void PN::Image::drawLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
unsigned short | col | ||
) |
void PN::Image::drawLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
void PN::Image::fillRect | ( | int | nX0, |
int | nY0, | ||
int | nX1, | ||
int | nY1, | ||
int | nRed, | ||
int | nGreen, | ||
int | nBlue, | ||
int | nTransparency = 0 |
||
) |
void PN::Image::fillRect | ( | int | nX0, |
int | nY0, | ||
int | nX1, | ||
int | nY1, | ||
unsigned short | nColor, | ||
int | nTransparency = 0 |
||
) |
unsigned short PN::Image::getColorKey | ( | ) | const [inline] |
int PN::Image::getHeight | ( | ) | const [inline] |
unsigned short PN::Image::getPixel | ( | int | nX, |
int | nY | ||
) | const [inline] |
unsigned short* PN::Image::getPixels | ( | ) | [inline] |
const unsigned short* PN::Image::getPixels | ( | ) | const [inline] |
int PN::Image::getWidth | ( | ) | const [inline] |
void PN::Image::setPixel | ( | int | x, |
int | y, | ||
unsigned short | col | ||
) |
void PN::Image::setPixel | ( | int | x, |
int | y, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
void PN::Image::setPixels | ( | int | nWidth, |
int | nHeight, | ||
unsigned short * | nPixels, | ||
bool | nPixelsOwner | ||
) |
void PN::Image::setTransparentColor | ( | int | nRed, |
int | nGreen, | ||
int | nBlue | ||
) |
Sets the color key that is treated as transparent.
unsigned short PN::Image::colorKey [protected] |
int PN::Image::height [protected] |
unsigned short* PN::Image::pixels [protected] |
bool PN::Image::pixelsOwner [protected] |
int PN::Image::width [protected] |