TRANS2D_AFFINE Class Reference

Simple affine X/Y coordinate transformation. More...

#include <mi32/trans2daffine.h>

List of all members.

Public Types

enum  AXIS { AXIS_X = 0, AXIS_Y = 1 }

Public Member Functions

 TRANS2D_AFFINE (const CTRLPOINT3 *cp, int numpoints, bool invert=false)
 TRANS2D_AFFINE (const CTRLPOINT *cp, int numpoints, bool invert=false)
 TRANS2D_AFFINE (const TRANS2D_AFFINE &trans1, const TRANS2D_AFFINE &trans2)
 TRANS2D_AFFINE (const MAT3X3 fwd, const MAT3X3 inv)
 TRANS2D_AFFINE (const MAT3X3 matrix, bool IsForward=true)
 TRANS2D_AFFINE (const TRANS2D_AFFINE &rhs)
 TRANS2D_AFFINE ()
 ~TRANS2D_AFFINE ()
void ApplyOffset (const DPOINT2D &offset)
void ApplyOffset (double xoffset, double yoffset)
void ApplyOffsetReverse (const DPOINT2D &offset)
void ApplyOffsetReverse (double xoffset, double yoffset)
void ApplyRotation (double angle)
void ApplyScale (const DPOINT2D &scale)
void ApplyScale (double xscale, double yscale)
void ApplyScale (double scale)
void ApplyScaleReverse (const DPOINT2D &scale)
void ApplyScaleReverse (double xscale, double yscale)
void ApplyShear (double angle, AXIS axis)
void Combine (const TRANS2D_AFFINE &trans1, const TRANS2D_AFFINE &trans2)
void Combine (const TRANS2D_AFFINE &trans1)
void CombineForwardReverse (const TRANS2D_AFFINE &trans1, const TRANS2D_AFFINE &trans2)
void ConvertForward (const DRECT2D &irect, DRECT2D &orect) const
DRECT2D ConvertForward (const DRECT2D &irect) const
void ConvertForward (const double *ipoints, double *opoints, INT32 NumPoints, int NumDim) const
void ConvertForward (const DPOINT3D *ipoints, DPOINT3D *opoints, INT32 NumPoints) const
void ConvertForward (const DPOINT2D *ipoints, DPOINT2D *opoints, INT32 NumPoints) const
DPOINT3D ConvertForward (const DPOINT3D &ipoint) const
DPOINT2D ConvertForward (const DPOINT2D &ipoint) const
void ConvertForward (double x, double y, double &ox, double &oy) const
DPOINT2D ConvertForward (double x, double y) const
void ConvertInverse (const DRECT2D &irect, DRECT2D &orect) const
DRECT2D ConvertInverse (const DRECT2D &irect) const
void ConvertInverse (const double *ipoints, double *opoints, INT32 NumPoints, int NumDim) const
void ConvertInverse (const DPOINT3D *ipoints, DPOINT3D *opoints, INT32 NumPoints) const
void ConvertInverse (const DPOINT2D *ipoints, DPOINT2D *opoints, INT32 NumPoints) const
DPOINT3D ConvertInverse (const DPOINT3D &ipoint) const
DPOINT2D ConvertInverse (const DPOINT2D &ipoint) const
void ConvertInverse (double x, double y, double &ox, double &oy) const
DPOINT2D ConvertInverse (double x, double y) const
void DisectForward (double *xscale, double *yscale, double *rotangle=0, double *shearangle=0) const
void DisectInverse (double *xscale, double *yscale, double *rotangle=0, double *shearangle=0) const
void GetMatrices (MAT3X3 fwd, MAT3X3 inv) const
void GetValuesForward (double &xscale, double &xrot, double &xpos, double &yscale, double &yrot, double &ypos) const
bool HasReverseOrientation () const
bool IsEqual (const TRANS2D_AFFINE &rhs) const
bool IsEquivalentTo (const TRANS2D_AFFINE &rhs) const
bool IsIdentity () const
TRANS2D_AFFINEoperator= (const TRANS2D_AFFINE &rhs)
void ReverseDirection ()
ERRVALUE SetCtrlPoint (const CTRLPOINT3 *cp, int numpoints, bool invert=false)
ERRVALUE SetCtrlPoint (const CTRLPOINT *cp, int numpoints, bool invert=false)
void SetIdentity ()
void SetMatrices (const MAT3X3 fwd, const MAT3X3 inv)

Detailed Description

