Logo Search packages:      
Sourcecode: djvulibre version File versions

GBitmapScaler Class Reference

#include <GScaler.h>

Inheritance diagram for GBitmapScaler:

GScaler GPEnabled

List of all members.


Detailed Description

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

{ Example} --- The following functions returns an gray level image (sixteen gray levels, size nw# by nh#) containing a rescaled version of the input image in#. {verbatim} GBitmap *rescale_bitmap(const GBitmap &in, int nw, int nh) { int w = in.columns(); // Get input width int h = in.raws(); // Get output width GBitmapScaler scaler(w,h,nw,nh); // Creates bitmap scaler GRect desired(0,0,nw,nh); // Desired output = complete bitmap GRect provided(0,0,w,h); // Provided input = complete bitmap GBitmap *out = new GBitmap; scaler.scale(provided, in, desired, *out); // Rescale out->change_grays(16); // Reduce to 16 gray levels return out; } {verbatim}

Definition at line 185 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 GBitmap &input, const GRect &desired_output, GBitmap &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 ~GBitmapScaler ()
 Virtual destructor.

Static Public Member Functions

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

Protected Member Functions

 GBitmapScaler (int inw, int inh, int outw, int outh)
unsigned char * get_line (int, const GRect &, const GRect &, const GBitmap &)
void make_rectangles (const GRect &desired, GRect &red, GRect &inp)

Protected Attributes

unsigned char * conv
volatile int count
 The reference counter.
GPBuffer< unsigned char > gconv
GPBuffer< int > ghcoord
GPBuffer< unsigned char > glbuffer
GPBuffer< unsigned char > gp1
GPBuffer< unsigned char > gp2
GPBuffer< int > gvcoord
int * hcoord
int inh
int inw
int l1
int l2
unsigned char * lbuffer
int outh
int outw
unsigned char * p1
unsigned char * p2
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