kviewshell
GScaler Class Reference
Base class for GBitmapScaler and GPixmapScaler. More...
#include <GScaler.h>
Public Member Functions | |
void | get_input_rect (const GRect &desired_output, GRect &required_input) |
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 | ~GScaler () |
Protected Member Functions | |
GScaler () | |
void | make_rectangles (const GRect &desired, GRect &red, GRect &inp) |
Protected Attributes | |
GPBuffer< int > | ghcoord |
GPBuffer< int > | gvcoord |
int * | hcoord |
int | inh |
int | inw |
int | outh |
int | outw |
int | redh |
int | redw |
int * | vcoord |
int | xshift |
int | yshift |
Detailed Description
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}.
Definition at line 117 of file GScaler.h.
Constructor & Destructor Documentation
GScaler::GScaler | ( | ) | [protected] |
Definition at line 137 of file GScaler.cpp.
GScaler::~GScaler | ( | ) | [virtual] |
Definition at line 146 of file GScaler.cpp.
Member Function Documentation
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#.
Definition at line 290 of file GScaler.cpp.
Definition at line 260 of file GScaler.cpp.
void GScaler::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.
Definition at line 206 of file GScaler.cpp.
void GScaler::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.
Definition at line 152 of file GScaler.cpp.
void GScaler::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.
Definition at line 168 of file GScaler.cpp.
void GScaler::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.
Definition at line 232 of file GScaler.cpp.
Member Data Documentation
GPBuffer<int> GScaler::ghcoord [protected] |
GPBuffer<int> GScaler::gvcoord [protected] |
int* GScaler::hcoord [protected] |
int GScaler::inh [protected] |
int GScaler::inw [protected] |
int GScaler::outh [protected] |
int GScaler::outw [protected] |
int GScaler::redh [protected] |
int GScaler::redw [protected] |
int* GScaler::vcoord [protected] |
int GScaler::xshift [protected] |
int GScaler::yshift [protected] |
The documentation for this class was generated from the following files: