Logo Search packages:      
Sourcecode: paintlib version File versions

PLSDLBmp Class Reference

#include <plsdlbmp.h>

Inheritance diagram for PLSDLBmp:

PLBmp PLBmpInfo

List of all members.


Detailed Description

Manipulates uncompressed bitmaps stored as SDL surfaces. 32 bpp only.

Definition at line 22 of file plsdlbmp.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
void Attach (SDL_Surface *pSurface)
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 PLPointGetResolution () const
const PLPointGetSize () const
SDL_Surface * GetSurface ()
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)
PLSDLBmpoperator= (const PLSDLBmp &Orig)
 Assignment operator.
PLSDLBmpoperator= (const PLBmpBase &Orig)
 Assignment operator.
bool operator== (const PLBmpInfo &Other) const
bool const operator== (PLBmpBase const &Other)
 PLSDLBmp (const PLSDLBmp &Orig)
 Copy constructor.
 PLSDLBmp (const PLBmpBase &Orig)
 Copy constructor.
 PLSDLBmp (int SurfFlags=SDL_SWSURFACE)
 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 ~PLSDLBmp ()
 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
PLPixel32m_pClrTab
PLBYTE ** m_pLineArray
PLPoint m_Resolution
PLPoint m_Size

Private Attributes

SDL_Surface * m_pSurface
int m_SurfFlags

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

Generated by  Doxygen 1.6.0   Back to index