Bitmaps are explicitely shared using reference-counting. Copying is cheap, so IpeBitmap objects are meant to be passed by value.
The bitmap can cache data to speed up rendering. This data can be set only once (as the bitmap is conceptually immutable).
The bitmap also provides a slot for short-term storage of an "object number". The PDF embedder, for instance, sets it to the PDF object number when embedding the bitmap, and can reuse it when "drawing" the bitmap.
IpeBitmap::IpeBitmap | ( | ) |
Default constructor constructs null bitmap.
IpeBitmap::IpeBitmap | ( | int | width, | |
int | height, | |||
TColorSpace | colorSpace, | |||
int | bitsPerComponent, | |||
IpeBuffer | data, | |||
TFilter | filter, | |||
bool | deflate = false | |||
) |
Create a new image.
IpeBitmap::IpeBitmap | ( | const IpeXmlAttributes & | attr, | |
IpeString | data | |||
) |
Create from XML stream.
IpeBitmap::IpeBitmap | ( | const IpeXmlAttributes & | attr, | |
IpeBuffer | data | |||
) |
Create from XML using external raw data.
IpeBitmap::IpeBitmap | ( | const IpeBitmap & | rhs | ) |
Copy constructor.
IpeBitmap::~IpeBitmap | ( | ) |
Destructor.
Assignment operator (takes care of reference counting).
void IpeBitmap::SaveAsXml | ( | IpeStream & | stream, | |
int | id, | |||
int | pdfObjNum = -1 | |||
) | const |
Save bitmap in XML stream.
bool IpeBitmap::IsNull | ( | ) | const [inline] |
Is this a null bitmap?
IpeBitmap::TColorSpace IpeBitmap::ColorSpace | ( | ) | const [inline] |
Return the color space of the image.
IpeBitmap::TFilter IpeBitmap::Filter | ( | ) | const [inline] |
Return the data filter of the image data.
int IpeBitmap::Components | ( | ) | const [inline] |
Return number of components per pixel.
int IpeBitmap::BitsPerComponent | ( | ) | const [inline] |
Return the number of bits per component.
int IpeBitmap::Width | ( | ) | const [inline] |
Return width of pixel array.
int IpeBitmap::Height | ( | ) | const [inline] |
Return height of pixel array.
const char * IpeBitmap::Data | ( | ) | const [inline] |
Return a pointer to the image data (in PDF arrangement).
int IpeBitmap::Size | ( | ) | const [inline] |
Return size (number of bytes) of image data (in PDF arrangement).
int IpeBitmap::ObjNum | ( | ) | const [inline] |
Return object number of the bitmap.
void IpeBitmap::SetObjNum | ( | int | objNum | ) | const [inline] |
Set object number of the bitmap.
IpeBitmap::MRenderData * IpeBitmap::RenderData | ( | ) | const [inline] |
Return cached bitmap for rendering.
void IpeBitmap::SetRenderData | ( | MRenderData * | data | ) | const |
Set a cached bitmap for fast rendering.
IpeBuffer IpeBitmap::PixelData | ( | ) | const |
bool IpeBitmap::operator== | ( | const IpeBitmap & | rhs | ) | const [inline] |
Two bitmaps are equal if they share the same data.
bool IpeBitmap::operator!= | ( | const IpeBitmap & | rhs | ) | const [inline] |
Two bitmaps are equal if they share the same data.
bool IpeBitmap::operator< | ( | const IpeBitmap & | rhs | ) | const [inline] |
Less operator, to be able to sort bitmaps.
The checksum is used, when it is equal, the shared address. This guarantees that bitmaps that are == (share their implementation) are next to each other, and blocks of them are next to blocks that are identical in contents.