LossyScaler Class Reference

Lossy image scaler. More...

#include <fvutils/scalers/lossy.h>

Inheritance diagram for LossyScaler:

List of all members.


Public Member Functions

 LossyScaler ()
 Constructor.
virtual ~LossyScaler ()
 Destructor.
virtual void set_scale_factor (float factor)
 Set scale factor.
virtual void set_original_dimensions (unsigned int width, unsigned int height)
 Set original image dimensions.
virtual void set_scaled_dimensions (unsigned int width, unsigned int height)
 Set dimenins of scaled image buffer.
virtual void set_original_buffer (unsigned char *buffer)
 Set original image buffer.
virtual void set_scaled_buffer (unsigned char *buffer)
 Set scaled image buffer.
virtual void scale ()
 Scale image.
virtual unsigned int needed_scaled_width ()
 Minimum needed width of scaled image depending on factor and original image width.
virtual unsigned int needed_scaled_height ()
 Minimum needed height of scaled image depending on factor and original image height.
virtual float get_scale_factor ()
 Returns the scale factor.

Detailed Description

Lossy image scaler.

This scaler just takes the required pixels from the image and throws away the rest. No enhancement of the image is done. This is only suitable for downscaling. The scale factor must be between 0 and 1.

Definition at line 30 of file lossy.h.


Constructor & Destructor Documentation

LossyScaler::LossyScaler (  ) 

Constructor.

Definition at line 40 of file lossy.cpp.

LossyScaler::~LossyScaler (  )  [virtual]

Destructor.

Definition at line 52 of file lossy.cpp.


Member Function Documentation

float LossyScaler::get_scale_factor (  )  [virtual]

Returns the scale factor.

Returns:
the scale factor

Implements Scaler.

Definition at line 142 of file lossy.cpp.

unsigned int LossyScaler::needed_scaled_height (  )  [virtual]

Minimum needed height of scaled image depending on factor and original image height.

Returns:
minimum needed height

Implements Scaler.

Definition at line 135 of file lossy.cpp.

Referenced by ColorTrainWidget::draw_segmentation_result(), and scale().

unsigned int LossyScaler::needed_scaled_width (  )  [virtual]

Minimum needed width of scaled image depending on factor and original image width.

Returns:
minimum needed width

Implements Scaler.

Definition at line 128 of file lossy.cpp.

Referenced by ColorTrainWidget::draw_segmentation_result(), and scale().

void LossyScaler::scale (  )  [virtual]

void LossyScaler::set_original_buffer ( unsigned char *  buffer  )  [virtual]

Set original image buffer.

Parameters:
buffer YUV 422 planar buffer

Implements Scaler.

Definition at line 114 of file lossy.cpp.

Referenced by ColormapViewerWidget::draw(), ColorTrainWidget::draw_segmentation_result(), and ImageWidget::show().

void LossyScaler::set_original_dimensions ( unsigned int  width,
unsigned int  height 
) [virtual]

Set original image dimensions.

Parameters:
width image width
height height

Implements Scaler.

Definition at line 78 of file lossy.cpp.

Referenced by ColormapViewerWidget::draw(), ColorTrainWidget::draw_segmentation_result(), and ImageWidget::show().

void LossyScaler::set_scale_factor ( float  factor  )  [virtual]

Set scale factor.

Parameters:
factor scale factor

Implements Scaler.

Definition at line 58 of file lossy.cpp.

void LossyScaler::set_scaled_buffer ( unsigned char *  buffer  )  [virtual]

Set scaled image buffer.

Parameters:
buffer YUV 422 planar buffer

Implements Scaler.

Definition at line 121 of file lossy.cpp.

Referenced by ColormapViewerWidget::draw(), ColorTrainWidget::draw_segmentation_result(), and ImageWidget::show().

void LossyScaler::set_scaled_dimensions ( unsigned int  width,
unsigned int  height 
) [virtual]

Set dimenins of scaled image buffer.

Parameters:
width image width
height height

Implements Scaler.

Definition at line 87 of file lossy.cpp.

Referenced by ColormapViewerWidget::draw(), ColorTrainWidget::draw_segmentation_result(), and ImageWidget::show().


The documentation for this class was generated from the following files: