trans2d.h File Reference

<mi32/trans2d.h> Definitions for 2-D transformations and macros More...

#include <mi32/ctrlpt.h>

Include dependency graph for trans2d.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define GEOMLIBEXPORT   MI_DLLIMPORT
#define trans2dm(ix, iy, mat, ox, oy)
#define TRANS2DMODEL_3D   0x2000
#define TRANS2DMODEL_Affine   0x0100
#define TRANS2DMODEL_Bilinear   0x0300
#define TRANS2DMODEL_Conformal   0x0700
#define TRANS2DMODEL_FlagMask   0xF000
#define TRANS2DMODEL_OrderMask   0x00FF
#define TRANS2DMODEL_OrientInvert   0x4000
#define TRANS2DMODEL_Piecewise   0x8000
#define TRANS2DMODEL_PlaneProj   0x0200
#define TRANS2DMODEL_Polynomial   0x0400
#define TRANS2DMODEL_Quintic   0x0500
#define TRANS2DMODEL_RationalPolynomial   0x0900
#define TRANS2DMODEL_RubberSheet   0x0800
#define TRANS2DMODEL_SpaceResect   0x0600
#define TRANS2DMODEL_TypeMask   0x0F00
#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 CoordTrans2DCoeff (const void *vtdp, const double **fx, const double **fy, const double **ix, const double **iy)
GEOMLIBEXPORT int CoordTrans2DCreate (int NumPoints, const CTRLPOINT3 *cp, UINT16 transmodel, void **vtdp)
GEOMLIBEXPORT int CoordTrans2DDup (const void *ivtdp, void **ovtdp)
GEOMLIBEXPORT void CoordTrans2DFree (void *vtdp)
GEOMLIBEXPORT int CoordTrans2DFwd (const void *vip, void *vop, int numpts, int pointsize, const void *vtdp)
GEOMLIBEXPORT int CoordTrans2DGetAffine (const void *vtdp, MAT3X3 forward, MAT3X3 inverse)
GEOMLIBEXPORT int CoordTrans2DInv (const void *vip, void *vop, int numpts, int pointsize, const void *vtdp)
GEOMLIBEXPORT int CoordTrans2DIsAffine (const void *vtdp)
GEOMLIBEXPORT int CoordTrans2DIsReversible (const void *vtdp)
GEOMLIBEXPORT void CoordTrans2DSetPrimaryDirection (void *vtdp, UINT8 PrimaryDir)
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)
int Trans2DFunc (void *idata, void *odata, int numpts, int numdim, void *fwd)
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 int Trans2DReadArcWorld (const FILEPATH &filepath, MAT3X3 forward, MAT3X3 inverse)
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

Definition in file trans2d.h.


Define Documentation

#define GEOMLIBEXPORT   MI_DLLIMPORT
 

Definition at line 34 of file trans2d.h.

#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_; }

Definition at line 45 of file trans2d.h.

#define TRANS2DMODEL_3D   0x2000
 

3D model

Definition at line 68 of file trans2d.h.

#define TRANS2DMODEL_Affine   0x0100
 

Affine (MAT3X3).

Definition at line 70 of file trans2d.h.

#define TRANS2DMODEL_Bilinear   0x0300
 

Definition at line 72 of file trans2d.h.

#define TRANS2DMODEL_Conformal   0x0700
 

Conformal transformation.

Definition at line 76 of file trans2d.h.

#define TRANS2DMODEL_FlagMask   0xF000
 

Mask out "flag" values.

Definition at line 64 of file trans2d.h.

#define TRANS2DMODEL_OrderMask   0x00FF
 

Mask out "order" for polynomial and other models.

Definition at line 62 of file trans2d.h.

#define TRANS2DMODEL_OrientInvert   0x4000
 

Inverted coordinate systems (eg. raster to map).

Definition at line 67 of file trans2d.h.

#define TRANS2DMODEL_Piecewise   0x8000
 

Model is "piecewise".

Definition at line 66 of file trans2d.h.

#define TRANS2DMODEL_PlaneProj   0x0200
 

Plane-projective.

Definition at line 71 of file trans2d.h.

#define TRANS2DMODEL_Polynomial   0x0400
 

Definition at line 73 of file trans2d.h.

#define TRANS2DMODEL_Quintic   0x0500
 

Definition at line 74 of file trans2d.h.

#define TRANS2DMODEL_RationalPolynomial   0x0900
 

Definition at line 78 of file trans2d.h.

#define TRANS2DMODEL_RubberSheet   0x0800
 

