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. More... | |
void | clear (unsigned short nColor) |
Clears the bitmap with the given RGB565 color. More... | |
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. More... | |
void | drawImage (int nX, int nY, const Image *nImage, bool nTransparent=false) |
Draws another bitmap inside this bitmap. More... | |
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'. More... | |
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). More... | |
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. More... | |
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. More... | |
unsigned short | getColorKey () const |
int | getHeight () const |
Returns the height of the image. More... | |
unsigned short | getPixel (int nX, int nY) const |
Returns a pixel. More... | |
unsigned short * | getPixels () |
Returns the pixel buffer. More... | |
const unsigned short * | getPixels () const |
Returns the pixel buffer. More... | |
int | getWidth () const |
Returns the width of the image. More... | |
void | setPixel (int x, int y, unsigned short col) |
Sets a pixel. More... | |
void | setPixel (int x, int y, int r, int g, int b) |
Sets a pixel. More... | |
void | setPixels (int nWidth, int nHeight, unsigned short *nPixels, bool nPixelsOwner) |
Sets a new pixel buffer. More... | |
void | setTransparentColor (int nRed, int nGreen, int nBlue) |
Sets the color key that is treated as transparent. More... | |
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. More... | |
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.
|
inlineprotected |
void PN::Image::clear | ( | int | nRed, |
int | nGreen, | ||
int | nBlue | ||
) |
void PN::Image::clear | ( | unsigned short | nColor | ) |
|
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 |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
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.