Logo Search packages:      
Sourcecode: paintlib version File versions

PLAnyBmp Class Reference

#include <planybmp.h>

Inheritance diagram for PLAnyBmp:

PLBmp PLBmpInfo

List of all members.

Detailed Description

Manipulates uncompressed device- and platform-independent bitmaps. Supported data formats are 1, 8, 24 and 32 bpp. The data is stored sequentially without padding in the bitmap. The class implements exactly the interface defined by PLBmp without additions.

Definition at line 22 of file planybmp.h.

Public Member Functions

bool AlmostEqual (const PLBmpBase &Bmp, int epsilon) const
void ApplyFilter (const PLFilter &Filter)
 Applies a filter to the bitmap.
virtual void AssertValid () const
void AsString (char *psz, int len) const
virtual void Create (const PLBmpInfo &Info)
virtual void Create (PLLONG Width, PLLONG Height, PLWORD BitsPerPixel, bool bAlphaChannel, bool bIsGreyscale, PLBYTE *pBits=0, int Stride=0, const PLPoint &Resolution=PLPoint(0, 0))
void CreateCopy (const PLBmpBase &rSrcBmp, int BPPWanted=0)
void CreateFilteredCopy (PLBmpBase &rSrcBmp, const PLFilter &rFilter)
PLBYTE FindNearestColor (PLPixel32 cr)
int GetBitsPerPixel () const
long GetBytesPerLine ()
 Returns number of bytes used per line.
int GetHeight () const
PLBYTE ** GetLineArray () const
PLPixel16 ** GetLineArray16 () const
PLPixel24 ** GetLineArray24 () const
PLPixel32 ** GetLineArray32 () const
long GetMemUsed ()
 Returns the amount of memory used by the object.
int GetNumColors ()
PLPixel32GetPalette () const
PLPixel32 GetPixel (int x, int y) const
 Slow but simple function to get a single pixel. 32 bpp only.
const PLBYTE * GetPixels () const
 Returns a raw pointer to the bitmap bits.
PLBYTE * GetPixels ()
 Returns a raw pointer to the bitmap bits.
const PLPointGetResolution () const
const PLPointGetSize () const
int GetWidth () const
bool HasAlpha () const
bool IsGreyscale () const
bool IsLocked () const
 Returns whether a bitmap surface is locked. (See Lock for specifics.).
virtual void Lock (bool bReadable, bool bWriteable)
PLAnyBmpoperator= (const PLAnyBmp &Orig)
 Assignment operator.
PLAnyBmpoperator= (const PLBmpBase &Orig)
 Assignment operator.
bool operator== (const PLBmpInfo &Other) const
bool const operator== (PLBmpBase const &Other)
 PLAnyBmp (const PLAnyBmp &Orig)
 Copy constructor.
 PLAnyBmp (const PLBmpBase &Orig)
 Copy constructor.
 PLAnyBmp ()
 Creates an empty bitmap.
void SetAlphaChannel (PLBmpBase *pAlphaBmp)
void SetGrayPalette ()
void SetHasAlpha (bool b)
void SetPalette (PLPixel32 *pPal)
 Sets the color table to pPal. The contents of pPal are copied.
void SetPaletteEntry (PLBYTE Entry, PLPixel32 Value)
void SetPaletteEntry (PLBYTE Entry, PLBYTE r, PLBYTE g, PLBYTE b, PLBYTE a)
void SetPixel (int x, int y, PLPixel32 pixel)
 Slow but simple function to set a single pixel. 32 bpp only.
void SetQuantizationMode (int DitherType, int DitherPaletteType)
void SetResolution (const PLPoint &Resolution)
 Sets the bitmap resolution in pixels per inch.
virtual void Unlock ()
 Unlocks the Bitmap surface. (See Lock for specifics.).
virtual ~PLAnyBmp ()
 Destroys the bitmap.

Static Public Member Functions

static long GetBitsMemNeeded (PLLONG width, PLLONG height, PLWORD BitsPerPixel)
 Returns memory needed by bitmap bits.
static long GetMemNeeded (PLLONG width, PLLONG height, PLWORD BitsPerPixel)
 Returns memory needed by a bitmap with the specified attributes.

Protected Member Functions

void create1BPPCopy (const PLBmpBase &rSrcBmp)
void create8BPPCopy (const PLBmpBase &rSrcBmp)
virtual void freeMembers ()
 Delete memory allocated by member variables.
virtual void initLineArray ()
 Initialize internal table of line addresses.
virtual void initLocals (PLLONG Width, PLLONG Height, PLWORD BitsPerPixel, bool bAlphaChannel, bool bIsGreyscale)
 Can be called from internalCreate() to initialize object state.
void internalCopy (const PLBmpBase &rSrcBmp)
virtual void internalCreate (PLLONG Width, PLLONG Height, PLWORD BitsPerPixel, bool bAlphaChannel, bool bIsGreyscale)
void SetBmpInfo (const PLBmpInfo &SrcInfo)
void SetBmpInfo (const PLPoint &Size, int bpp, const PLPoint &Resolution, bool bAlphaChannel, bool bIsGreyscale)

Protected Attributes

bool m_bAlphaChannel
bool m_bIsGreyscale
int m_bpp
int m_DitherPaletteType
int m_DitherType
int m_LockCount
PLBYTE * m_pBits
PLBYTE ** m_pLineArray
PLPoint m_Resolution
PLPoint m_Size

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

Generated by  Doxygen 1.6.0   Back to index