"Rubber Sheeting" or "Morphing" model

Definition at line 77 of file trans2d.h.

#define TRANS2DMODEL_SpaceResect   0x0600
 

Space resection (aerial photography).

Definition at line 75 of file trans2d.h.

#define TRANS2DMODEL_TypeMask   0x0F00
 

Mask out "type" values below.

Definition at line 63 of file trans2d.h.

#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_; }

Definition at line 48 of file trans2d.h.

#define trans2dorient  )     SIGN(m[0][0]*m[1][1]-m[1][0]*m[0][1])
 

Definition at line 298 of file trans2d.h.

#define trans2dx ix,
iy,
mat   )     ((ix) * mat[0][0] + (iy) * mat[0][1] + mat[0][2])
 

Definition at line 52 of file trans2d.h.

#define trans2dy ix,
iy,
mat   )     ((ix) * mat[1][0] + (iy) * mat[1][1] + mat[1][2])
 

Definition at line 53 of file trans2d.h.


Function Documentation

GEOMLIBEXPORT void CoordTrans2DCoeff const void *  vtdp,
const double **  fx,
const double **  fy,
const double **  ix,
const double **  iy
 

Return pointers to forward and inverse polynomial transformation coefficients.

Parameters:
vtdp  Transformation data
fx  Forward x pointer
fy  Forward y pointer
ix  Inverse x pointer
iy  Inverse y pointer

GEOMLIBEXPORT int CoordTrans2DCreate int  NumPoints,
const CTRLPOINT3 cp,
UINT16  transmodel,
void **  vtdp
 

Initialize polynomial transformation.

Parameters:
NumPoints  Number of control points used
cp  Control point buffer
transmodel  Transformation model
vtdp  Passed and returned

GEOMLIBEXPORT int CoordTrans2DDup const void *  ivtdp,
void **  ovtdp
 

Duplicate transformation.

Parameters:
ivtdp  Input transformation data
ovtdp  Output transformation data

GEOMLIBEXPORT void CoordTrans2DFree void *  vtdp  ) 
 

Frees the transformation data.

GEOMLIBEXPORT int CoordTrans2DFwd const void *  vip,
void *  vop,
int  numpts,
int  pointsize,
const void *  vtdp
 

Perform forward 2-D polynomial/projective transformation.

Parameters:
vip  Input pointer
vop  Output pointer
numpts  Number of points
pointsize  Point size
vtdp  Transformation data

GEOMLIBEXPORT int CoordTrans2DGetAffine const void *  vtdp,
MAT3X3  forward,
MAT3X3  inverse
 

Retrieve affine transformation matrices.

Parameters:
vtdp  Transformation data
forward  Forward transformation passed / returned
inverse  Inverse transformation passed / returned

GEOMLIBEXPORT int CoordTrans2DInv const void *  vip,
void *  vop,
int  numpts,
int  pointsize,
const void *  vtdp
 

Perform inverse 2-D polynomial/projective transformation.

Parameters:
vip  Input pointer
vop  Output pointer
numpts  Number of points
pointsize  Point size
vtdp  Transformation data

GEOMLIBEXPORT int CoordTrans2DIsAffine const void *  vtdp  ) 
 

Return TRUE if transformation is "affine", false if not.

Returns:
TRUE if transformation is "affine", false if not
Parameters:
vtdp  Transformation data

GEOMLIBEXPORT int CoordTrans2DIsReversible const void *  vtdp  ) 
 

Return TRUE if transformation is "reversible", false if not.

Returns:
TRUE if transformation is "reversible", false if not

GEOMLIBEXPORT void CoordTrans2DSetPrimaryDirection void *  vtdp,
UINT8  PrimaryDir
 

Set flag for controlling primary transformation direction.

Parameters:
vtdp  Transformation data
PrimaryDir  Primary direction

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

int Trans2DFunc void *  idata,
void *  odata,
int  numpts,
int  numdim,
void *  fwd
 

TRANSFUNC which uses a trans2d matrix.

Parameters:
idata  Input data
odata  Output data
numpts  Number of points
fwd  Transformation matrix

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 int Trans2DReadArcWorld const FILEPATH filepath,
MAT3X3  forward,
MAT3X3  inverse
 

Read transformation from ArcWorld file.

Returns:
TRUE if successful, FALSE if no file, < 0 if error.
Parameters:
filepath  ArcWorld file path
forward  Forward transformation returned
inverse  Inverse transformation returned

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 Wed May 31 15:28:01 2006 for TNTsdk by  doxygen 1.3.8-20040913