Simple affine X/Y coordinate transformation.

All conversion methods are inline for maximum speed. For single point conversion, no function call will occur (assuming the compiler actually inlines the method). This class replaces the trans2d...() C functions.


Member Enumeration Documentation

Enumerator:
AXIS_X 
AXIS_Y 

Constructor & Destructor Documentation

TRANS2D_AFFINE::TRANS2D_AFFINE (  )  [inline]

Default constructor, create identity transformation.

TRANS2D_AFFINE::TRANS2D_AFFINE ( const TRANS2D_AFFINE rhs  )  [inline]

Copy constructor.

TRANS2D_AFFINE::TRANS2D_AFFINE ( const MAT3X3  matrix,
bool  IsForward = true 
) [inline]

Construct from forward or inverse matrix.

Parameters:
matrix Transformation matrix
IsForward True if forward transformation, false if inverse
TRANS2D_AFFINE::TRANS2D_AFFINE ( const MAT3X3  fwd,
const MAT3X3  inv 
) [inline]

Construct from affine matrices.

Parameters:
fwd Forward transformation matrix
inv Inverse transformation matrix
TRANS2D_AFFINE::TRANS2D_AFFINE ( const TRANS2D_AFFINE trans1,
const TRANS2D_AFFINE trans2 
) [inline]

Construct from combination of two affine transformations.

Parameters:
trans1 First transformation
trans2 Second transformation
TRANS2D_AFFINE::TRANS2D_AFFINE ( const CTRLPOINT cp,
int  numpoints,
bool  invert = false 
) [inline]

Construct from CTRLPOINT array.

Parameters:
cp Control point array
numpoints Number of control points
invert Invert coordinate system (for images)
TRANS2D_AFFINE::TRANS2D_AFFINE ( const CTRLPOINT3 cp,
int  numpoints,
bool  invert = false 
) [inline]

Construct from CTRLPOINT3 array.

Parameters:
cp Control point array
numpoints Number of control points
invert Invert coordinate system (for images)
TRANS2D_AFFINE::~TRANS2D_AFFINE (  )  [inline]

Destructor.


Member Function Documentation

void TRANS2D_AFFINE::ApplyOffset ( const DPOINT2D offset  )  [inline]

Apply coordinate offset.

Parameters:
offset Offset
void TRANS2D_AFFINE::ApplyOffset ( double  xoffset,
double  yoffset 
) [inline]

Apply coordinate offset.

Parameters:
xoffset X offset
yoffset Y offset
void TRANS2D_AFFINE::ApplyOffsetReverse ( const DPOINT2D offset  )  [inline]

Apply coordinate offset relative to reverse direction.

Parameters:
offset Offset
void TRANS2D_AFFINE::ApplyOffsetReverse ( double  xoffset,
double  yoffset 
) [inline]

Apply coordinate offset relative to reverse direction.

Parameters:
xoffset X offset
yoffset Y offset
void TRANS2D_AFFINE::ApplyRotation ( double  angle  )  [inline]

Apply rotation angle.

Parameters:
angle Rotation angle in radians
void TRANS2D_AFFINE::ApplyScale ( const DPOINT2D scale  )  [inline]

Apply scale to X/Y axes.

Parameters:
scale X/Y scale
void TRANS2D_AFFINE::ApplyScale ( double  xscale,
double  yscale 
) [inline]

Apply scale to X/Y axes.

Parameters:
xscale X scale
yscale Y scale
void TRANS2D_AFFINE::ApplyScale ( double  scale  )  [inline]

Apply scale equally to X/Y axes.

Parameters:
scale Scale
void TRANS2D_AFFINE::ApplyScaleReverse ( const DPOINT2D scale  )  [inline]

Apply scale to X/Y axes, relative to reverse direction.

Parameters:
scale X/Y scale
void TRANS2D_AFFINE::ApplyScaleReverse ( double  xscale,
double  yscale 
) [inline]

Apply scale to X/Y axes, relative to reverse direction.

Parameters:
xscale X scale
yscale Y scale
void TRANS2D_AFFINE::ApplyShear ( double  angle,
AXIS  axis 
) [inline]

Apply shear relative to specified axis.

Parameters:
angle Shear angle in radians
axis Axis to shear (AXIS_X or AXIS_Y)
void TRANS2D_AFFINE::Combine ( const TRANS2D_AFFINE trans1,
const TRANS2D_AFFINE trans2 
) [inline]

