Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
PN::Image Class Reference

The Image class provides basic RGB565 image handing capabilities. More...

#include <Image.h>

List of all members.

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 ImagecreateFromPixelBuffer (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

Detailed Description

The Image class provides basic RGB565 image handing capabilities.

Definition at line 42 of file Image.h.


Constructor & Destructor Documentation

virtual PN::Image::~Image ( ) [inline, virtual]

Definition at line 52 of file Image.h.

PN::Image::Image ( int  nWidth,
int  nHeight,
unsigned short *  nPixels,
bool  nPixelsOwner 
) [inline, protected]

Definition at line 154 of file Image.h.

PN::Image::Image ( Image nImage) [inline, protected]

Definition at line 159 of file Image.h.


Member Function Documentation

void PN::Image::clear ( int  nRed,
int  nGreen,
int  nBlue 
)

Clears the bitmap with the given RGB color.

Definition at line 81 of file Image.cpp.

void PN::Image::clear ( unsigned short  nColor)

Clears the bitmap with the given RGB565 color.

Definition at line 50 of file Image.cpp.

Image * PN::Image::createFromPixelBuffer ( int  nWidth,
int  nHeight,
unsigned short *  nPixels,
bool  nOwner 
) [static]

Creates an Image object directly from a pixel buffer.

Pixels must be supplied in RGB565 format. If nOwner is true then the Image object will take care for deleting the pixel buffer during destruction.

Definition at line 288 of file Image.cpp.

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.

Definition at line 88 of file Image.cpp.

void PN::Image::drawImage ( int  nX,
int  nY,
const Image nImage,
bool  nTransparent = false 
)

Draws another bitmap inside this bitmap.

nImage is rendered to the position nX/nY. If nTransparent is true, then nImage's transparent color is not copied with the other pixels.

Definition at line 144 of file Image.cpp.

void PN::Image::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'.

CAUTION: No clipping is performed!

Definition at line 204 of file Image.cpp.

void PN::Image::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).

CAUTION: No clipping is performed!

Definition at line 198 of file Image.cpp.

void PN::Image::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.

A rectangle from nX0/nY0 (top-left) to nX1/nY1 (bottom-right) is rendered with the given color (RGB) and transparency (0 means fully visibile, 255 means invisible).

Definition at line 153 of file Image.cpp.

void PN::Image::fillRect ( int  nX0,
int  nY0,
int  nX1,
int  nY1,
unsigned short  nColor,
int  nTransparency = 0 
)

Fills a rectangle with the given color ans transparency.

A rectangle from nX0/nY0 (top-left) to nX1/nY1 (bottom-right) is rendered with the given color (RGB) and transparency (0 means fully visibile, 255 means invisible).

Definition at line 159 of file Image.cpp.

unsigned short PN::Image::getColorKey ( ) const [inline]

Definition at line 151 of file Image.h.

int PN::Image::getHeight ( ) const [inline]

Returns the height of the image.

Definition at line 62 of file Image.h.

unsigned short PN::Image::getPixel ( int  nX,
int  nY 
) const [inline]

Returns a pixel.

Caution: no clipping is performed.

Definition at line 142 of file Image.h.

unsigned short* PN::Image::getPixels ( ) [inline]

Returns the pixel buffer.

Definition at line 133 of file Image.h.

const unsigned short* PN::Image::getPixels ( ) const [inline]

Returns the pixel buffer.

Definition at line 136 of file Image.h.

int PN::Image::getWidth ( ) const [inline]

Returns the width of the image.

Definition at line 59 of file Image.h.

void PN::Image::setPixel ( int  x,
int  y,
unsigned short  col 
)

Sets a pixel.

CAUTION: No clipping is performed!

Definition at line 274 of file Image.cpp.

void PN::Image::setPixel ( int  x,
int  y,
int  r,
int  g,
int  b 
)

Sets a pixel.

CAUTION: No clipping is performed!

Definition at line 282 of file Image.cpp.

void PN::Image::setPixels ( int  nWidth,
int  nHeight,
unsigned short *  nPixels,
bool  nPixelsOwner 
)

Sets a new pixel buffer.

If nPixelsOwner is true, then the image object will delete the buffer (calling delete) during destruction.

Definition at line 296 of file Image.cpp.

void PN::Image::setTransparentColor ( int  nRed,
int  nGreen,
int  nBlue 
)

Sets the color key that is treated as transparent.


Member Data Documentation

unsigned short PN::Image::colorKey [protected]

Definition at line 169 of file Image.h.

int PN::Image::height [protected]

Definition at line 165 of file Image.h.

unsigned short* PN::Image::pixels [protected]

Definition at line 166 of file Image.h.

bool PN::Image::pixelsOwner [protected]

Definition at line 167 of file Image.h.

int PN::Image::width [protected]

Definition at line 165 of file Image.h.


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


v4r_artoolkitplus
Author(s): Markus Bader
autogenerated on Wed Aug 26 2015 16:41:53