Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

PLBmpBase Class Reference

#include <plbmpbase.h>

Inheritance diagram for PLBmpBase:

PLBmpInfo PLBmp PLSubBmp PLAnyBmp PLDirectFBBmp PLWinBmp PLDIBSection List of all members.

Public Member Functions

 PLBmpBase ()
 Empty constructor.

virtual ~PLBmpBase ()
 Empty destructor.

bool const operator== (PLBmpBase const &Other)
void CopyPixels (const PLBmpBase &SrcBmp)
void SetGrayPalette ()
void SetPalette (PLPixel32 *pPal)
 Sets the color table to pPal. The contents of pPal are copied.

void SetPaletteEntry (PLBYTE Entry, PLBYTE r, PLBYTE g, PLBYTE b, PLBYTE a)
void SetPaletteEntry (PLBYTE Entry, PLPixel32 Value)
void SetHasAlpha (bool b)
void SetAlphaChannel (PLBmpBase *pAlphaBmp)
void SetPixel (int x, int y, PLPixel32 pixel)
 Slow but simple function to set a single pixel. 32 bpp only.

PLPixel32 GetPixel (int x, int y) const
 Slow but simple function to get a single pixel. 32 bpp only.

PLBYTE FindNearestColor (PLPixel32 cr)
int GetNumColors ()
PLPixel32GetPalette () const
PLBYTE ** GetLineArray () const
PLPixel32 ** GetLineArray32 () const
PLPixel24 ** GetLineArray24 () const
PLPixel16 ** GetLineArray16 () const
bool AlmostEqual (const PLBmpBase &Bmp, int epsilon) const
void SetResolution (const PLPoint &Resolution)
 Sets the bitmap resolution in pixels per inch.

void SetQuantizationMode (int DitherType, int DitherPaletteType)

Protected Member Functions

virtual void initLocals (PLLONG Width, PLLONG Height, const PLPixelFormat &pf)
 Can be called from internalCreate() to initialize object state.

void create8BPPCopy (const PLBmpBase &rSrcBmp)
void create1BPPCopy (const PLBmpBase &rSrcBmp)

Protected Attributes

PLPixel32m_pClrTab
PLBYTE ** m_pLineArray
int m_DitherType
int m_DitherPaletteType

Detailed Description

Base class for PLBmp and PLSubBmp. PLBmpBase supports all operations on a bitmap that PLBmp supports except those that depend on being able to change the size or bpp.

Definition at line 26 of file plbmpbase.h.


Member Function Documentation

bool PLBmpBase::AlmostEqual const PLBmpBase Bmp,
int  epsilon
const
 

Returns true if Bmp and this are almost equal. The comparison is done by comparing the pixels in the bitmaps component-wise. If all components are closer than epsilon, the bitmaps are considered almost equal.

void PLBmpBase::CopyPixels const PLBmpBase SrcBmp  ) 
 

BitBlts SrcBmp on the current bitmap. Color depth conversion is performed as nessesary.

PLBYTE PLBmpBase::FindNearestColor PLPixel32  cr  ) 
 

Find the nearest color to cr in the palette used by this bitmap Only works for 8 bpp bitmaps.

PLBYTE ** PLBmpBase::GetLineArray  )  const [inline]
 

Returns pointer to an array containing the starting addresses of the bitmap lines. This array should be used whenever the bitmap bits need to be manipulated directly.

Definition at line 257 of file plbmpbase.h.

Referenced by PLFilterFillRect< PixelC >::ApplyInPlace(), and GetPixel().

PLPixel16 ** PLBmpBase::GetLineArray16  )  const [inline]
 

Returns pointer to an array containing the starting addresses of the bitmap lines. This array should be used whenever the bitmap bits need to be manipulated directly.

Definition at line 280 of file plbmpbase.h.

PLPixel24 ** PLBmpBase::GetLineArray24  )  const [inline]
 

Returns pointer to an array containing the starting addresses of the bitmap lines. This array should be used whenever the bitmap bits need to be manipulated directly.

Definition at line 272 of file plbmpbase.h.

PLPixel32 ** PLBmpBase::GetLineArray32  )  const [inline]
 

Returns pointer to an array containing the starting addresses of the bitmap lines. This array should be used whenever the bitmap bits need to be manipulated directly.

Definition at line 264 of file plbmpbase.h.

Referenced by SetPixel().

int PLBmpBase::GetNumColors  )  [inline]
 

Returns number of colors that can be stored by a bitmap with this color depth.

Definition at line 247 of file plbmpbase.h.

PLPixel32 * PLBmpBase::GetPalette  )  const [inline]
 

Returns the address of the color table of the bitmap or NULL if no color table exists. The color table is stored as an array of consecutive PLPixel32 objects.

Definition at line 288 of file plbmpbase.h.

bool const PLBmpBase::operator== PLBmpBase const &  Other  ) 
 

Test for equality. This function actually tests every pixel, so it's not fast. It's meant mainly for use in asserts and such.

void PLBmpBase::SetAlphaChannel PLBmpBase pAlphaBmp  ) 
 

Replaces the alpha channel of the bitmap with a new one. This only works for bitmaps with 32 bpp. pAlphaBmp must point to an 8 bpp bitmap with the same dimensions as the object. The alpha channel information is physically copied into the bitmap.

void PLBmpBase::SetGrayPalette  ) 
 

Fills the color table with a grayscale palette. This function is only usable for bitmaps containing a color table. Index 0 contains black (0) and the last index contains white (255). The alpha channel is set to opaque (255) for every palette entry.

void PLBmpBase::SetHasAlpha bool  b  ) 
 

Sets whether a bitmap stores an alpha channel. Works for 8 and 32 bpp bitmaps. In either case, if b is true and the bitmap did not have an alpha channel before the call, the complete alpha channel is set to opaque by the call.

void PLBmpBase::SetPaletteEntry PLBYTE  Entry,
PLPixel32  Value
[inline]
 

Sets one entry in the color table. The function may only be called if there is a color table stored with the bitmap. The color table entry is set to the red, green, blue, and alpha values specified.

Definition at line 220 of file plbmpbase.h.

void PLBmpBase::SetPaletteEntry PLBYTE  Entry,
PLBYTE  r,
PLBYTE  g,
PLBYTE  b,
PLBYTE  a
[inline]
 

Sets one entry in the color table. The function may only be called if there is a color table stored with the bitmap. The color table entry is set to the red, green, blue, and alpha values specified.

Definition at line 209 of file plbmpbase.h.

void PLBmpBase::SetQuantizationMode int  DitherType,
int  DitherPaletteType
 

Sets quality of conversion to 8 bpp by CreateCopy(). Valid parameters are defined in FilterQuantize.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 13 16:16:41 2004 for paintlib by doxygen 1.3.2