mi32/trans2d.h File Reference

<mi32/trans2d.h> More...

#include <mi32/ctrlpt.h>
#include <mi32/trans2dmodel.h>
Include dependency graph for trans2d.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define GEOMLIBEXPORT   MI_DLLIMPORT
#define trans2dm(ix, iy, mat, ox, oy)
#define trans2dms(ix, iy, mat)
#define trans2dorient(m)   SIGN(m[0][0]*m[1][1]-m[1][0]*m[0][1])
#define trans2dx(ix, iy, mat)   ((ix) * mat[0][0] + (iy) * mat[0][1] + mat[0][2])
#define trans2dy(ix, iy, mat)   ((ix) * mat[1][0] + (iy) * mat[1][1] + mat[1][2])

Functions

GEOMLIBEXPORT void DisectTrans2D (const MAT3X3 mat, double *xscale, double *yscale, double *rot, double *shear)
GEOMLIBEXPORT int FindBestTrans2D (int NumPoints, const CTRLPOINT *cp, MAT3X3 forward, MAT3X3 inverse)
GEOMLIBEXPORT int FindBestTrans2D3 (int NumPoints, const CTRLPOINT3 *cp3, MAT3X3 forward, MAT3X3 inverse)
GEOMLIBEXPORT int FindBestTrans2D3A (int NumPoints, const CTRLPOINT3 *cp3, MAT3X3 forward, MAT3X3 inverse, UINT32 flags)
GEOMLIBEXPORT int FindBestTrans2DA (int NumPoints, const CTRLPOINT *cp, MAT3X3 forward, MAT3X3 inverse, UINT32 flags)
GEOMLIBEXPORT void trans2d (double ix, double iy, const MAT3X3 ItoO, double *ox, double *oy)
GEOMLIBEXPORT void trans2dfindinverse (const MAT3X3 fwd, MAT3X3 inv)
GEOMLIBEXPORT void trans2dinit (MAT3X3 ItoO, MAT3X3 OtoI)
GEOMLIBEXPORT void trans2dmatch (MAT3X3 f, MAT3X3 i, double ix, double iy, double ox, double oy)
GEOMLIBEXPORT void trans2dmatrix (MAT3X3 m, const MAT3X3 mat)
GEOMLIBEXPORT void trans2dmatrix1 (const MAT3X3 m, const MAT3X3 mat, MAT3X3 out)
GEOMLIBEXPORT void trans2dmatrix2 (MAT3X3 atoc, MAT3X3 ctoa, const MAT3X3 atob, const MAT3X3 btoa, const MAT3X3 btoc, const MAT3X3 ctob)
GEOMLIBEXPORT void Trans2DRect (const MAT3X3 trans, const DRECT2D *irect, DRECT2D *orect)
GEOMLIBEXPORT void trans2drot (MAT3X3 m, MAT3X3 n, double angle)
GEOMLIBEXPORT void trans2drotpt (MAT3X3 fwd, MAT3X3 inv, double angle, double ptx, double pty)
GEOMLIBEXPORT void trans2dscale (MAT3X3 m, MAT3X3 n, double sx, double sy)
GEOMLIBEXPORT void trans2dshear (MAT3X3 m, MAT3X3 n, double shear, int axis)
GEOMLIBEXPORT void trans2dshift (MAT3X3 m, MAT3X3 n, double dx, double dy)

Detailed Description

<mi32/trans2d.h>

Definitions for 2-D transformations and macros


Define Documentation

#define GEOMLIBEXPORT   MI_DLLIMPORT
#define trans2dm ( ix,
iy,
mat,
ox,
oy   ) 
Value:
{ double _trans2dm_tx_, _trans2dm_ty_; _trans2dm_tx_ = (ix) * mat[0][0] + (iy) * mat[0][1] + mat[0][2]; \
   _trans2dm_ty_ = (ix) * mat[1][0] + (iy) * mat[1][1] + mat[1][2]; *(ox) = _trans2dm_tx_; *(oy) = _trans2dm_ty_; }
#define trans2dms ( ix,
iy,
mat   ) 
Value:
{ double _trans2dms_tx_, _trans2dms_ty_; _trans2dms_tx_ = (ix) * mat[0][0] + (iy) * mat[0][1] + mat[0][2]; \
   _trans2dms_ty_ = (ix) * mat[1][0] + (iy) * mat[1][1] + mat[1][2]; (ix) = _trans2dms_tx_; (iy) = _trans2dms_ty_; }
#define trans2dorient (  )     SIGN(m[0][0]*m[1][1]-m[1][0]*m[0][1])
#define trans2dx ( ix,
iy,
mat   )     ((ix) * mat[0][0] + (iy) * mat[0][1] + mat[0][2])
#define trans2dy ( ix,
iy,
mat   )     ((ix) * mat[1][0] + (iy) * mat[1][1] + mat[1][2])

Function Documentation

GEOMLIBEXPORT void DisectTrans2D ( const MAT3X3  mat,
double *  xscale,
double *  yscale,
double *  rot,
double *  shear 
)

Disect a trans2d into component parts (scale, rotation, shear).

Parameters:
mat Transformation matrix
xscale X scale passed / returned
yscale Y scale passed / returned
rot Rotation passed / returned
shear Shear passed / returned
GEOMLIBEXPORT int FindBestTrans2D ( int  NumPoints,
const CTRLPOINT cp,
MAT3X3  forward,
MAT3X3  inverse 
)

