DCMTK Version 3.6.8
OFFIS DICOM Toolkit
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
DiColorOutputPixelTemplate< T1, T2 > Class Template Reference

Template class to create color output data. More...

+ Inheritance diagram for DiColorOutputPixelTemplate< T1, T2 >:

Public Member Functions

 DiColorOutputPixelTemplate (void *buffer, const DiColorPixel *pixel, const unsigned long count, const unsigned long frame, const int bits1, const int bits2, const int planar, const int inverse)
 constructor More...
 
 DiColorOutputPixelTemplate (void *buffer, const DiPixel *pixel, const unsigned long count, const unsigned long frame, const unsigned long, const int planar)
 constructor More...
 
virtual ~DiColorOutputPixelTemplate ()
 destructor
 
EP_Representation getRepresentation () const
 get integer representation More...
 
size_t getItemSize () const
 get size of one pixel / item in the pixel array More...
 
const void * getData () const
 get pointer to output pixel data More...
 
virtual void * getDataPtr ()
 get pointer to output pixel data More...
 
const void * getPlane (const int plane) const
 get pointer to given plane of output pixel data More...
 
int writePPM (STD_NAMESPACE ostream &stream) const
 write pixel data of selected frame to PPM/ASCII file More...
 
int writePPM (FILE *stream) const
 write pixel data of selected frame to PPM/ASCII file More...
 
- Public Member Functions inherited from DiColorOutputPixel
 DiColorOutputPixel (const DiPixel *pixel, const unsigned long size, const unsigned long frame)
 constructor More...
 
virtual ~DiColorOutputPixel ()
 destructor
 
virtual EP_Representation getRepresentation () const =0
 get integer representation (abstract) More...
 
virtual const void * getData () const =0
 get pointer to output pixel data (abstract) More...
 
virtual void * getDataPtr ()=0
 get pointer to output pixel data (abstract) More...
 
virtual const void * getPlane (const int plane) const =0
 get pointer to given plane of output pixel data (abstract) More...
 
virtual size_t getItemSize () const =0
 get size of one pixel / item in the pixel array (abstract) More...
 
virtual int writePPM (STD_NAMESPACE ostream &stream) const =0
 write pixel data of selected frame to PPM/ASCII file (abstract) More...
 
virtual int writePPM (FILE *stream) const =0
 write pixel data of selected frame to PPM/ASCII file (abstract) More...
 
unsigned long getCount () const
 get number of pixel per frame More...
 
- Public Member Functions inherited from DiPixelRepresentationTemplate< T2 >
 DiPixelRepresentationTemplate ()
 default constructor
 
virtual ~DiPixelRepresentationTemplate ()
 destructor
 
int isSigned () const
 check whether template type T is signed or not More...
 

Protected Attributes

T2 * Data
 pointer to the storage area where the output data should be stored
 
- Protected Attributes inherited from DiColorOutputPixel
unsigned long Count
 number of pixels per frame (intermediate representation)
 
const unsigned long FrameSize
 number of pixels per frame (memory buffer size)
 

Private Member Functions

void convert (const T1 *pixel[3], const unsigned long start, const int bits1, const int bits2, const int planar, const int inverse)
 convert intermediate pixel data to output format (render pixel data) More...
 

Private Attributes

int DeleteData
 flag indicating whether the output data buffer should be deleted in the destructor
 
int isPlanar
 flag indicating whether pixel data is stored color-by-pixel or color-by-plane
 

Additional Inherited Members

virtual EP_Representation getRepresentation () const
 determine integer representation for template type T More...
 

Detailed Description

template<class T1, class T2>
class DiColorOutputPixelTemplate< T1, T2 >

Template class to create color output data.

Constructor & Destructor Documentation

◆ DiColorOutputPixelTemplate() [1/2]

template<class T1 , class T2 >
DiColorOutputPixelTemplate< T1, T2 >::DiColorOutputPixelTemplate ( void *  buffer,
const DiColorPixel pixel,
const unsigned long  count,
const unsigned long  frame,
const int  bits1,
const int  bits2,
const int  planar,
const int  inverse 
)
inline

constructor

Parameters
bufferstorage area for the output pixel data (optional, maybe NULL)
pixelpointer to intermediate pixel representation (color)
countnumber of pixels per frame
frameframe to be rendered
bits1bit depth of input data (intermediate)
bits2bit depth of output data
planarflag indicating whether data shall be stored color-by-pixel or color-by-plane
inverseinvert pixel data if true (0/0/0 = white)

References DiColorOutputPixelTemplate< T1, T2 >::convert(), DiColorOutputPixel::Count, DiColorOutputPixelTemplate< T1, T2 >::Data, and DiColorOutputPixel::FrameSize.

