Class to represent ready-to-display RGB image data. More...
#include <cmtkImageRGB.h>
Public Member Functions | |
const byte * | GetDataPtr () const |
Get pointer to RGB data. | |
byte * | GetDataPtr (const bool forceAlloc) |
Get pointer to RGB data. | |
void | GetPixel (RGBA &rgb, const int index) |
Return RGBA pixel data. | |
void | SetPixel (const int index, const RGBA &rgb) |
Set RGBA pixel data. | |
void | GetPixel (RGB &rgb, const int index) |
Return RGB pixel data. | |
void | SetPixel (const int index, const RGB &rgb) |
Set RGB pixel data. | |
void | SetAlphaChannel (const ImageAlphaToggle alphaChannel, const bool convertData=false) |
Set alpha channel flag. | |
ImageAlphaToggle | GetAlphaChannel () const |
Return current image mode. | |
bool | IsGreyscale () const |
Return true if this image is actually grey valued. | |
Static Public Member Functions | |
static ImageRGB * | New () |
Construct new class instance. | |
Protected Member Functions | |
ImageRGB () | |
Default costructor. | |
~ImageRGB () | |
Destructor. | |
Private Attributes | |
byte * | Data |
Pointer to the RGB image data. | |
ImageAlphaToggle | AlphaChannel |
The current image mode (RGB or RGB+Alpha). | |
unsigned int | BytesPerPixel |
The number of bytes per pixel associated with the current image mode. | |
unsigned int | DataSize |
The number of bytes allocated for the currently allocated Data array. |
Class to represent ready-to-display RGB image data.
Definition at line 61 of file cmtkImageRGB.h.
ImageAlphaToggle cmtk::ImageRGB::GetAlphaChannel | ( | ) | const [inline] |
Return current image mode.
Definition at line 120 of file cmtkImageRGB.h.
const byte* cmtk::ImageRGB::GetDataPtr | ( | ) | const [inline] |
Get pointer to RGB data.
This function checks whether a data array of the appropriate size exists. If not, the old array is freed and a new one with the correct size is created.
Definition at line 74 of file cmtkImageRGB.h.
Referenced by cmtk::ImageToImageRGB::Execute().
ImageAlphaToggle cmtk::ImageRGB::AlphaChannel [private] |
The current image mode (RGB or RGB+Alpha).
Definition at line 143 of file cmtkImageRGB.h.
unsigned int cmtk::ImageRGB::BytesPerPixel [private] |
The number of bytes per pixel associated with the current image mode.
Definition at line 148 of file cmtkImageRGB.h.
byte* cmtk::ImageRGB::Data [private] |
Pointer to the RGB image data.
Every pixel is stored as three subsequent values R, G, B, and possibly Alpha. These are all in the range 0 (black) to 255 (maximum intensity).
Definition at line 139 of file cmtkImageRGB.h.
unsigned int cmtk::ImageRGB::DataSize [private] |
The number of bytes allocated for the currently allocated Data array.
Note that this is NOT the number of pixels which, depending on the state of "AlphaChannel", is only 1/4 or 1/3 of this value.
Definition at line 155 of file cmtkImageRGB.h.