Logo Search packages:      
Sourcecode: djvulibre version File versions

GPixmap Class Reference

#include <GPixmap.h>

Inheritance diagram for GPixmap:


List of all members.

Detailed Description

RGB Color images. Instances of class GPixmap# represent color images as a two dimensional array of pixels {GPixel}. The bracket operator returns a pointer to the pixels composing one line of the image. This pointer can be used as an array to read or write the pixels of this particular line. Following the general convention of the DjVu Reference Library, line zero is always the bottom line of the image.

Definition at line 148 of file GPixmap.h.

Manipulating colors.

void color_correct (double corr)
void ordered_32k_dither (int xmin=0, int ymin=0)
void ordered_666_dither (int xmin=0, int ymin=0)
static void color_correct (double corr, GPixel *pixels, int npixels)

Public Member Functions

void destroy (void)
int get_count (void) const
int get_grays (void) const
void set_grays (int)
virtual ~GPixmap ()
 Virtual destructor.
Blitting and applying stencils.
These function is essential for rendering DjVu images. The elementary functions are {attenuate} and {blit}. The combined functions {blend} and {stencil} should be viewed as optimizations.

void attenuate (const GBitmap *bm, int x, int y)
void blend (const GBitmap *bm, int x, int y, const GPixmap *color)
void blit (const GBitmap *bm, int x, int y, const GPixmap *color)
void blit (const GBitmap *bm, int x, int y, const GPixel *color)
void stencil (const GBitmap *bm, const GPixmap *pm, int pms, const GRect *pmr, double corr=1.0)
Stealing or borrowing the memory buffer (advanced).

void borrow_data (GPixel &data, int w, int h)
void donate_data (GPixel *data, int w, int h)
 Identical to the above, but GPixmap will do the delete [].
GP< GPixmaprotate (int count=0)
GPixeltake_data (size_t &offset)
Accessing pixels.

unsigned int columns () const
GPixeloperator[] (int row)
const GPixeloperator[] (int row) const
unsigned int rows () const
unsigned int rowsize () const
Resampling images.

void downsample (const GPixmap *src, int factor, const GRect *rect=0)
void downsample43 (const GPixmap *src, const GRect *rect=0)
void upsample (const GPixmap *src, int factor, const GRect *rect=0)
void upsample23 (const GPixmap *src, const GRect *rect=0)

unsigned int get_memory_usage () const
void save_ppm (ByteStream &bs, int raw=1) const

void init (ByteStream &ref)
void init (const GBitmap &ref, const GRect &rect, const GPixel *ramp=0)
void init (const GBitmap &ref, const GPixel *ramp=0)
void init (const GPixmap &ref, const GRect &rect)
void init (const GPixmap &ref)
void init (int nrows, int ncolumns, const GPixel *filler=0)
GPixmapoperator= (const GPixmap &ref)
GPixmapoperator= (const GBitmap &ref)

Static Public Member Functions


static GP< GPixmapcreate (ByteStream &ref)
static GP< GPixmapcreate (const GPixmap &ref, const GRect &rect)
static GP< GPixmapcreate (const GPixmap &ref)
static GP< GPixmapcreate (const GBitmap &ref, const GRect &rect)
static GP< GPixmapcreate (const GBitmap &ref)
static GP< GPixmapcreate (const int nrows, const int ncolumns, const GPixel *filler=0)
static GP< GPixmapcreate (void)

Protected Member Functions

 GPixmap (ByteStream &ref)
 GPixmap (const GPixmap &ref, const GRect &rect)
 GPixmap (const GPixmap &ref)
 GPixmap (const GBitmap &ref, const GRect &rect)
 GPixmap (const GBitmap &ref)
 GPixmap (int nrows, int ncolumns, const GPixel *filler=0)

Protected Attributes

volatile int count
 The reference counter.
unsigned short ncolumns
unsigned short nrows
unsigned short nrowsize


class DjVu_PixImage

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

Generated by  Doxygen 1.6.0   Back to index