Combine two affine transformations, both in forward direction.

Parameters:
trans1 First transformation
trans2 Second transformation
void TRANS2D_AFFINE::Combine ( const TRANS2D_AFFINE trans1  )  [inline]

Combine two affine transformations.

Parameters:
trans1 First transformation
void TRANS2D_AFFINE::CombineForwardReverse ( const TRANS2D_AFFINE trans1,
const TRANS2D_AFFINE trans2 
) [inline]

Combine two affine transformations, first forward, second reversed.

Parameters:
trans1 First transformation
trans2 Second transformation
void TRANS2D_AFFINE::ConvertForward ( const DRECT2D irect,
DRECT2D orect 
) const

Perform forward transformation on DRECT2D.

Parameters:
irect Input rectangle
orect Output rectangle
DRECT2D TRANS2D_AFFINE::ConvertForward ( const DRECT2D irect  )  const [inline]

Perform forward transformation on DRECT2D.

Returns:
Converted rectangle.
Parameters:
irect Input rectangle
void TRANS2D_AFFINE::ConvertForward ( const double *  ipoints,
double *  opoints,
INT32  NumPoints,
int  NumDim 
) const

Perform forward transformation on general array.

Parameters:
ipoints Input point array
opoints Output point array
NumPoints Number of points to convert
NumDim Number of dimensions
void TRANS2D_AFFINE::ConvertForward ( const DPOINT3D ipoints,
DPOINT3D opoints,
INT32  NumPoints 
) const

Perform forward transformation on DPOINT3D array.

Parameters:
ipoints Input point array
opoints Output point array
NumPoints Number of points to convert
void TRANS2D_AFFINE::ConvertForward ( const DPOINT2D ipoints,
DPOINT2D opoints,
INT32  NumPoints 
) const

Perform forward transformation on DPOINT2D array.

Parameters:
ipoints Input point array
opoints Output point array
NumPoints Number of points to convert
DPOINT3D TRANS2D_AFFINE::ConvertForward ( const DPOINT3D ipoint  )  const [inline]

Perform forward transformation on DPOINT3D.

Returns:
Converted point.
Parameters:
ipoint Input point
DPOINT2D TRANS2D_AFFINE::ConvertForward ( const DPOINT2D ipoint  )  const [inline]

Perform forward transformation on DPOINT2D.

Returns:
Converted point.
Parameters:
ipoint Input point
void TRANS2D_AFFINE::ConvertForward ( double  x,
double  y,
double &  ox,
double &  oy 
) const [inline]

Perform forward transformation on X/Y point.

Parameters:
x X coordinate
y Y coordinate
ox X coordinate returned
oy Y coordinate returned
DPOINT2D TRANS2D_AFFINE::ConvertForward ( double  x,
double  y 
) const [inline]

Perform forward transformation on X/Y point.

Returns:
Converted point.
Parameters:
x X coordinate
y Y coordinate
void TRANS2D_AFFINE::ConvertInverse ( const DRECT2D irect,
DRECT2D orect 
) const

Perform inverse transformation on DRECT2D.

Parameters:
irect Input rectangle
orect Output rectangle
DRECT2D TRANS2D_AFFINE::ConvertInverse ( const DRECT2D irect  )  const [inline]

Perform inverse transformation on DRECT2D.

Returns:
Converted rectangle.
Parameters:
irect Input rectangle
void TRANS2D_AFFINE::ConvertInverse ( const double *  ipoints,
double *  opoints,
INT32  NumPoints,
int  NumDim 
) const

Perform reverse transformation on general array.

Parameters:
ipoints Input point array
opoints Output point array
NumPoints Number of points to convert
NumDim Number of dimensions
void TRANS2D_AFFINE::ConvertInverse ( const DPOINT3D ipoints,
DPOINT3D opoints,
INT32  NumPoints 
) const

Perform inverse transformation on DPOINT3D array.

Parameters:
ipoints Input point array
opoints Output point array
NumPoints Number of points to convert
void TRANS2D_AFFINE::ConvertInverse ( const DPOINT2D ipoints,
DPOINT2D opoints,
INT32  NumPoints 
) const

Perform inverse transformation on DPOINT2D array.

Parameters:
ipoints Input point array
opoints Output point array
NumPoints Number of points to convert
DPOINT3D TRANS2D_AFFINE::ConvertInverse ( const DPOINT3D ipoint  )  const [inline]

