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

kviewshell

GPixmapScaler Class Reference

Fast rescaling code for color images. More...

#include <GScaler.h>

Inheritance diagram for GPixmapScaler:

Inheritance graph
[legend]

List of all members.


Public Member Functions

void scale (const GRect &provided_input, const GPixmap &input, const GRect &desired_output, GPixmap &output)
virtual ~GPixmapScaler ()

Static Public Member Functions

static GP< GPixmapScaler > create (const int inw, const int inh, const int outw, const int outh)
static GP< GPixmapScaler > create (void)

Protected Member Functions

GPixel * get_line (int, const GRect &, const GRect &, const GPixmap &)
 GPixmapScaler (int inw, int inh, int outw, int outh)
 GPixmapScaler (void)

Protected Attributes

GPBufferBase glbuffer
GPBufferBase gp1
GPBufferBase gp2
int l1
int l2
GPixel * lbuffer
GPixel * p1
GPixel * p2

Detailed Description

Fast rescaling code for color images.

This class augments the base class {GScaler} with a function for rescaling color images. Function {GPixmapScaler::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 in#. {verbatim} 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; } {verbatim}

Definition at line 259 of file GScaler.h.


Constructor & Destructor Documentation

GPixmapScaler::GPixmapScaler ( void   )  [protected]

Definition at line 499 of file GScaler.cpp.

GPixmapScaler::GPixmapScaler ( int  inw,
int  inh,
int  outw,
int  outh 
) [protected]

Definition at line 507 of file GScaler.cpp.

GPixmapScaler::~GPixmapScaler (  )  [virtual]

Virtual destructor.

Definition at line 517 of file GScaler.cpp.


Member Function Documentation

static GP<GPixmapScaler> GPixmapScaler::create ( const int  inw,
const int  inh,
const int  outw,
const int  outh 
) [inline, static]

Creates a GPixmapScaler.

The size of the input image is given by inw# and inh#. This function internally calls {GScaler::set_input_size} and {GScaler::set_output_size}. The size of the output image is given by outw# and outh#. .

Definition at line 277 of file GScaler.h.

static GP<GPixmapScaler> GPixmapScaler::create ( void   )  [inline, static]

Creates an empty GPixmapScaler.

You must call functions {GScaler::set_input_size} and {GScaler::set_output_size} before calling any of the scaling functions.

Definition at line 271 of file GScaler.h.

GPixel * GPixmapScaler::get_line ( int  fy,
const GRect &  required_red,
const GRect &  provided_input,
const GPixmap &  input 
) [protected]

Definition at line 523 of file GScaler.cpp.

void GPixmapScaler::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 input#. An exception {GException} is thrown if the rectangle provided_input# is smaller then the rectangle required_input# returned by function {GScaler::get_input_rect}.

Definition at line 594 of file GScaler.cpp.


Member Data Documentation

GPBufferBase GPixmapScaler::glbuffer [protected]

Definition at line 295 of file GScaler.h.

GPBufferBase GPixmapScaler::gp1 [protected]

Definition at line 297 of file GScaler.h.

GPBufferBase GPixmapScaler::gp2 [protected]

Definition at line 299 of file GScaler.h.

int GPixmapScaler::l1 [protected]

Definition at line 300 of file GScaler.h.

int GPixmapScaler::l2 [protected]

Definition at line 301 of file GScaler.h.

GPixel* GPixmapScaler::lbuffer [protected]

Definition at line 294 of file GScaler.h.

GPixel* GPixmapScaler::p1 [protected]

Definition at line 296 of file GScaler.h.

GPixel* GPixmapScaler::p2 [protected]

Definition at line 298 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