DCMTK  Version 3.6.5
OFFIS DICOM Toolkit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DcmQuantHistogramItemList Class Reference

this is a helper class used by class DcmQuantColorHashTable. More...

Public Member Functions

 DcmQuantHistogramItemList ()
 constructor
 
 ~DcmQuantHistogramItemList ()
 destructor. Destroys all objects pointed to by list.
 
void moveto (DcmQuantHistogramItemPointer *array, unsigned long &counter, unsigned long numcolors)
 this method moves the contents of this list into the given array. More...
 
int lookup (const DcmQuantPixel &colorP)
 searches the list for an entry that equals the given pixel value. More...
 
unsigned long add (const DcmQuantPixel &colorP)
 adds the given pixel to the list. More...
 
void push_front (const DcmQuantPixel &colorP, int value)
 inserts a new DcmQuantHistogramItem at the beginning of the list. More...
 
size_t size () const
 returns current number of objects in the list
 

Private Member Functions

 OFListIterator (DcmQuantHistogramItem *) first
 temporary iterator used in various methods; declared here for efficiency reasons only.
 
 OFListIterator (DcmQuantHistogramItem *) last
 constant iterator which always contains list_.end(); declared here for efficiency reasons only.
 

Private Attributes

OFList< DcmQuantHistogramItem * > list_
 list of (pointers to) DcmQuantHistogramItem objects
 

Detailed Description

this is a helper class used by class DcmQuantColorHashTable.

It maintains a list of DcmQuantHistogramItem objects.

Member Function Documentation

◆ add()

unsigned long DcmQuantHistogramItemList::add ( const DcmQuantPixel colorP)
inline

adds the given pixel to the list.

If the pixel is already contained in the list, it's integer value (counter) is increased and 0 is returned. Otherwise, a new entry with a counter of 1 is created and 1 is returned.

Parameters
colorPpixel to add to the list
Returns
0 if pixel was already in list, 1 otherwise.

◆ lookup()

int DcmQuantHistogramItemList::lookup ( const DcmQuantPixel colorP)
inline

searches the list for an entry that equals the given pixel value.

If found, the integer value assigned to that pixel is returned, otherwise returns -1.

Parameters
colorPpixel to lookup in list
Returns
integer value for given color if found, -1 otherwise.

Referenced by DcmQuantColorHashTable::lookup().

◆ moveto()

void DcmQuantHistogramItemList::moveto ( DcmQuantHistogramItemPointer array,
unsigned long &  counter,
unsigned long  numcolors 
)

this method moves the contents of this list into the given array.

The list becomes empty if the array is large enough to contain all list members.

Parameters
arrayarray of pointers to DcmQuantHistogramItem
counterWhen called, contains the index of the array element into which the first member of the list will be moved. Must be < numcolors. Upon return, contains the array index of the last element moved + 1.
numcolorsnumber of elements in array

◆ push_front()

void DcmQuantHistogramItemList::push_front ( const DcmQuantPixel colorP,
int  value 
)
inline

inserts a new DcmQuantHistogramItem at the beginning of the list.

Parameters
colorPpixel value assigned to the new object in the list
valueinteger value assigned to the new object in the list

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


Generated on Mon Oct 28 2019 for DCMTK Version 3.6.5 by Doxygen 1.8.15