DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
objects of this class represent individual RGB pixels. More...
Public Member Functions | |
DcmQuantPixel () | |
default constructor, creates black pixel | |
DcmQuantPixel (const DcmQuantPixel &arg) | |
copy assignment constructor | |
virtual | ~DcmQuantPixel () |
destructor | |
OFBool | operator== (const DcmQuantPixel &src) const |
comparison operator for equality | |
double | luminance () const |
this method computes the luminance of the current pixel according to the NTSC formula. More... | |
unsigned long | hash () const |
this method computes an unsigned long hash value for the current pixel. More... | |
DcmQuantComponent | getRed () const |
returns the red component More... | |
DcmQuantComponent | getGreen () const |
returns the green component More... | |
DcmQuantComponent | getBlue () const |
returns the blue component More... | |
void | assign (DcmQuantComponent r, DcmQuantComponent g, DcmQuantComponent b) |
assigns new R, G and B values to this pixel More... | |
void | scale (DcmQuantComponent r, DcmQuantComponent g, DcmQuantComponent b, const DcmQuantScaleTable &table) |
assigns new R, G and B values to this pixel using the given scale table in which all three values are looked up. More... | |
Private Attributes | |
DcmQuantComponent | red |
red color component of this pixel | |
DcmQuantComponent | green |
green color component of this pixel | |
DcmQuantComponent | blue |
blue color component of this pixel | |
objects of this class represent individual RGB pixels.
This class is used by the color quantization classes. For efficiency considerations, all methods are declared inline.
|
inline |
assigns new R, G and B values to this pixel
r | new R |
g | new G |
b | new B |
Referenced by DcmQuantFloydSteinberg::adjust().
|
inline |
returns the blue component
Referenced by DcmQuantFloydSteinberg::adjust(), DcmQuantColorTable::computeIndex(), and DcmQuantFloydSteinberg::propagate().
|
inline |
returns the green component
Referenced by DcmQuantFloydSteinberg::adjust(), DcmQuantColorTable::computeIndex(), and DcmQuantFloydSteinberg::propagate().
|
inline |
returns the red component
Referenced by DcmQuantFloydSteinberg::adjust(), DcmQuantColorTable::computeIndex(), and DcmQuantFloydSteinberg::propagate().
|
inline |
this method computes an unsigned long hash value for the current pixel.
The hash algorithm is taken from Jef Poskanzer's ppm utility library. The return value is guaranteed to be < DcmQuantHashSize.
Referenced by DcmQuantColorHashTable::item(), and DcmQuantColorHashTable::lookup().
|
inline |
this method computes the luminance of the current pixel according to the NTSC formula.
The range of the luminance equals the range of the underlying DcmQuantComponent type. However, the luminance is returned as a double.
|
inline |
assigns new R, G and B values to this pixel using the given scale table in which all three values are looked up.
r | new R |
g | new G |
b | new B |
table | scale table (LUT) in which R, G and B are looked up. |
Referenced by DcmQuantColorMapping< T1, T2 >::create().