Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

PLPixel32 Class Reference

32 bit pixel class. More...

#include <plpixel32.h>

Collaboration diagram for PLPixel32:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PLPixel32 ()
 PLPixel32 (PLBYTE r, PLBYTE g, PLBYTE b, PLBYTE a)
 PLPixel32 (PLBYTE r, PLBYTE g, PLBYTE b)
void Set (PLBYTE r, PLBYTE g, PLBYTE b, PLBYTE a)
void Set (PLBYTE r, PLBYTE g, PLBYTE b)
void SetR (PLBYTE r)
void SetG (PLBYTE g)
void SetB (PLBYTE b)
void SetA (PLBYTE a)
PLBYTE GetR () const
PLBYTE GetG () const
PLBYTE GetB () const
PLBYTE GetA () const
bool operator== (const PLPixel32 Pix) const
bool operator!= (const PLPixel32 Pix) const
int BoxDist (const PLPixel32 Pix) const
 Simple and fast 'distance' between two pixels.

Static Public Member Functions

PLPixel32 Blend (int Factor, const PLPixel32 Pix1, const PLPixel32 Pix2)
 Returns a weighed average between two pixels.

Private Attributes

PLBYTE m_Data [4]

Detailed Description

32 bit pixel class.

A pixel in this class contains 8 bits each of red, green, blue and alpha. The order of the color components is OS-dependent and defined in config.h. This class is meant to be fast, so all methods are inlined.

Definition at line 21 of file plpixel32.h.


Constructor & Destructor Documentation

PLPixel32::PLPixel32  )  [inline]
 

Definition at line 72 of file plpixel32.h.

Referenced by Blend().

PLPixel32::PLPixel32 PLBYTE  r,
PLBYTE  g,
PLBYTE  b,
PLBYTE  a
[inline]
 

Definition at line 77 of file plpixel32.h.

References PLBYTE, and Set().

Here is the call graph for this function:

PLPixel32::PLPixel32 PLBYTE  r,
PLBYTE  g,
PLBYTE  b
[inline]
 

Definition at line 83 of file plpixel32.h.

References PLBYTE, and Set().

Here is the call graph for this function:


Member Function Documentation

PLPixel32 PLPixel32::Blend int  Factor,
const PLPixel32  Pix1,
const PLPixel32  Pix2
[inline, static]
 

Returns a weighed average between two pixels.

Factor must be between 0 and 256. Factor=256 means Pix1 is the result, Factor=0 means Pix2 is the result.

Definition at line 159 of file plpixel32.h.

References GetA(), GetB(), GetG(), GetR(), PLASSERT, and PLPixel32().

Here is the call graph for this function:

int PLPixel32::BoxDist const PLPixel32  Pix  )  const [inline]
 

Simple and fast 'distance' between two pixels.

Just adds the distances between the color components and treats colors equally.

Definition at line 152 of file plpixel32.h.

References linalg::abs(), GetB(), GetG(), and GetR().

Referenced by PLBmp::FindNearestColor().

Here is the call graph for this function:

PLBYTE PLPixel32::GetA  )  const [inline]
 

Definition at line 147 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by PLFilterGetAlpha::Apply(), and Blend().

PLBYTE PLPixel32::GetB  )  const [inline]
 

Definition at line 141 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by Blend(), BoxDist(), PLFilterQuantize::colorDist(), PLFilterQuantize::ditherDestBmp(), PLTIFFEncoder::DoTiffEncode(), PLJPEGEncoder::encodeRGB(), PLFilterQuantize::genMedianPalette(), PLFilterQuantize::getColorTableIndex(), PLFilterQuantize::getShiftedColorTableIndex(), PLPixel24::operator=(), and PLFilterQuantize::squeeze().

PLBYTE PLPixel32::GetG  )  const [inline]
 

Definition at line 135 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by Blend(), BoxDist(), PLFilterQuantize::colorDist(), PLFilterQuantize::ditherDestBmp(), PLTIFFEncoder::DoTiffEncode(), PLJPEGEncoder::encodeRGB(), PLFilterQuantize::genMedianPalette(), PLFilterQuantize::getColorTableIndex(), PLFilterQuantize::getShiftedColorTableIndex(), PLPixel24::operator=(), and PLFilterQuantize::squeeze().

PLBYTE PLPixel32::GetR  )  const [inline]
 

Definition at line 129 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by Blend(), BoxDist(), PLFilterQuantize::colorDist(), PLFilterQuantize::ditherDestBmp(), PLTIFFEncoder::DoTiffEncode(), PLJPEGEncoder::encodeRGB(), PLFilterQuantize::genMedianPalette(), PLFilterQuantize::getColorTableIndex(), PLFilterQuantize::getShiftedColorTableIndex(), PLPixel24::operator=(), and PLFilterQuantize::squeeze().

bool PLPixel32::operator!= const PLPixel32  Pix  )  const [inline]
 

Definition at line 174 of file plpixel32.h.

bool PLPixel32::operator== const PLPixel32  Pix  )  const [inline]
 

Definition at line 169 of file plpixel32.h.

References PLLONG.

void PLPixel32::Set PLBYTE  r,
PLBYTE  g,
PLBYTE  b
[inline]
 

Definition at line 98 of file plpixel32.h.

References m_Data, and PLBYTE.

void PLPixel32::Set PLBYTE  r,
PLBYTE  g,
PLBYTE  b,
PLBYTE  a
[inline]
 

Definition at line 89 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by createTrueColorCopy(), PLFilterQuantize::ditherDestBmp(), PLPCXDecoder::DoDecode(), PLTIFFDecoder::doHiColor(), PLPPMDecoder::expandByteLine(), PLFilterQuantize::genMedianPalette(), PLFilterQuantize::genPopularityPalette(), PLPixel32(), PLPPMDecoder::readASCIIPixel32(), and PLTGADecoder::readPixel32().

void PLPixel32::SetA PLBYTE  a  )  [inline]
 

Definition at line 123 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by PLBmp::SetAlphaChannel(), and PLPictDecoder::unpack32bits().

void PLPixel32::SetB PLBYTE  b  )  [inline]
 

Definition at line 117 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by PLJPEGDecoder::decodeRGB(), PLFilterQuantize::genPopularityPalette(), PLPictDecoder::readColourTable(), and PLPictDecoder::unpack32bits().

void PLPixel32::SetG PLBYTE  g  )  [inline]
 

Definition at line 111 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by PLJPEGDecoder::decodeRGB(), PLFilterQuantize::genPopularityPalette(), PLPictDecoder::readColourTable(), and PLPictDecoder::unpack32bits().

void PLPixel32::SetR PLBYTE  r  )  [inline]
 

Definition at line 105 of file plpixel32.h.

References m_Data, and PLBYTE.

Referenced by PLJPEGDecoder::decodeRGB(), PLFilterQuantize::genPopularityPalette(), PLPictDecoder::readColourTable(), and PLPictDecoder::unpack32bits().


Member Data Documentation

PLBYTE PLPixel32::m_Data[4] [private]
 

Definition at line 69 of file plpixel32.h.

Referenced by GetA(), GetB(), GetG(), GetR(), Set(), SetA(), SetB(), SetG(), and SetR().


The documentation for this class was generated from the following file:
Generated on Wed Dec 15 21:21:01 2004 for vuVolume by  doxygen 1.3.9.1