Logo Search packages:      
Sourcecode: djvulibre version File versions

GPixmapScaler Class Reference

#include <GScaler.h>

Inheritance diagram for GPixmapScaler:

GScaler GPEnabled

List of all members.


Detailed Description

Fast rescaling code for color images. This class augments the base class {GScaler} with a function for rescaling color images. Function {GPixmapScaler::scale} computes an arbitrary segment of the output image given the corresponding pixels in the input image.

{ Example} --- The following functions returns a color image of size nw# by nh# containing a rescaled version of the input image in#. {verbatim} GPixmap *rescale_pixmap(const GPixmap &in, int nw, int nh) { int w = in.columns(); // Get input width int h = in.raws(); // Get output width GPixmapScaler scaler(w,h,nw,nh); // Creates bitmap scaler GRect desired(0,0,nw,nh); // Desired output = complete image GRect provided(0,0,w,h); // Provided input = complete image GPixmap *out = new GPixmap; scaler.scale(provided, in, desired, *out); // Rescale return out; } {verbatim}

Definition at line 259 of file GScaler.h.


Public Member Functions

int get_count (void) const
void get_input_rect (const GRect &desired_output, GRect &required_input)
void scale (const GRect &provided_input, const GPixmap &input, const GRect &desired_output, GPixmap &output)
void set_horz_ratio (int numer, int denom)
void set_input_size (int w, int h)
void set_output_size (int w, int h)
void set_vert_ratio (int numer, int denom)
virtual ~GPixmapScaler ()
 Virtual destructor.

Static Public Member Functions

static GP< GPixmapScalercreate (const int inw, const int inh, const int outw, const int outh)
static GP< GPixmapScalercreate (void)

Protected Member Functions

GPixelget_line (int, const GRect &, const GRect &, const GPixmap &)
 GPixmapScaler (int inw, int inh, int outw, int outh)
void make_rectangles (const GRect &desired, GRect &red, GRect &inp)

Protected Attributes

volatile int count
 The reference counter.
GPBuffer< int > ghcoord
GPBufferBase glbuffer
GPBufferBase gp1
GPBufferBase gp2
GPBuffer< int > gvcoord
int * hcoord
int inh
int inw
int l1
int l2
GPixellbuffer
int outh
int outw
GPixelp1
GPixelp2
int redh
int redw
int * vcoord
int xshift
int yshift

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

Generated by  Doxygen 1.6.0   Back to index