Perform inverse transformation on DPOINT3D.

Returns:
Converted point.
Parameters:
ipoint Input point
DPOINT2D TRANS2D_AFFINE::ConvertInverse ( const DPOINT2D ipoint  )  const [inline]

Perform inverse transformation on DPOINT2D.

Returns:
Converted point.
Parameters:
ipoint Input point
void TRANS2D_AFFINE::ConvertInverse ( double  x,
double  y,
double &  ox,
double &  oy 
) const [inline]

Perform forward transformation on X/Y point.

Parameters:
x X coordinate
y Y coordinate
ox X coordinate returned
oy Y coordinate returned
DPOINT2D TRANS2D_AFFINE::ConvertInverse ( double  x,
double  y 
) const [inline]

Perform inverse transformation on X/Y point.

Returns:
Converted point.
Parameters:
x X coordinate
y Y coordinate
void TRANS2D_AFFINE::DisectForward ( double *  xscale,
double *  yscale,
double *  rotangle = 0,
double *  shearangle = 0 
) const [inline]

Determine scale/rotation/shear for forward transformation.

Parameters:
xscale X scale returned (0 if don't need)
yscale Y scale returned (0 if don't need)
rotangle Rotation angle in radians returned (0 if don't need)
shearangle Shear angle in radians returned (0 if don't need)
void TRANS2D_AFFINE::DisectInverse ( double *  xscale,
double *  yscale,
double *  rotangle = 0,
double *  shearangle = 0 
) const [inline]

Determine scale/rotation/shear for inverse transformation.

Parameters:
xscale X scale returned (0 if don't need)
yscale Y scale returned (0 if don't need)
rotangle Rotation angle in radians returned (0 if don't need)
shearangle Shear angle in radians returned (0 if don't need)
void TRANS2D_AFFINE::GetMatrices ( MAT3X3  fwd,
MAT3X3  inv 
) const [inline]

Retrieve copy of affine matrices.

Parameters:
fwd Forward matrix returned
inv Inverse matrix returned
void TRANS2D_AFFINE::GetValuesForward ( double &  xscale,
double &  xrot,
double &  xpos,
double &  yscale,
double &  yrot,
double &  ypos 
) const [inline]

Get values for forward transformation.

Parameters:
xscale X scale value returned
xrot X rotation value returned
xpos X position value returned
yscale Y scale value returned
yrot Y rotation value returned
ypos Y position value returned
bool TRANS2D_AFFINE::HasReverseOrientation (  )  const [inline]

Determine if tranformation results in orientation (left-handed vs right-handed) reversal.

bool TRANS2D_AFFINE::IsEqual ( const TRANS2D_AFFINE rhs  )  const [inline]
bool TRANS2D_AFFINE::IsEquivalentTo ( const TRANS2D_AFFINE rhs  )  const [inline]

Determine if the two transformation's are equivalent.

Returns:
'True' if equivalent, 'false' if not
bool TRANS2D_AFFINE::IsIdentity ( void   )  const [inline]

Determine if the transformation is an identity.

Returns:
'True' if identity, 'false' if not
TRANS2D_AFFINE& TRANS2D_AFFINE::operator= ( const TRANS2D_AFFINE rhs  )  [inline]

Assignment from TRANS2D_AFFINE.

void TRANS2D_AFFINE::ReverseDirection (  )  [inline]

Reverse direction of transformation.

ERRVALUE TRANS2D_AFFINE::SetCtrlPoint ( const CTRLPOINT3 cp,
int  numpoints,
bool  invert = false 
) [inline]

Set transformation from CTRLPOINT3 array.

Parameters:
cp Control point array
numpoints Number of control points
invert Invert coordinate system (for images)
ERRVALUE TRANS2D_AFFINE::SetCtrlPoint ( const CTRLPOINT cp,
int  numpoints,
bool  invert = false 
) [inline]

Set transformation from CTRLPOINT array.

Parameters:
cp Control point array
numpoints Number of control points
invert Invert coordinate system (for images)
void TRANS2D_AFFINE::SetIdentity (  )  [inline]

Set transformation to "identity".

void TRANS2D_AFFINE::SetMatrices ( const MAT3X3  fwd,
const MAT3X3  inv 
) [inline]

Set transformation from affine matrices.

Parameters:
fwd Forward transformation
inv Inverse transformation

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

Generated on Sun Oct 7 21:33:57 2012 for TNTsdk 2012 by  doxygen 1.6.1