• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

GScaler Class Reference

Base class for GBitmapScaler and GPixmapScaler. More...

#include <GScaler.h>

Inheritance diagram for GScaler:

Inheritance graph
[legend]

List of all members.


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

void GScaler::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#.

Definition at line 290 of file GScaler.cpp.

void GScaler::make_rectangles ( const GRect &  desired,
GRect &  red,
GRect &  inp 
) [protected]

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]

Definition at line 156 of file GScaler.h.

GPBuffer<int> GScaler::gvcoord [protected]

Definition at line 154 of file GScaler.h.

int* GScaler::hcoord [protected]

Definition at line 155 of file GScaler.h.

int GScaler::inh [protected]

Definition at line 148 of file GScaler.h.

int GScaler::inw [protected]

Definition at line 148 of file GScaler.h.

int GScaler::outh [protected]

Definition at line 151 of file GScaler.h.

int GScaler::outw [protected]

Definition at line 151 of file GScaler.h.

int GScaler::redh [protected]

Definition at line 150 of file GScaler.h.

int GScaler::redw [protected]

Definition at line 150 of file GScaler.h.

int* GScaler::vcoord [protected]

Definition at line 153 of file GScaler.h.

int GScaler::xshift [protected]

Definition at line 149 of file GScaler.h.

int GScaler::yshift [protected]

Definition at line 149 of file GScaler.h.


The documentation for this class was generated from the following files:
  • GScaler.h
  • GScaler.cpp

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal