[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    Transformer(3X) manual page Table of Contents

Name

Transformer - transformation matrix

Synopsis

#include <ivplus/transformer.h>

Description

Conceptually, a Transformer represents a 3x3 transformation matrix which can be used to rotate, scale, and translate 2D coordinates. Since only 2-dimensional coordinate transformations are performed, the right-hand column of the 3x3 matrix is not required. Where necessary for clarity, the elements of the 3x3 transformation matrix will be referred to in the following manner:
a00a01a02
a10a11a12
a20a21a22


The identity matrix has a value of
onein
a00,a11,and
a22.All other elements are
zero.Transformeris derived from
Resourceand has an initial reference count of
1.

Class HierarchyTransformer->Resource 
ConstructorsTransformer()Creates an
identity matrix. 
Transformer(const Transformer&)Transformer(const Transformer*)Creates
a copy of the indicated matrix. 
Transformer(float a00, float a01, float
a10, float a11, float a20, float a21)Creates a matrix with the indicated
values.  
Public Operationsboolean operator ==(const Transformer& t) constReturns
true, if the transformation matrices of the current transformer and  t
contain identical elements. Returns false, otherwise. 
boolean operator !=(const
Transformer& t) constReturns true, if the transformation matrices of the
current transformer and  t contain any elements which differ. Returns false,
otherwise. 
Transformer& operator =(const Transformer& t)Copies the transformation
matrix of  t to the current transformer. 
void GetEntries(float& a00, float&
a01, float& a10, float& a11, float& a20, float& a21) constReturns the component
values of the transformation matrix.  
void Invert()Inverts the transformation
matrix.  
void InvTransform(IntCoord& tx, IntCoord& ty) constPerforms an inverse
transformation to  tx and  ty  using the current transformation matrix.

void InvTransform(IntCoord tx, IntCoord ty, IntCoord& x, IntCoord& y) constvoid
InvTransform(float tx, float ty, float& x, float& y) constPerform an inverse
transformation to  tx and  ty using the current transformation matrix. Place
the results in  x and  y. 
void InvTransformList(IntCoord tx[], IntCoord
ty[], int n) constPerforms an inverse transformation using the current
transformation  matrix to each of the  n coordinates represented by  <tx[0],
ty[0]>, <tx[1], ty[1]>, through <tx[n-1], ty[n-1]>. 
void InvTransformList(IntCoord
tx[], IntCoord ty[], int n, IntCoord x[], IntCoord y[]) constPerforms an
inverse transformation using the current transformation  matrix to each
of the  n coordinates represented by <tx[0], ty[0]>, <tx[1], ty[1]>, through
<tx[n-1], ty[n-1]>. Places the results in <x[0], y[0]>, <x[1], y[1]>, through <x[n-1],
y[n-1]>. 
void InvTransformRect(IntCoord& x0, IntCoord& y0, IntCoord& x1, IntCoord&
y1) constvoid InvTransformRect(float& x0, float& y0, float& x1, float& y1)
constPerforms an inverse transformation on the rectangle represented by
the diagonal vertices at <x0, y0> and <x1, y1>. 
void Postmultiply(Transformer*
t)void Premultiply(Transformer* t)Post (Pre)-multiply the matrix by the
matrix of the indicated transformer. 
void Rotate(float angle)Modifies the
matrix so it will rotate coordinates by the number of degrees indicated.
 
boolean Rotated(float tol = 1e-6) constReturns true, if the matrix represents
a rotation within the indicated tolerance. 
boolean Rotated90(float tol =
1e-6) constReturns true, if the matrix represents a rotation of 90 degrees
within the indicated tolerance.  
void Scale(float sx, float sy)Multiplies
 a00, a10, and  a20 by  sx, and  a01, a11, and  a21 by  sy. 
boolean Scaled(float
tol = 1e-6) constReturns true, if the matrix represents a scaling factor
within the indicated tolerance. Returns false, otherwise. 
boolean Stretched(float
tol = 1e-6) constReturns true, if the matrix represents a stretch within
the indicated tolerance. Returns false, otherwise. 
void Transform(IntCoord&
x, IntCoord& y) constApplies the current transformation matrix to  x and
 y. 
void Transform(IntCoord x, IntCoord y, IntCoord& tx, IntCoord& ty) constvoid
Transform(float x, float y, float& tx, float& ty) constApply the current
transformation matrix to  x and  y, place the results in  tx and  ty. 
void
TransformList(IntCoord x[], IntCoord y[], int n) constApplies the current
transformation matrix to each of the  n coordinates represented by <x[0],
y[0]>, <x[1], y[1]>, through <x[n-1], y[n-1]>. 
void TransformList(IntCoord x[],
IntCoord y[], int n, IntCoord tx[], IntCoord ty[]) constApplies the current
transformation matrix to each of the  n coordinates represented by <x[0],
y[0]>, <x[1], y[1]>, through <x[n-1], y[n-1]>. Place the results in <tx[0], ty[0]>,
<tx[1], ty[1]>, through <tx[n-1], ty[n-1]>. 
void TransformRect(IntCoord& x0, IntCoord&
y0, IntCoord& x1, IntCoord& y1) constvoid TransformRect(float& x0, float& y0,
float& x1, float& y1) constApply the current transformation matrix to the
rectangle represented  by the diagonal vertices at <x0, y0> and <x1, y1>. 
void
Translate(float dx, float dy)Adds dx to  a20 and  dy to  a21. 
boolean Translated(float
tol = 1e-6) constReturns whether or not the indicated transformer represents
a  translation greater than the indicated tolerance in either the  x or
 y direction.  
Protected OperationsNone. 
X ResourcesNone. 
ExamplesNone. 
Files
transformer.h

See Also

Resource(3X) .


Table of Contents