Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   Related Pages   Examples  

Geometrical operations


Functions

void pad (int w, int h, PADDING_TYPE p)
void crop (int x1, int y1, int x2, int y2)
void makeEvenSized (void)
void Reflect (Image< T > &input, string axis, Image< T > &output)
void Reflect (Image< T > &input, string axis)
void Rotate (Image< T > &input, float angle, Image< T > &output)
void Rotate (Image< T > &input, float angle)
void Translate (Image< T > &input, float x, float y, Image< T > &output)
void Translate (Image< T > &input, float x, float y)
void Zoom (Image< T > &input, float xf, float yf, Image< T > &output)
void Zoom (Image< T > &input, float xyf, Image< T > &output)
void Zoom (Image< T > &input, float xf, float yf)
void Zoom (Image< T > &input, float xyf)

Detailed Description

This group contains methods as well as stand-alone functions implementing geometrical transformations of an image.

Function Documentation

void Reflect ( Image< T > & input,
string axis )
 

Performs in place the reflection across the indicated axis of the input image. For a reflection across the horizontal axis, the parameter axis should be "horizontal"; while for a reflection across the vertical axis, the parameter axis should be "vertical".

Definition at line 27 of file Reflection.cpp.

void Reflect ( Image< T > & input,
string axis,
Image< T > & output )
 

Performs the reflection across the indicated axis of the input image and stores the result in the output image. For a reflection across the horizontal axis, the parameter axis should be "horizontal"; while for a reflection across the vertical axis, the parameter axis should be "vertical".

Examples:
test_reflect.cpp.

Definition at line 12 of file Reflection.cpp.

void Rotate ( Image< T > & input,
float angle )
 

Performs the CCW rotation of the input image in place using the given angle (in degrees).

Definition at line 50 of file Rotation.cpp.

void Rotate ( Image< T > & input,
float angle,
Image< T > & output )
 

Performs the CCW rotation of the input image using the given angle (in degrees) and stores the result in the output image.

Examples:
test_rotate.cpp.

Definition at line 12 of file Rotation.cpp.

void Translate ( Image< T > & input,
float x,
float y )
 

Performs in place the translation of the input image along the x- and y-axes. A positive value for x means a translation to the right. A positive value for y means a translation downwards.

Definition at line 40 of file Translation.cpp.

void Translate ( Image< T > & input,
float x,
float y,
Image< T > & output )
 

Performs the translation of the input image along the x- and y-axes and stores the result in the output image. A positive value for x means a translation to the right. A positive value for y means a translation downwards.

Examples:
test_translate.cpp.

Definition at line 12 of file Translation.cpp.

void Zoom ( Image< T > & input,
float xyf )
 

Performs the zooming of the input image in place using the same factor xyf along both axes.

Definition at line 57 of file Zooming.cpp.

void Zoom ( Image< T > & input,
float xf,
float yf )
 

Performs the zooming of the input image in place using a factor xf along the x-axis and a factor yf along the y-axis.

Definition at line 52 of file Zooming.cpp.

void Zoom ( Image< T > & input,
float xyf,
Image< T > & output )
 

Performs the zooming of the input image using the same factor xyf along both axes and stores the result in the output image.

Definition at line 47 of file Zooming.cpp.

void Zoom ( Image< T > & input,
float xf,
float yf,
Image< T > & output )
 

Performs the zooming of the input image using a factor xf along the x-axis and a factor yf along the y-axis; stores the result in the output image.

Examples:
test_zoom.cpp.

Definition at line 18 of file Zooming.cpp.

template<class T>
void Image< T >::crop ( int x1,
int y1,
int x2,
int y2 )
 

Replace the current image with a piece of it - that piece delimited by a rectangle whose top-left corner is (x1,y1) and bottom-right corner is (x2,y2).

Examples:
test_image.cpp.

Definition at line 319 of file Image.cpp.

template<class T>
void Image< T >::makeEvenSized ( void )
 

If the current image has one or both dimensions odd valued, makes the odd valued dimension(s) even by duplicating the last row and/or column. Such a modification is, usually, necessary for image transforms such as FFT.

Definition at line 338 of file Image.cpp.

Referenced by FourierTransform::FourierTransform().

template<class T>
void Image< T >::pad ( int w,
int h,
PADDING_TYPE p )
 

Pads the current image with a vertical border of size w and a horizontal border of size h. The type of padding depends on the parameter p. Currently defined padding types are:

  • ZEROS - the added borders are filled with 0;
  • REFLECTION - the added borders are reflections of the initial borders;
  • WRAP - each added border is a copy of the opposite initial border.

Definition at line 262 of file Image.cpp.

Referenced by FourierTransform::FourierTransform().