Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes

cmtk::ImageRGB Class Reference
[cmtkPipeline Library]

Class to represent ready-to-display RGB image data. More...

#include <cmtkImageRGB.h>

Inheritance diagram for cmtk::ImageRGB:
Inheritance graph
[legend]
Collaboration diagram for cmtk::ImageRGB:
Collaboration graph
[legend]

List of all members.

Public Member Functions

const byteGetDataPtr () const
 Get pointer to RGB data.
byteGetDataPtr (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 ImageRGBNew ()
 Construct new class instance.

Protected Member Functions

 ImageRGB ()
 Default costructor.
 ~ImageRGB ()
 Destructor.

Private Attributes

byteData
 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.

Detailed Description

Class to represent ready-to-display RGB image data.

Definition at line 61 of file cmtkImageRGB.h.


Member Function Documentation

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().


Member Data Documentation

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.

See also:
AlphaChannel

Definition at line 148 of file cmtkImageRGB.h.

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.

See also:
AlphaChannel

Definition at line 155 of file cmtkImageRGB.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines