class IWBitmap: public GPEnabled

IW44 encoded gray-level image.

Inheritance:


Public Fields

[more] Writes a color image into a DjVu IW44 file.

Public Methods

[more] IWBitmap()
Null constructor.
[more]void init(const GBitmap *bm, const GBitmap *mask=0)
Initializes an IWBitmap with image bm.
[more] IWBitmap(const GBitmap *bm, const GBitmap *mask=0)
Convenience constructor.
[more]int get_width() const
Returns the width of the IWBitmap image.
[more]int get_height() const
Returns the height of the IWBitmap image.
[more]GP<GBitmap> get_bitmap()
Reconstructs the complete image.
[more]GP<GBitmap> get_bitmap(int subsample, const GRect &rect)
Reconstructs a segment of the image at a given scale.
[more]unsigned int get_memory_usage() const
Returns the amount of memory used by the wavelet coefficients.
[more]int get_percent_memory() const
Returns the filling ratio of the internal data structure.
[more]int encode_chunk(ByteStream &bs, const IWEncoderParms &parms)
Encodes one data chunk into ByteStream bs.
[more]int get_width() const
Writes a gray level image into DjVu IW44 file.
[more]int get_height() const
Returns the height of the IWPixmap image.
[more]GP<GPixmap> get_pixmap()
Reconstructs the complete image.
[more]GP<GPixmap> get_pixmap(int subsample, const GRect &rect)
Reconstructs a segment of the image at a given scale.
[more]unsigned int get_memory_usage() const
Returns the amount of memory used by the wavelet coefficients.
[more]int get_percent_memory() const
Returns the filling ratio of the internal data structure.
[more]int encode_chunk(ByteStream &bs, const IWEncoderParms &parms)
Encodes one data chunk into ByteStream bs.


Inherited from GPEnabled:

Public Methods

oGPEnabled& operator=(const GPEnabled & obj)

Protected Fields

ovolatile int count

Protected Methods

ovirtual void destroy()


Documentation

IW44 encoded gray-level image. This class provided functions for managing a gray level image represented as a collection of IW44 wavelet coefficients. The coefficients are stored in a memory efficient data structure. Member function get_bitmap renders an arbitrary segment of the image into a GBitmap. Member functions decode_iff and encode_iff read and write DjVu IW44 files (see IWImage.h). Both the copy constructor and the copy operator are declared as private members. It is therefore not possible to make multiple copies of instances of this class.
o IWBitmap()
Null constructor. Constructs an empty IWBitmap object. This object does not contain anything meaningful. You must call function init, decode_iff or decode_chunk to populate the wavelet coefficient data structure.

ovoid init(const GBitmap *bm, const GBitmap *mask=0)
Initializes an IWBitmap with image bm. This constructor performs the wavelet decomposition of image bm and records the corresponding wavelet coefficient. Argument mask is an optional bilevel image specifying the masked pixels (see IWImage.h).

o IWBitmap(const GBitmap *bm, const GBitmap *mask=0)
Convenience constructor. This constructors creates an empty IWBitmap and then calls function init above.

oint get_width() const
Returns the width of the IWBitmap image.

oint get_height() const
Returns the height of the IWBitmap image.

oGP<GBitmap> get_bitmap()
Reconstructs the complete image. The reconstructed image is then returned as a GBitmap object.

oGP<GBitmap> get_bitmap(int subsample, const GRect &rect)
Reconstructs a segment of the image at a given scale. The subsampling ratio subsample must be a power of two between 1 and 32. Argument rect specifies which segment of the subsampled image should be reconstructed. The reconstructed image is returned as a GBitmap object whose size is equal to the size of the rectangle rect.

ounsigned int get_memory_usage() const
Returns the amount of memory used by the wavelet coefficients. This amount of memory is expressed in bytes.

oint get_percent_memory() const
Returns the filling ratio of the internal data structure. Wavelet coefficients are stored in a sparse array. This function tells what percentage of bins have been effectively allocated.

oint encode_chunk(ByteStream &bs, const IWEncoderParms &parms)
Encodes one data chunk into ByteStream bs. Parameter parms controls how much data is generated. The chunk data is written to ByteStream bs with no IFF header. Successive calls to successive chunks. You must call close_codec after encoding the last chunk of a file.

oint get_width() const
Writes a gray level image into DjVu IW44 file. This function creates a composite chunk (identifier FORM:BM44) composed of nchunks chunks (identifier BM44). Data for each chunk is generated with

void encode_iff(IFFByteStream &iff, int nchunks, const IWEncoderParms *parms);

int decode_chunk(ByteStream &bs);

void decode_iff(IFFByteStream &iff, int maxchunks=999);

void close_codec();

int get_serial();

void parm_dbfrac(float frac); private: float db_frac; _IWMap *ymap; _IWCodec *ycodec; int cslice; int cserial; int cbytes; IWBitmap(const IWBitmap &ref); IWBitmap& operator=(const IWBitmap &ref); };

class IWPixmap : public GPEnabled { public:

IWPixmap();

enum CRCBMode { CRCBnone, CRCBhalf, CRCBnormal, CRCBfull };

void init(const GPixmap *bm, const GBitmap *mask=0, CRCBMode crcbmode=CRCBnormal);

IWPixmap(const GPixmap *bm, const GBitmap *mask=0, CRCBMode crcbmode=CRCBnormal ); ~IWPixmap(); /** Returns the width of the IWPixmap image.

oint get_height() const
Returns the height of the IWPixmap image.

oGP<GPixmap> get_pixmap()
Reconstructs the complete image. The reconstructed image is then returned as a GPixmap object.

oGP<GPixmap> get_pixmap(int subsample, const GRect &rect)
Reconstructs a segment of the image at a given scale. The subsampling ratio subsample must be a power of two between 1 and 32. Argument rect specifies which segment of the subsampled image should be reconstructed. The reconstructed image is returned as a GPixmap object whose size is equal to the size of the rectangle rect.

ounsigned int get_memory_usage() const
Returns the amount of memory used by the wavelet coefficients. This amount of memory is expressed in bytes.

oint get_percent_memory() const
Returns the filling ratio of the internal data structure. Wavelet coefficients are stored in a sparse array. This function tells what percentage of bins have been effectively allocated.

oint encode_chunk(ByteStream &bs, const IWEncoderParms &parms)
Encodes one data chunk into ByteStream bs. Parameter parms controls how much data is generated. The chunk data is written to ByteStream bs with no IFF header. Successive calls to successive chunks. You must call close_codec after encoding the last chunk of a file.

o Writes a color image into a DjVu IW44 file.
Writes a color image into a DjVu IW44 file. This function creates a composite chunk (identifier FORM:PM44) composed of nchunks chunks (identifier PM44). Data for each chunk is generated with

void encode_iff(IFFByteStream &iff, int nchunks, const IWEncoderParms *parms);

int decode_chunk(ByteStream &bs);

void decode_iff(IFFByteStream &iff, int maxchunks=999);

void close_codec();

int get_serial();

int parm_crcbdelay(int parm);

void parm_dbfrac(float frac); private: int crcb_delay; int crcb_half; float db_frac; _IWMap *ymap, *cbmap, *crmap; _IWCodec *ycodec, *cbcodec, *crcodec; int cslice; int cserial; int cbytes; IWPixmap(const IWPixmap &ref); IWPixmap& operator=(const IWPixmap &ref); };


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java