DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DiColorPixelTemplate< T > Class Template Reference

Template class to handle color pixel data. More...

+ Inheritance diagram for DiColorPixelTemplate< T >:

List of all members.

Public Member Functions

 DiColorPixelTemplate (const DiDocument *docu, const DiInputPixel *pixel, const Uint16 samples, EI_Status &status, const Uint16 sample_rate=0)
 constructor
virtual ~DiColorPixelTemplate ()
 destructor
EP_Representation getRepresentation () const
 get integer representation
const void * getData () const
 get pointer to internal array of pixel data.
void * getDataPtr ()
 get pointer to internal array of pixel data.
void * getDataArrayPtr ()
 get pointer to internal array of pixel data.
OFBool getPixelData (void *data, const unsigned long count, const unsigned long fcount, const unsigned long frames, const int planar) const
 fill given memory block with pixel data (all three image planes, RGB)
unsigned long createDIB (void *&data, const unsigned long size, const Uint16 width, const Uint16 height, const unsigned long frame, const int fromBits, const int toBits, const int mode, const int upsideDown, const int padding) const
 create true color (24/32 bit) bitmap for MS Windows.
unsigned long createAWTBitmap (void *&data, const Uint16 width, const Uint16 height, const unsigned long frame, const int fromBits, const int toBits) const
 create true color (32 bit) bitmap for Java (AWT default format).

Protected Member Functions

 DiColorPixelTemplate (const DiColorPixel *pixel, const unsigned long count)
 constructor
int Init (const void *pixel)
 initialize internal memory

Protected Attributes

T * Data [3]
 pointer to pixel data (3 components)

Private Member Functions

 DiColorPixelTemplate (const DiColorPixelTemplate< T > &)
DiColorPixelTemplate< T > & operator= (const DiColorPixelTemplate< T > &)

Detailed Description

template<class T>
class DiColorPixelTemplate< T >

Template class to handle color pixel data.


Constructor & Destructor Documentation

template<class T>
DiColorPixelTemplate< T >::DiColorPixelTemplate ( const DiDocument docu,
const DiInputPixel pixel,
const Uint16  samples,
EI_Status &  status,
const Uint16  sample_rate = 0 
) [inline]

constructor

Parameters:
docupointer to the DICOM document
pixelpointer to input pixel data
samplesnumber of expected samples per pixel (for checking purposes)
statusstatus of the image object (reference variable)
sample_ratedummy parameter (used for derived classes only)
template<class T>
DiColorPixelTemplate< T >::DiColorPixelTemplate ( const DiColorPixel pixel,
const unsigned long  count 
) [inline, protected]

constructor

Parameters:
pixelpointer to intermediate color pixel data
countnumber of pixels

Member Function Documentation

template<class T>
unsigned long DiColorPixelTemplate< T >::createAWTBitmap ( void *&  data,
const Uint16  width,
const Uint16  height,
const unsigned long  frame,
const int  fromBits,
const int  toBits 
) const [inline, virtual]

create true color (32 bit) bitmap for Java (AWT default format).

Parameters:
dataresulting pointer to bitmap data (set to NULL if an error occurred)
widthnumber of columns of the image
heightnumber of rows of the image
frameindex of frame to be converted (starting from 0)
fromBitsnumber of bits per sample used for internal representation of the image
toBitsnumber of bits per sample used for the output bitmap (<= 8)
Returns:
number of bytes allocated by the bitmap, or 0 if an error occured

Implements DiColorPixel.

template<class T>
unsigned long DiColorPixelTemplate< T >::createDIB ( void *&  data,
const unsigned long  size,
const Uint16  width,
const Uint16  height,
const unsigned long  frame,
const int  fromBits,
const int  toBits,
const int  mode,
const int  upsideDown,
const int  padding 
) const [inline, virtual]

create true color (24/32 bit) bitmap for MS Windows.

Parameters:
datauntyped pointer memory buffer (set to NULL if not allocated externally)
sizesize of the memory buffer in bytes (if 0 'data' is set to NULL)
widthnumber of columns of the image
heightnumber of rows of the image
frameindex of frame to be converted (starting from 0)
fromBitsnumber of bits per sample used for internal representation of the image
toBitsnumber of bits per sample used for the output bitmap (<= 8)
modecolor output mode (24 or 32 bits, see dcmimgle/dcmimage.h for details)
upsideDownspecifies the order of lines in the images (0 = top-down, bottom-up otherwise)
paddingalign each line to a 32-bit address if true
Returns:
number of bytes allocated by the bitmap, or 0 if an error occured

Implements DiColorPixel.

template<class T>
const void* DiColorPixelTemplate< T >::getData ( ) const [inline, virtual]

get pointer to internal array of pixel data.

The returned array [0..2] points to the three image planes.

Returns:
pointer to array of pixel data

Implements DiPixel.

template<class T>
void* DiColorPixelTemplate< T >::getDataArrayPtr ( ) [inline, virtual]

get pointer to internal array of pixel data.

The returned array [0..2] points to the three image planes.

Returns:
reference to pointer to pixel data

Implements DiPixel.

template<class T>
void* DiColorPixelTemplate< T >::getDataPtr ( ) [inline, virtual]

get pointer to internal array of pixel data.

The returned array [0..2] points to the three image planes.

Returns:
pointer to array of pixel data

Implements DiPixel.

template<class T>
OFBool DiColorPixelTemplate< T >::getPixelData ( void *  data,
const unsigned long  count,
const unsigned long  fcount,
const unsigned long  frames,
const int  planar 
) const [inline, virtual]

fill given memory block with pixel data (all three image planes, RGB)

Parameters:
datapointer to memory block (array of 8 or 16 bit values, OB/OW)
countnumber of T-size entries allocated in the 'data' array
fcountnumber of pixels per frame
framestotal number of frames present in intermediate representation
planarflag indicating whether data shall be stored color-by-pixel or color-by-plane
Returns:
OFTrue if successful, OFFalse otherwise

Implements DiColorPixel.

template<class T>
EP_Representation DiColorPixelTemplate< T >::getRepresentation ( ) const [inline, virtual]

get integer representation

Returns:
integer representation of the internally stored pixel data

Reimplemented from DiPixelRepresentationTemplate< T >.

template<class T>
int DiColorPixelTemplate< T >::Init ( const void *  pixel) [inline, protected]

initialize internal memory

Parameters:
pixelpointer to input pixel data
Returns:
true (1) if successful, false (0) otherwise

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


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027