NAME

cxCoordTransform - apply a homogeneous transformation matrix to all coordinates
#include <cx/DataAccess.h>

cxCoord *cxCoordTransform( cxCoord *coord, long m, long n, float *mat )
integer function cxCoordTransform(coord, m, n, mat)
integer coord
integer m, n
real    mat
coord
The input coordinate structure to which the transformation matrix is to be applied.
m
Leading dimension of the homogeneous transformation matrix mat.
n
Second dimension of the homogeneous transformation matrix mat.
mat
MxN homogeneous transformation matrix.
Returns pointer to new curvilinear coordinates with transformed values. cxCoordTransform multiplies the transformation matrix mat times the coordinates of each point in the input coord to produce the coordinates of the corresponding output point. The matrix mat deals with homogeneous coordinates, so that the last column of the matrix yields the offset vector for the output; the last row of the matrix is ignored. The calculation of the matrix multiplication computes output coordinates (out) based on input coordinates (in) as follows:
  out(i) = mat(i, N-1)  +  sum    mat(i,j) * in(j)
        j <  N
        j >= 0
where 0 <= i < M-1.

See cxDataManAbortOnError for more details on writing portable module code that copes well with limited memory.

cxCoordNew, cxDataManAbortOnError



[ Documentation Home ]