class GPixmapScaler: public GScaler

Fast rescaling code for color images.

Inheritance:


Public Methods

[more] GPixmapScaler()
Constructs an empty GPixmapScaler.
[more] GPixmapScaler(int inw, int inh, int outw, int outh)
Constructs a GPixmapScaler.
[more]void scale( const GRect &provided_input, const GPixmap &input, const GRect &desired_output, GPixmap &output )
Computes a segment of the rescaled output image.


Inherited from GScaler:

Public Methods

ovoid set_input_size(int w, int h)
ovoid set_output_size(int w, int h)
ovoid set_horz_ratio(int numer, int denom)
ovoid set_vert_ratio(int numer, int denom)
ovoid get_input_rect( const GRect &desired_output, GRect &required_input )


Documentation

Fast rescaling code for color images. This class augments the base class GScaler with a function for rescaling color images. Function 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

    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;
    }
    
o GPixmapScaler()
Constructs an empty GPixmapScaler. You must call functions set_input_size and set_output_size before calling any of the scaling functions.

o GPixmapScaler(int inw, int inh, int outw, int outh)
Constructs a GPixmapScaler. The size of the input image is given by

set_input_size and set_output_size. The size of the output image is given by outw and outh. .

ovoid scale( const GRect &provided_input, const GPixmap &input, const GRect &desired_output, GPixmap &output )
Computes a segment of the rescaled output image. The pixmap output is overwritten with the segment of the output image specified by the rectangle desired_output. The rectangle provided_input specifies which segment of the input image is provided in the pixmap exception GException is thrown if the rectangle provided_input is smaller then the rectangle required_input returned by function get_input_rect.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java


DjVu is a trademark of LizardTech, Inc.
All other products mentioned are registered trademarks or trademarks of their respective companies.