class GScaler

Base class for GBitmapScaler and GPixmapScaler.

Inheritance:


Public Methods

[more]void set_input_size(int w, int h)
Sets the size of the input image.
[more]void set_output_size(int w, int h)
Sets the size of the output image.
[more]void set_horz_ratio(int numer, int denom)
Sets the horizontal scaling ratio numer/denom.
[more]void set_vert_ratio(int numer, int denom)
Sets the vertical scaling ratio to numer/denom.
[more]void get_input_rect( const GRect &desired_output, GRect &required_input )
Computes which input pixels are required to compute specified output pixels.


Documentation

Base class for GBitmapScaler and GPixmapScaler. This base class implements the common elements of class GBitmapScaler and GPixmapScaler. Functions set_input_size and set_output_size are used to specify the size of the input image and the size of the output image. Functions set_horz_ratio and set_vert_ratio may be used to override the scaling ratios computed from the image sizes. You can then call function get_input_rect to know which pixels of the input image are necessary to compute a specified rectangular zone of the output image. The actual computation is then performed by calling function scale in class GBitmapScaler and GPixmapScaler.
ovoid set_input_size(int w, int h)
Sets the size of the input image. Argument w (resp. h) contains the horizontal (resp. vertical) size of the input image. This size is used to initialize the internal data structures of the scaler object.

ovoid set_output_size(int w, int h)
Sets the size of the output image. Argument w (resp. h) contains the horizontal (resp. vertical) size of the output image. This size is used to initialize the internal data structures of the scaler object.

ovoid set_horz_ratio(int numer, int denom)
Sets the horizontal scaling ratio numer/denom. This function may be used to force an exact scaling ratio. The scaling ratios are otherwise derived from the sizes of the input and output images.

ovoid set_vert_ratio(int numer, int denom)
Sets the vertical scaling ratio to numer/denom. This function may be used to force an exact scaling ratio. The scaling ratios are otherwise derived from the sizes of the input and output images.

ovoid get_input_rect( const GRect &desired_output, GRect &required_input )
Computes which input pixels are required to compute specified output pixels. Let us assume that we only need a part of the output image. This part is defined by rectangle desired_output. Only a part of the input image is necessary to compute the output pixels. Function get_input_rect computes the coordinates of that part of the input image, and stores them into rectangle required_input.


Direct child classes:
GPixmapScaler
GBitmapScaler

Alphabetic index HTML hierarchy of classes or Java