Fast rescaling code for color images.
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; }
set_input_size and set_output_size. The
size of the output image is given by outw and outh. .
GPixmapScaler(int inw, int inh, int outw, int outh)
void scale( const GRect &provided_input, const GPixmap &input, const GRect &desired_output, GPixmap &output )
Alphabetic index HTML hierarchy of classes or Java