# IpeBitmap Class Reference
[Ipe Base]

A bitmap. More...

List of all members.

## Public Types

- enum TFilter { EDirect, EFlateDecode, EDCTDecode }
- enum TColorSpace { EDeviceRGB, EDeviceGray, EDeviceCMYK }

## Public Member Functions

- IpeBitmap ()
- IpeBitmap (int width, int height, TColorSpace colorSpace, int bitsPerComponent, IpeBuffer data, TFilter filter)
- IpeBitmap (const IpeXmlAttributes &attr, IpeString data, bool rawData)
- IpeBitmap (const IpeBitmap &rhs)
- ~IpeBitmap ()
- IpeBitmap & operator= (const IpeBitmap &rhs)
- void SaveAsXml (IpeStream &stream, int id, int pdfObjNum=-1) const
- bool IsNull () const
- bool Equal (IpeBitmap rhs) const
- TColorSpace ColorSpace () const
- TFilter Filter () const
- int Components () const
- int BitsPerComponent () const
- int Width () const
- int Height () const
- const char * Data () const
- int Size () const
- int ObjNum () const
- void SetObjNum (int objNum) const
- void * RenderData () const
- void SetRenderData (void *data) const
- bool operator== (const IpeBitmap &rhs) const
- bool operator!= (const IpeBitmap &rhs) const
- bool operator< (const IpeBitmap &rhs) const
- void ComputeChecksum ()

## Detailed Description

A bitmap.

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.

## Constructor & Destructor Documentation

IpeBitmap::IpeBitmap | ( |  | ) |

| Default constructor constructs null bitmap.

IpeBitmap::IpeBitmap | ( | int | width,
|  | int | height,
|  | TColorSpace | colorSpace,
|  | int | bitsPerComponent,
|  | IpeBuffer | data,
|  | TFilter | filter
| ) |

| Create a new image.

IpeBitmap::IpeBitmap | ( | const IpeXmlAttributes & | attr,
|  | IpeString | data,
|  | bool | rawData
| ) |

| Create from XML stream.

IpeBitmap::IpeBitmap | ( | const IpeBitmap & | rhs | ) |

| Copy constructor.

IpeBitmap::~IpeBitmap | ( |  | ) |

| Destructor.

## Member Function Documentation

IpeBitmap & IpeBitmap::operator= | ( | const IpeBitmap & | rhs | ) |

| 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.

void * IpeBitmap::RenderData | ( |  | ) | const`[inline]`

| Return cached bitmap for rendering.

void IpeBitmap::SetRenderData | ( | void * | data | ) | const

| Set a cached bitmap for fast rendering.

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 block of them are next to blocks that are identical in contents.

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

- ipebitmap.h
- ipebitmap.cpp