Simple affine X/Y coordinate transformation. More...
#include <mi32/trans2daffine.h>
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_AFFINE & | operator= (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) |
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.
| enum TRANS2D_AFFINE::AXIS |
| 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.
| matrix | Transformation matrix | |
| IsForward | True if forward transformation, false if inverse |
Construct from affine matrices.
| 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.
| trans1 | First transformation | |
| trans2 | Second transformation |
| TRANS2D_AFFINE::TRANS2D_AFFINE | ( | const CTRLPOINT * | cp, | |
| int | numpoints, | |||
| bool | invert = false | |||
| ) | [inline] |
Construct from CTRLPOINT array.
| 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.
| cp | Control point array | |
| numpoints | Number of control points | |
| invert | Invert coordinate system (for images) |
| TRANS2D_AFFINE::~TRANS2D_AFFINE | ( | ) | [inline] |
Destructor.
| void TRANS2D_AFFINE::ApplyOffset | ( | const DPOINT2D & | offset | ) | [inline] |
Apply coordinate offset.
| offset | Offset |
| void TRANS2D_AFFINE::ApplyOffset | ( | double | xoffset, | |
| double | yoffset | |||
| ) | [inline] |
Apply coordinate offset.
| xoffset | X offset | |
| yoffset | Y offset |
| void TRANS2D_AFFINE::ApplyOffsetReverse | ( | const DPOINT2D & | offset | ) | [inline] |
Apply coordinate offset relative to reverse direction.
| offset | Offset |
| void TRANS2D_AFFINE::ApplyOffsetReverse | ( | double | xoffset, | |
| double | yoffset | |||
| ) | [inline] |
Apply coordinate offset relative to reverse direction.
| xoffset | X offset | |
| yoffset | Y offset |
| void TRANS2D_AFFINE::ApplyRotation | ( | double | angle | ) | [inline] |
Apply rotation angle.
| angle | Rotation angle in radians |
| void TRANS2D_AFFINE::ApplyScale | ( | const DPOINT2D & | scale | ) | [inline] |
Apply scale to X/Y axes.
| scale | X/Y scale |
| void TRANS2D_AFFINE::ApplyScale | ( | double | xscale, | |
| double | yscale | |||
| ) | [inline] |
Apply scale to X/Y axes.
| xscale | X scale | |
| yscale | Y scale |
| void TRANS2D_AFFINE::ApplyScale | ( | double | scale | ) | [inline] |
Apply scale equally to X/Y axes.
| scale | Scale |
| void TRANS2D_AFFINE::ApplyScaleReverse | ( | const DPOINT2D & | scale | ) | [inline] |
Apply scale to X/Y axes, relative to reverse direction.
| scale | X/Y scale |
| void TRANS2D_AFFINE::ApplyScaleReverse | ( | double | xscale, | |
| double | yscale | |||
| ) | [inline] |
Apply scale to X/Y axes, relative to reverse direction.
| xscale | X scale | |
| yscale | Y scale |
| void TRANS2D_AFFINE::ApplyShear | ( | double | angle, | |
| AXIS | axis | |||
| ) | [inline] |
Apply shear relative to specified axis.
| 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.
| trans1 | First transformation | |
| trans2 | Second transformation |
| void TRANS2D_AFFINE::Combine | ( | const TRANS2D_AFFINE & | trans1 | ) | [inline] |
Combine two affine transformations.
| trans1 | First transformation |
| void TRANS2D_AFFINE::CombineForwardReverse | ( | const TRANS2D_AFFINE & | trans1, | |
| const TRANS2D_AFFINE & | trans2 | |||
| ) | [inline] |
Combine two affine transformations, first forward, second reversed.
| trans1 | First transformation | |
| trans2 | Second transformation |
Perform forward transformation on DRECT2D.
| irect | Input rectangle | |
| orect | Output rectangle |
Perform forward transformation on DRECT2D.
| irect | Input rectangle |
| void TRANS2D_AFFINE::ConvertForward | ( | const double * | ipoints, | |
| double * | opoints, | |||
| INT32 | NumPoints, | |||
| int | NumDim | |||
| ) | const |
Perform forward transformation on general array.
| 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.
| 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.
| ipoints | Input point array | |
| opoints | Output point array | |
| NumPoints | Number of points to convert |
| void TRANS2D_AFFINE::ConvertForward | ( | double | x, | |
| double | y, | |||
| double & | ox, | |||
| double & | oy | |||
| ) | const [inline] |
Perform forward transformation on X/Y point.
| 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.
| x | X coordinate | |
| y | Y coordinate |
Perform inverse transformation on DRECT2D.
| irect | Input rectangle | |
| orect | Output rectangle |
Perform inverse transformation on DRECT2D.
| irect | Input rectangle |
| void TRANS2D_AFFINE::ConvertInverse | ( | const double * | ipoints, | |
| double * | opoints, | |||
| INT32 | NumPoints, | |||
| int | NumDim | |||
| ) | const |
Perform reverse transformation on general array.
| 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.
| 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.
| ipoints | Input point array | |
| opoints | Output point array | |
| NumPoints | Number of points to convert |
| void TRANS2D_AFFINE::ConvertInverse | ( | double | x, | |
| double | y, | |||
| double & | ox, | |||
| double & | oy | |||
| ) | const [inline] |
Perform forward transformation on X/Y point.
| 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.
| 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.
| 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.
| 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) |
Retrieve copy of affine matrices.
| 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.
| 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.
| bool TRANS2D_AFFINE::IsIdentity | ( | void | ) | const [inline] |
Determine if the transformation is an identity.
| 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.
| 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.
| cp | Control point array | |
| numpoints | Number of control points | |
| invert | Invert coordinate system (for images) |
| void TRANS2D_AFFINE::SetIdentity | ( | ) | [inline] |
Set transformation to "identity".
Set transformation from affine matrices.
| fwd | Forward transformation | |
| inv | Inverse transformation |
1.6.1