DcmQuantPixel Class Reference

objects of this class represent individual RGB pixels. More...

Inheritance diagram for DcmQuantPixel:

DcmQuantHistogramItem List of all members.

Public Member Functions

 DcmQuantPixel ()
 default constructor, creates black pixel
 DcmQuantPixel (const DcmQuantPixel &arg)
 copy assignment constructor
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.
unsigned long hash () const
 this method computes an unsigned long hash value for the current pixel.
DcmQuantComponent getRed () const
 returns the red component
DcmQuantComponent getGreen () const
 returns the green component
DcmQuantComponent getBlue () const
 returns the blue component
void assign (DcmQuantComponent r, DcmQuantComponent g, DcmQuantComponent b)
 assigns new R, G and B values to this pixel
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.

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

Detailed Description

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.

Definition at line 44 of file diqtpix.h.


Member Function Documentation

double DcmQuantPixel::luminance (  )  const [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.

Returns:
luminance of this pixel

Definition at line 80 of file diqtpix.h.

References blue, green, and red.

unsigned long DcmQuantPixel::hash (  )  const [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.

Returns:
hash value for current pixel

Definition at line 90 of file diqtpix.h.

References blue, green, and red.

Referenced by DcmQuantColorHashTable::add(), and DcmQuantColorHashTable::lookup().

DcmQuantComponent DcmQuantPixel::getRed (  )  const [inline]

returns the red component

Returns:
red component of this pixel

Definition at line 99 of file diqtpix.h.

References red.

Referenced by DcmQuantFloydSteinberg::adjust(), DcmQuantColorTable::computeIndex(), DcmQuantColorTable::getRed(), and DcmQuantFloydSteinberg::propagate().

DcmQuantComponent DcmQuantPixel::getGreen (  )  const [inline]

returns the green component

Returns:
green component of this pixel

Definition at line 107 of file diqtpix.h.

References green.

Referenced by DcmQuantFloydSteinberg::adjust(), DcmQuantColorTable::computeIndex(), DcmQuantColorTable::getGreen(), and DcmQuantFloydSteinberg::propagate().

DcmQuantComponent DcmQuantPixel::getBlue (  )  const [inline]

returns the blue component

Returns:
blue component of this pixel

Definition at line 115 of file diqtpix.h.

References blue.

Referenced by DcmQuantFloydSteinberg::adjust(), DcmQuantColorTable::computeIndex(), DcmQuantColorTable::getBlue(), and DcmQuantFloydSteinberg::propagate().

void DcmQuantPixel::assign ( DcmQuantComponent  r,
DcmQuantComponent  g,
DcmQuantComponent  b 
) [inline]

assigns new R, G and B values to this pixel

Parameters:
r new R
g new G
b new B

Definition at line 125 of file diqtpix.h.

References blue, green, and red.

Referenced by DcmQuantFloydSteinberg::adjust().

void DcmQuantPixel::scale ( DcmQuantComponent  r,
DcmQuantComponent  g,
DcmQuantComponent  b,
const DcmQuantScaleTable table 
) [inline]

assigns new R, G and B values to this pixel using the given scale table in which all three values are looked up.

Parameters:
r new R
g new G
b new B
table scale table (LUT) in which R, G and B are looked up.

Definition at line 143 of file diqtpix.h.

References blue, green, and red.

Referenced by DcmQuantColorMapping< T1, T2 >::create().


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


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1