LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::scaling Class Reference
[Simple geometry classes and functions]

Scaling implements a functor to rescale an image using a real valued scaling factor. More...

#include <ltiScaling.h>

Inheritance diagram for lti::scaling:
Inheritance graph
[legend]
Collaboration diagram for lti::scaling:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class scaling. More...

Public Member Functions

 scaling ()
 scaling (const parameters &par)
 scaling (const scaling &other)
virtual ~scaling ()
virtual const char * getTypeName () const
scalingcopy (const scaling &other)
scalingoperator= (const scaling &other)
virtual functorclone () const
const scaling::parametersgetParameters () const
virtual bool updateParameters ()
Standard apply methods.

The scaling factor and interpolation types are taken from the parameters



bool apply (image &srcdest) const
bool apply (const image &src, image &dest) const
bool apply (matrix< ubyte > &srcdest) const
bool apply (const matrix< ubyte > &src, matrix< ubyte > &dest) const
bool apply (matrix< float > &srcdest) const
bool apply (const matrix< float > &src, matrix< float > &dest) const
bool apply (matrix< int > &srcdest) const
bool apply (const matrix< int > &src, matrix< int > &dest) const
Symmetric scaling apply methods.

The scaling factor for both vertical and horizontal axes is given directly.



bool apply (const float scale, image &srcdest) const
bool apply (const float scale, const image &src, image &dest) const
bool apply (const float scale, matrix< ubyte > &srcdest) const
bool apply (const float scale, const matrix< ubyte > &src, matrix< ubyte > &dest) const
bool apply (const float scale, matrix< float > &srcdest) const
bool apply (const float scale, const matrix< float > &src, matrix< float > &dest) const
bool apply (const float scale, matrix< int > &srcdest) const
bool apply (const float scale, const matrix< int > &src, matrix< int > &dest) const
Asymmetric scaling apply methods.

The scaling factor for horizontal and vertical axes are given through the x and y components of the point respectivelly.



bool apply (const tpoint< float > &scale, image &srcdest) const
bool apply (const tpoint< float > &scale, const image &src, image &dest) const
bool apply (const tpoint< float > &scale, matrix< ubyte > &srcdest) const
bool apply (const tpoint< float > &scale, const matrix< ubyte > &src, matrix< ubyte > &dest) const
bool apply (const tpoint< float > &scale, matrix< float > &srcdest) const
bool apply (const tpoint< float > &scale, const matrix< float > &src, matrix< float > &dest) const
bool apply (const tpoint< float > &scale, matrix< int > &srcdest) const
bool apply (const tpoint< float > &scale, const matrix< int > &src, matrix< int > &dest) const

Protected Attributes

scalingWorker * worker

Detailed Description

Scaling implements a functor to rescale an image using a real valued scaling factor.

This functor represents a faster alternative to lti::geometricTransform, used if you only need to scale the image, without any other kind of geometric mapping.

It is usually employed to upsample an image, using some interpolation policy indicated in the parameters. At this point only bilinear interpolation is supported, but this may change as soon as the new family of interpolators for the LTI-Lib are available.

You can give also factors smaller than one to downsample an image, but this will just take the interpolated corresponding pixel of the original image, without consideration of its neighborhood. For a more theoretically founded downsampling functor, you can use lti::downsampling, which allows you to make a low-pass filtering, to avoid artifacts resulting from a violation of the Nyquist sampling theorem. Nevertheless, if you just one to downsample for some visualization, this functor might be enough (lti::decimation can be even faster if the downsampling factor is integer).

For more complex operations you can still use the lti::geometricTransform functor.

See also:
lti::geometricTransform, lti::rotation, lti::flipImage
lti::downsampling, lti::upsampling, lti::filledUpsampling, lti::decimation

Constructor & Destructor Documentation

lti::scaling::scaling (  ) 

Default constructor.

lti::scaling::scaling ( const parameters par  ) 

Construct a functor using the given parameters.

lti::scaling::scaling ( const scaling other  ) 

Copy constructor.

Parameters:
other the object to be copied
virtual lti::scaling::~scaling (  )  [virtual]

Destructor.


Member Function Documentation

bool lti::scaling::apply ( const tpoint< float > &  scale,
const matrix< int > &  src,
matrix< int > &  dest 
) const

Operates on a copy of the given parameters.

Parameters:
scale scaling factor used instead of the value given in the parameters object.
src matrix<int> with the source data.
dest matrix<int> where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const tpoint< float > &  scale,
matrix< int > &  srcdest 
) const

Operates on the given parameter.

Parameters:
scale scaling factor used instead of the value given in the parameters object.
srcdest matrix<int> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const tpoint< float > &  scale,
const matrix< float > &  src,
matrix< float > &  dest 
) const

Operates on a copy of the given parameters.

Parameters:
scale scaling factor used instead of the value given in the parameters object.
src matrix<float> with the source data.
dest matrix<float> where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const tpoint< float > &  scale,
matrix< float > &  srcdest 
) const

Operates on the given parameter.

Parameters:
scale scaling factor used instead of the value given in the parameters object.
srcdest matrix<float> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const tpoint< float > &  scale,
const matrix< ubyte > &  src,
matrix< ubyte > &  dest 
) const

