TRANS2D_AFFINE Class Reference

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

#include <mi32/trans2dc.h>

List of all members.

Public Types

enum  AXIS { AXIS_X = 0, AXIS_Y = 1 }

Public Member Functions

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 ConvertForward (const DRECT2D &irect, DRECT2D &orect) const
DRECT2D ConvertForward (const DRECT2D &irect) 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 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
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 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)
 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 ()


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.

Definition at line 224 of file trans2dc.h.


Member Enumeration Documentation

enum TRANS2D_AFFINE::AXIS

Enumerator:
AXIS_X 
AXIS_Y 

Definition at line 228 of file trans2dc.h.


Constructor & Destructor Documentation

TRANS2D_AFFINE::TRANS2D_AFFINE (  )  [inline]

Default constructor, create identity transformation.

Definition at line 234 of file trans2dc.h.

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

Copy constructor.

Definition at line 238 of file trans2dc.h.

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

Definition at line 246 of file trans2dc.h.

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

Construct from affine matrices.

Parameters:
fwd  Forward transformation matrix
inv  Inverse transformation matrix

Definition at line 261 of file trans2dc.h.

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

Definition at line 270 of file trans2dc.h.

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)

Definition at line 276 of file trans2dc.h.

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)

Definition at line 283 of file trans2dc.h.

TRANS2D_AFFINE::~TRANS2D_AFFINE (  )  [inline]

Destructor.

Definition at line 290 of file trans2dc.h.


Member Function Documentation

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

Apply coordinate offset.

Parameters:
offset  Offset

Definition at line 311 of file trans2dc.h.

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

Apply coordinate offset.

Parameters:
xoffset  X offset
yoffset  Y offset

Definition at line 305 of file trans2dc.h.

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

Apply coordinate offset relative to reverse direction.

Parameters:
offset  Offset

Definition at line 322 of file trans2dc.h.

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

Apply coordinate offset relative to reverse direction.

Parameters:
xoffset  X offset
yoffset  Y offset

Definition at line 316 of file trans2dc.h.

void TRANS2D_AFFINE::ApplyRotation ( double  angle  )  [inline]

Apply rotation angle.

Parameters:
angle  Rotation angle in radians

Definition at line 327 of file trans2dc.h.

void TRANS2D_AFFINE::ApplyScale ( const DPOINT2D scale  )  [inline]

Apply scale to X/Y axes.

Parameters:
scale  X/Y scale

Definition at line 343 of file trans2dc.h.

void TRANS2D_AFFINE::ApplyScale ( double  xscale,
double  yscale 
) [inline]

Apply scale to X/Y axes.

Parameters:
xscale  X scale
yscale  Y scale

Definition at line 337 of file trans2dc.h.

void TRANS2D_AFFINE::ApplyScale ( double  scale  )  [inline]

Apply scale equally to X/Y axes.

Parameters:
scale  Scale

Definition at line 332 of file trans2dc.h.

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

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

Parameters:
scale  X/Y scale

Definition at line 354 of file trans2dc.h.

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

Definition at line 348 of file trans2dc.h.

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)

Definition at line 359 of file trans2dc.h.

void TRANS2D_AFFINE::Combine ( const TRANS2D_AFFINE trans1,
const TRANS2D_AFFINE trans2 
) [inline]

Combine two affine transformations.

Parameters:
trans1  First transformation
trans2  Second transformation

Definition at line 373 of file trans2dc.h.

void TRANS2D_AFFINE::Combine ( const TRANS2D_AFFINE trans1  )  [inline]

Combine two affine transformations.

Parameters:
trans1  First transformation

Definition at line 365 of file trans2dc.h.

void TRANS2D_AFFINE::ConvertForward ( const DRECT2D irect,
DRECT2D orect 
) const [inline]

Perform forward transformation on DRECT2D.

Parameters:
irect  Input rectangle
orect  Output rectangle

Definition at line 430 of file trans2dc.h.

DRECT2D TRANS2D_AFFINE::ConvertForward ( const DRECT2D irect  )  const [inline]

Perform forward transformation on DRECT2D.

Returns:
Converted rectangle.
Parameters:
irect  Input rectangle

Definition at line 421 of file trans2dc.h.

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

Definition at line 401 of file trans2dc.h.

DPOINT2D TRANS2D_AFFINE::ConvertForward ( const DPOINT2D ipoint  )  const [inline]

Perform forward transformation on DPOINT2D.

Returns:
Converted point.
Parameters:
ipoint  Input point

Definition at line 395 of file trans2dc.h.

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
oy  Y coordinate

Definition at line 386 of file trans2dc.h.

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

Definition at line 380 of file trans2dc.h.

void TRANS2D_AFFINE::ConvertInverse ( const DRECT2D irect,
DRECT2D orect 
) const [inline]

Perform inverse transformation on DRECT2D.

Parameters:
irect  Input rectangle
orect  Output rectangle

Definition at line 479 of file trans2dc.h.

DRECT2D TRANS2D_AFFINE::ConvertInverse ( const DRECT2D irect  )  const [inline]

Perform inverse transformation on DRECT2D.

Returns:
Converted rectangle.
Parameters:
irect  Input rectangle

Definition at line 470 of file trans2dc.h.

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

Definition at line 450 of file trans2dc.h.

DPOINT2D TRANS2D_AFFINE::ConvertInverse ( const DPOINT2D ipoint  )  const [inline]

Perform inverse transformation on DPOINT2D.

Returns:
Converted point.
Parameters:
ipoint  Input point

Definition at line 444 of file trans2dc.h.

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

Definition at line 437 of file trans2dc.h.

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)

Definition at line 485 of file trans2dc.h.

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)

Definition at line 493 of file trans2dc.h.

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

Retrieve copy of affine matrices.

Parameters:
fwd  Forward matrix returned
inv  Inverse matrix returned

Definition at line 501 of file trans2dc.h.

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

Definition at line 507 of file trans2dc.h.

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

Definition at line 519 of file trans2dc.h.

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

Definition at line 527 of file trans2dc.h.

bool TRANS2D_AFFINE::IsIdentity ( void   )  const [inline]

Determine if the transformation is an identity.

Returns:
'True' if identity, 'false' if not

Definition at line 540 of file trans2dc.h.

TRANS2D_AFFINE& TRANS2D_AFFINE::operator= ( const TRANS2D_AFFINE rhs  )  [inline]

Assignment from TRANS2D_AFFINE.

Definition at line 294 of file trans2dc.h.

void TRANS2D_AFFINE::ReverseDirection (  )  [inline]

Reverse direction of transformation.

Definition at line 546 of file trans2dc.h.

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)

Definition at line 562 of file trans2dc.h.

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)

Definition at line 555 of file trans2dc.h.

void TRANS2D_AFFINE::SetIdentity (  )  [inline]

Set transformation to "identity".

Definition at line 569 of file trans2dc.h.

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

Set transformation from affine matrices.

Parameters:
fwd  Forward transformation
inv  Inverse transformation

Definition at line 573 of file trans2dc.h.


The documentation for this class was generated from the following file:
Generated on Thu Apr 26 04:47:40 2007 for TNTsdk by  doxygen 1.5.2