◆ DiColorOutputPixelTemplate() [2/2]

template<class T1 , class T2 >
DiColorOutputPixelTemplate< T1, T2 >::DiColorOutputPixelTemplate ( void *  buffer,
const DiPixel pixel,
const unsigned long  count,
const unsigned long  frame,
const unsigned long  ,
const int  planar 
)
inline

constructor

Parameters
bufferstorage area for the output pixel data (optional, maybe NULL)
pixelpointer to intermediate pixel representation
countnumber of pixels per frame
frameframe to be rendered (#)param frames (total number of frames present in intermediate representation)
planarflag indicating whether data shall be stored color-by-pixel or color-by-plane

References DiColorOutputPixel::Count, DiColorOutputPixelTemplate< T1, T2 >::Data, and DiColorOutputPixel::FrameSize.

Member Function Documentation

◆ convert()

template<class T1 , class T2 >
void DiColorOutputPixelTemplate< T1, T2 >::convert ( const T1 *  pixel[3],
const unsigned long  start,
const int  bits1,
const int  bits2,
const int  planar,
const int  inverse 
)
inlineprivate

convert intermediate pixel data to output format (render pixel data)

Parameters
pixelpointer to intermediate pixel representation (color)
startoffset to first pixel to be converted
bits1bit depth of input data (intermediate)
bits2bit depth of output data
planarflag indicating whether data shall be stored color-by-pixel or color-by-plane
inverseinvert pixel data if true (0/0/0 = white)

References DiColorOutputPixel::Count, DiColorOutputPixelTemplate< T1, T2 >::Data, DiColorOutputPixel::FrameSize, DicomImageClass::maxval(), and OFBitmanipTemplate< T >::zeroMem().

Referenced by DiColorOutputPixelTemplate< T1, T2 >::DiColorOutputPixelTemplate().

◆ getData()

template<class T1 , class T2 >
const void * DiColorOutputPixelTemplate< T1, T2 >::getData ( ) const
inlinevirtual

get pointer to output pixel data

Returns
pointer to pixel data

Implements DiColorOutputPixel.

References DiColorOutputPixelTemplate< T1, T2 >::Data.

◆ getDataPtr()

template<class T1 , class T2 >
virtual void * DiColorOutputPixelTemplate< T1, T2 >::getDataPtr ( )
inlinevirtual

get pointer to output pixel data

Returns
pointer to pixel data

Implements DiColorOutputPixel.

References DiColorOutputPixelTemplate< T1, T2 >::Data.

◆ getItemSize()

template<class T1 , class T2 >
size_t DiColorOutputPixelTemplate< T1, T2 >::getItemSize ( ) const
inlinevirtual

get size of one pixel / item in the pixel array

Returns
item size

Implements DiColorOutputPixel.

◆ getPlane()

template<class T1 , class T2 >
const void * DiColorOutputPixelTemplate< T1, T2 >::getPlane ( const int  plane) const
inlinevirtual

get pointer to given plane of output pixel data

Parameters
planenumber of the plane to be retrieved (0..2)
Returns
pointer to beginning of plane if successful, NULL otherwise

Implements DiColorOutputPixel.

References DiColorOutputPixelTemplate< T1, T2 >::Data, DiColorOutputPixel::FrameSize, and DiColorOutputPixelTemplate< T1, T2 >::isPlanar.

◆ getRepresentation()

template<class T1 , class T2 >
EP_Representation DiColorOutputPixelTemplate< T1, T2 >::getRepresentation ( ) const
inlinevirtual

get integer representation

Returns
integer representation

Implements DiColorOutputPixel.

References DiPixelRepresentationTemplate< T >::getRepresentation().

◆ writePPM() [1/2]

template<class T1 , class T2 >
int DiColorOutputPixelTemplate< T1, T2 >::writePPM ( FILE *  stream) const
inlinevirtual

write pixel data of selected frame to PPM/ASCII file

Parameters
streamopen C file stream
Returns
status, true if successful, false otherwise

Implements DiColorOutputPixel.

References DiColorOutputPixelTemplate< T1, T2 >::Data, and DiColorOutputPixel::FrameSize.

◆ writePPM() [2/2]

template<class T1 , class T2 >
int DiColorOutputPixelTemplate< T1, T2 >::writePPM ( STD_NAMESPACE ostream &  stream) const
inlinevirtual

write pixel data of selected frame to PPM/ASCII file

Parameters
streamopen C++ output stream
Returns
status, true if successful, false otherwise

Implements DiColorOutputPixel.

References DiColorOutputPixelTemplate< T1, T2 >::Data, and DiColorOutputPixel::FrameSize.


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


Generated on Tue Dec 19 2023 for DCMTK Version 3.6.8 by Doxygen 1.9.4