Operates on a copy of the given parameters.

Parameters:
scale scaling factor used instead of the value given in the parameters object.
src matrix<ubyte> with the source data.
dest matrix<ubyte> where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const tpoint< float > &  scale,
matrix< ubyte > &  srcdest 
) const

Operates on the given parameter.

Parameters:
scale scaling factor used instead of the value given in the parameters object.
srcdest matrix<ubyte> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const tpoint< float > &  scale,
const image src,
image dest 
) const

Operates on a copy of the given parameters.

Parameters:
scale scaling factor used instead of the value given in the parameters object.
src image with the source data.
dest image where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const tpoint< float > &  scale,
image srcdest 
) const

Operates on the given parameter.

Parameters:
scale scaling factor used instead of the value given in the parameters object.
srcdest image with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const float  scale,
const matrix< int > &  src,
matrix< int > &  dest 
) const

Operates on a copy of the given parameters.

Parameters:
scale scaling factor used for both, the horizontal and vertical axes. The scaling factor in the parameters will be ignored.
src matrix<int> with the source data.
dest matrix<int> where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const float  scale,
matrix< int > &  srcdest 
) const

Operates on the given parameter.

Parameters:
scale scaling factor used for both, the horizontal and vertical axes. The scaling factor in the parameters will be ignored.
srcdest matrix<int> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const float  scale,
const matrix< float > &  src,
matrix< float > &  dest 
) const

Operates on a copy of the given parameters.

Parameters:
scale scaling factor used for both, the horizontal and vertical axes. The scaling factor in the parameters will be ignored.
src matrix<float> with the source data.
dest matrix<float> where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const float  scale,
matrix< float > &  srcdest 
) const

Operates on the given parameter.

Parameters:
scale scaling factor used for both, the horizontal and vertical axes. The scaling factor in the parameters will be ignored.
srcdest matrix<float> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const float  scale,
const matrix< ubyte > &  src,
matrix< ubyte > &  dest 
) const

Operates on a copy of the given parameters.

Parameters:
scale scaling factor used for both, the horizontal and vertical axes. The scaling factor in the parameters will be ignored.
src matrix<ubyte> with the source data.
dest matrix<ubyte> where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const float  scale,
matrix< ubyte > &  srcdest 
) const

Operates on the given parameter.

Parameters:
scale scaling factor used for both, the horizontal and vertical axes. The scaling factor in the parameters will be ignored.
srcdest matrix<ubyte> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const float  scale,
const image src,
image dest 
) const

Operates on a copy of the given parameters.

Parameters:
scale scaling factor used for both, the horizontal and vertical axes. The scaling factor in the parameters will be ignored.
src image with the source data.
dest image where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const float  scale,
image srcdest 
) const

Operates on the given parameter.

Parameters:
scale scaling factor used for both, the horizontal and vertical axes. The scaling factor in the parameters will be ignored.
srcdest image with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const matrix< int > &  src,
matrix< int > &  dest 
) const [virtual]

Operates on a copy of the given parameters.

Parameters:
src matrix<int> with the source data.
dest matrix<int> where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

bool lti::scaling::apply ( matrix< int > &  srcdest  )  const [virtual]

Operates on the given parameter.

Parameters:
srcdest matrix<int> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

bool lti::scaling::apply ( const matrix< float > &  src,
matrix< float > &  dest 
) const [virtual]

Operates on a copy of the given parameters.

Parameters:
src matrix<float> with the source data.
dest matrix<float> where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

bool lti::scaling::apply ( matrix< float > &  srcdest  )  const [virtual]

Operates on the given parameter.

Parameters:
srcdest matrix<float> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

bool lti::scaling::apply ( const matrix< ubyte > &  src,
matrix< ubyte > &  dest 
) const

Operates on a copy of the given parameters.

Parameters:
src matrix<ubyte> with the source data.
dest matrix<ubyte> where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( matrix< ubyte > &  srcdest  )  const

Operates on the given parameter.

Parameters:
srcdest matrix<ubyte> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.
bool lti::scaling::apply ( const image src,
image dest 
) const [virtual]

Operates on a copy of the given parameters.

Parameters:
src image with the source data.
dest image where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

bool lti::scaling::apply ( image srcdest  )  const [virtual]

Operates on the given parameter.

Parameters:
srcdest image with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

virtual functor* lti::scaling::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements lti::functor.

scaling& lti::scaling::copy ( const scaling other  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

const scaling::parameters& lti::scaling::getParameters (  )  const

Returns used parameters.

Reimplemented from lti::modifier.

virtual const char* lti::scaling::getTypeName (  )  const [virtual]

Returns the name of this type ("scaling").

Reimplemented from lti::modifier.

scaling& lti::scaling::operator= ( const scaling other  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

virtual bool lti::scaling::updateParameters (  )  [virtual]

returns used parameters

Reimplemented from lti::functor.


Member Data Documentation

scalingWorker* lti::scaling::worker [protected]

Class containing the real algorithms.

This is set in setParameters();


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

Generated on Sat Apr 10 15:27:48 2010 for LTI-Lib by Doxygen 1.6.1