Loading...
Searching...
No Matches
DiColorPixelTemplate< T > Class Template Reference

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

Inheritance diagram for DiColorPixelTemplate< T >:

## 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).
Public Member Functions inherited from DiColorPixel
| DiColorPixel (const DiDocument *docu, const DiInputPixel *pixel, const Uint16 samples, EI_Status &status, const Uint16 sample_rate=0)
| constructor
virtual | ~DiColorPixel ()
| destructor
int | getPlanes () const
| get number of planes
int | getPlanarConfiguration () const
| get planar configuration of the original pixel data
Public Member Functions inherited from DiPixel
| DiPixel (const unsigned long count, const unsigned long inputCount=0)
| constructor
virtual | ~DiPixel ()
| destructor
unsigned long | getCount () const
| get number of pixels
unsigned long | getInputCount () const
| get number of pixels stored in the 'PixelData' element
Public Member Functions inherited from DiPixelRepresentationTemplate< T >
| DiPixelRepresentationTemplate ()
| default constructor
virtual | ~DiPixelRepresentationTemplate ()
| destructor
int | isSigned () const
| check whether template type T is signed or not

## Protected Member Functions

| DiColorPixelTemplate (const DiColorPixel *pixel, const unsigned long count)
| constructor
int | Init (const void *pixel)
| initialize internal memory
Protected Member Functions inherited from DiColorPixel
| DiColorPixel (const DiColorPixel *pixel, const unsigned long count)
| constructor

## Protected Attributes

T * | Data [3]
| pointer to pixel data (3 components)
Protected Attributes inherited from DiColorPixel
int | PlanarConfiguration
| planar configuration of the original pixel data (0 = color-by-pixel, 1 = color-by-plane)
Protected Attributes inherited from DiPixel
unsigned long | Count
| number of pixels
unsigned long | InputCount
| number of pixels in the input buffer

## Detailed Description

template<class T>
class DiColorPixelTemplate< T >

Template class to handle color pixel data.

## Constructor & Destructor Documentation

## DiColorPixelTemplate() [1/2]

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

  docu | pointer to the DICOM document
  pixel | pointer to input pixel data
  samples | number of expected samples per pixel (for checking purposes)
  status | status of the image object (reference variable)
  sample_rate | dummy parameter (used for derived classes only)

References DiColorPixel::DiColorPixel(), and Data.

Referenced by DiColorCopyTemplate< T >::DiColorCopyTemplate(), DiColorFlipTemplate< T >::DiColorFlipTemplate(), DiColorRotateTemplate< T >::DiColorRotateTemplate(), and DiColorScaleTemplate< T >::DiColorScaleTemplate().

## DiColorPixelTemplate() [2/2]

template<class T>

DiColorPixelTemplate< T >::DiColorPixelTemplate | ( | const DiColorPixel * | pixel,
|  | const unsigned long | count )

inline protected

constructor

Parameters

  pixel | pointer to intermediate color pixel data
  count | number of pixels

References DiColorPixel::DiColorPixel(), and Data.

## Member Function Documentation

## createAWTBitmap()

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

  data | resulting pointer to bitmap data (set to NULL if an error occurred)
  width | number of columns of the image
  height | number of rows of the image
  frame | index of frame to be converted (starting from 0)
  fromBits | number of bits per sample used for internal representation of the image
  toBits | number of bits per sample used for the output bitmap (<= 8)

Returns
  number of bytes allocated by the bitmap, or 0 if an error occurred

Implements DiColorPixel.

References Data, and DicomImageClass::maxval().

## createDIB()

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

  data | untyped pointer memory buffer (set to NULL if not allocated externally)
  size | size of the memory buffer in bytes (if 0 'data' is set to NULL)
  width | number of columns of the image
  height | number of rows of the image
  frame | index of frame to be converted (starting from 0)
  fromBits | number of bits per sample used for internal representation of the image
  toBits | number of bits per sample used for the output bitmap (<= 8)
  mode | color output mode (24 or 32 bits, see dcmimgle/dcmimage.h for details)
  upsideDown | specifies the order of lines in the images (0 = top-down, bottom-up otherwise)
  padding | align each line to a 32-bit address if true

Returns
  number of bytes allocated by the bitmap, or 0 if an error occurred

Implements DiColorPixel.

References Data, and DicomImageClass::maxval().

## getData()

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.

References Data.

## getDataArrayPtr()

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.

References Data.

## getDataPtr()

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.

References Data.

## getPixelData()

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

  data | pointer to memory block (array of 8 or 16 bit values, OB/OW)
  count | number of T-size entries allocated in the 'data' array
  fcount | number of pixels per frame
  frames | total number of frames present in intermediate representation
  planar | flag indicating whether data shall be stored color-by-pixel or color-by-plane

Returns
  OFTrue if successful, OFFalse otherwise

Implements DiColorPixel.

References OFBitmanipTemplate< T >::copyMem(), DiPixel::Count, and Data.

## getRepresentation()

template<class T>

EP_Representation DiColorPixelTemplate< T >::getRepresentation | ( |  | ) | const

inline virtual

get integer representation

Returns
  integer representation of the internally stored pixel data

Implements DiPixel.

References DiPixelRepresentationTemplate< T >::getRepresentation().

## Init()

template<class T>

int DiColorPixelTemplate< T >::Init | ( | const void * | pixel | ) |

inline protected

initialize internal memory

Parameters

  pixel | pointer to input pixel data

Returns
  true (1) if successful, false (0) otherwise

References DiPixel::Count, Data, DiPixel::InputCount, and OFBitmanipTemplate< T >::zeroMem().

Referenced by DiColorCopyTemplate< T >::copy(), DiColorFlipTemplate< T >::flip(), DiColorRotateTemplate< T >::rotate(), and DiColorScaleTemplate< T >::scale().

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

- dcmimage/include/dcmtk/dcmimage/dicopxt.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0