Compute "best" 2-D affine transformation for set of CTRLPOINT's.

Parameters:
NumPoints Number of points
cp Set of CTRLPOINT's
forward Forward transformation passed / returned
inverse Inverse transformation passed / returned
GEOMLIBEXPORT int FindBestTrans2D3 ( int  NumPoints,
const CTRLPOINT3 cp3,
MAT3X3  forward,
MAT3X3  inverse 
)

Compute "best" 2-D affine transformation for set of CTRLPOINT3's.

Parameters:
NumPoints Number of points
cp3 Set of CTRLPOINT3's
forward Forward transformation passed / returned
inverse Inverse transformation passed / returned
GEOMLIBEXPORT int FindBestTrans2D3A ( int  NumPoints,
const CTRLPOINT3 cp3,
MAT3X3  forward,
MAT3X3  inverse,
UINT32  flags 
)

Find "best" affine transformation given set of control points using CTRLPOINT3 array.

Parameters:
NumPoints Number of points
cp3 Set of CTRLPOINT3's
forward Forward transformation passed / returned
inverse Inverse transformation passed / returned
flags Flags
GEOMLIBEXPORT int FindBestTrans2DA ( int  NumPoints,
const CTRLPOINT cp,
MAT3X3  forward,
MAT3X3  inverse,
UINT32  flags 
)

Find "best" affine transformation given set of control points using CTRLPOINT array.

Parameters:
NumPoints Number of points
cp Set of CTRLPOINT's
forward Forward transformation passed / returned
inverse Inverse transformation passed / returned
flags Flags
GEOMLIBEXPORT void trans2d ( double  ix,
double  iy,
const MAT3X3  ItoO,
double *  ox,
double *  oy 
)

Perform affine transformation on a point.

Parameters:
ix Input X coordinate
iy Input Y coordinate
ItoO Input to Output transformation
ox Output X coordinate
oy Output Y coordinate
GEOMLIBEXPORT void trans2dfindinverse ( const MAT3X3  fwd,
MAT3X3  inv 
)

Find the inverse transformation.

Parameters:
fwd Input transformation
inv Output inverse transformation
GEOMLIBEXPORT void trans2dinit ( MAT3X3  ItoO,
MAT3X3  OtoI 
)

Initialize an affine transformation.

This will initialize the transformation to "identity".

Parameters:
ItoO Input to Output transformation
OtoI Output to Input transformation
GEOMLIBEXPORT void trans2dmatch ( MAT3X3  f,
MAT3X3  i,
double  ix,
double  iy,
double  ox,
double  oy 
)

Shift forward/inverse affine transformation so specified points match.

Parameters:
f Input to Output transformation
i Output to Input transformation
ix Input x
iy Input y
ox Output x
oy Output y
GEOMLIBEXPORT void trans2dmatrix ( MAT3X3  m,
const MAT3X3  mat 
)

Apply a matrix to a transformation ** not reversible.

Parameters:
m Output matrix
mat Input matrix
GEOMLIBEXPORT void trans2dmatrix1 ( const MAT3X3  m,
const MAT3X3  mat,
MAT3X3  out 
)

Apply a matrix to a transformation ** not reversible.

Parameters:
m Input matrices
out Output matrix
GEOMLIBEXPORT void trans2dmatrix2 ( MAT3X3  atoc,
MAT3X3  ctoa,
const MAT3X3  atob,
const MAT3X3  btoa,
const MAT3X3  btoc,
const MAT3X3  ctob 
)

Combine two affine transformations (both forward and inverse).

Parameters:
atoc Output matrices
atob Input matrices
GEOMLIBEXPORT void Trans2DRect ( const MAT3X3  trans,
const DRECT2D irect,
DRECT2D orect 
)

Apply an affine transformation to a DRECTXY.

Parameters:
trans Affine transformation
irect Input rectangle
orect Outpu rectange
GEOMLIBEXPORT void trans2drot ( MAT3X3  m,
MAT3X3  n,
double  angle 
)

Apply a rotation to an affine transformation.

Parameters:
m Input to Output transformation
n Output to Input transformation
angle Angle to rotate by
GEOMLIBEXPORT void trans2drotpt ( MAT3X3  fwd,
MAT3X3  inv,
double  angle,
double  ptx,
double  pty 
)

Rotate by ang (radians) about point x y.

Parameters:
fwd Forward transformation
inv Inverse transformation
angle Angle to rotate by
ptx Point to rotat about
GEOMLIBEXPORT void trans2dscale ( MAT3X3  m,
MAT3X3  n,
double  sx,
double  sy 
)

Scale image by sx, sy.

Parameters:
m Input to Output transformation
n Output to Input transformation
sx X scale
sy Y scale
GEOMLIBEXPORT void trans2dshear ( MAT3X3  m,
MAT3X3  n,
double  shear,
int  axis 
)

Apply a shear to an affine transformation.

Parameters:
m Input to Output transformation
n Output to Input transformation
shear Shear angle in radians (0 = no shear)
axis Axis to shear (0 = X, 1 = Y)
GEOMLIBEXPORT void trans2dshift ( MAT3X3  m,
MAT3X3  n,
double  dx,
double  dy 
)

Apply an offset to an affine transformation.

Parameters:
m Input to Output transformation
n Output to Input transformation
dx X shift
dy Y shift

Generated on Sun Oct 7 21:28:32 2012 for TNTsdk 2012 by  doxygen 1.6.1