#include <plbitmap.h>
Inheritance diagram for PLBmp:
Public Member Functions | |
PLBmp () | |
virtual | ~PLBmp () |
Empty destructor. | |
PLBmp & | operator= (PLBmpBase const &Orig) |
PLBmp & | operator= (PLBmp const &Orig) |
virtual void | Create (PLLONG Width, PLLONG Height, const PLPixelFormat &pf, PLBYTE *pBits=0, int Stride=0, const PLPoint &Resolution=PLPoint(0, 0)) |
virtual void | Create (const PLBmpInfo &Info) |
void | CreateCopy (const PLBmpBase &rSrcBmp, const PLPixelFormat &pfWanted=PLPixelFormat::DONTCARE) |
void | CreateFilteredCopy (PLBmpBase &rSrcBmp, const PLFilter &rFilter) |
virtual long | GetMemUsed ()=0 |
Returns memory used by a bitmap. | |
virtual long | GetBytesPerLine ()=0 |
void | ApplyFilter (const PLFilter &Filter) |
Applies a filter to the bitmap. | |
Protected Member Functions | |
virtual void | initLocals (PLLONG Width, PLLONG Height, const PLPixelFormat &pf) |
Can be called from internalCreate() to initialize object state. | |
virtual void | internalCreate (PLLONG Width, PLLONG Height, const PLPixelFormat &pf)=0 |
virtual void | initLineArray ()=0 |
Initialize internal table of line addresses. | |
virtual void | freeMembers ()=0 |
Delete memory allocated by member variables. | |
void | internalCopy (const PLBmpBase &rSrcBmp) |
This class is an abstract base class. It exists to define a format-independent interface for bitmap manipulation and to provide common routines. Derived classes must support at least the color depths 1, 8 and 32 bpp. PLBmp defines a public interface for general use and a protected interface for use by derived classes.
For 32 bpp, alpha channel information is stored in one byte (PL_RGBA_ALPHA) of each 4-byte pixel. To allow for optimizations when no alpha channel is present, a flag is set whenever the alpha information is valid. The complete alpha channel of a bitmap can be replaced by a different one by calling SetAlphaChannel(). A 0 in an alpha channel entry is completely transparent; a 255 is completely opaque.
Definition at line 40 of file plbitmap.h.
|
Empty constructor. Constructors in derived classes create a small empty bitmap to ensure that the object is always in a sane state. |
|
Creates a new empty bitmap. Info contains the metadata (width, height, etc.) to be used in creation. |
|
Creates a new empty bitmap. Memory for the bits is allocated but not initialized. Previous contents of the bitmap object are discarded. If bAlphaChannel is true, the bitmap is assumed to contain a valid alpha channel. If pBits is non-null, it contains pixel data in the format expected by the bitmap and Stride is the distance in bytes from one source line to the next. In this case, the data in pBits is copied into the internal buffer of the PLBmp. |
|
Creates a copy of rSrcBmp, converting color depth if nessesary. Supports 1, 8, 16, 24 and 32 BPP. Alpha channel information is preserved if supported by the target bit depth. Conversion to 8 bpp is possible only from 1 and 32 bpp. |
|
Creates a copy of rSrcBmp, applying rFilter on the way. Depending on the filter called, this is often much faster than CreateCopy() followed by ApplyFilter(). |
|
Returns number of bytes used per line. Note that this is not the stride of the bitmap. Implemented in PLAnyBmp, PLDirectFBBmp, and PLWinBmp. |
|
Creates a new PLBmp as copy of rSrcBmp. Assumes there is no memory allocated yet. |
|
Create a new bitmap with uninitialized bits. (Assume no memory is allocated yet.) Implemented in PLAnyBmp. |
|
Assignment operator. Note that assignment between different derived classes is possible and results in a format conversion. Reimplemented in PLAnyBmp, PLDIBSection, and PLWinBmp. Definition at line 155 of file plbitmap.h. Referenced by PLWinBmp::operator=(), PLDirectFBBmp::operator=(), PLDIBSection::operator=(), and PLAnyBmp::operator=(). |