PEXTransformPoints2D Utility


Synopsis

 
   int PEXTransformPoints2D(
       PEXMatrix3x3 transform,
       int count,
       PEXCoord2D *points,
       PEXCoord2D *points_return
   )
 

Arguments

transform
The transformation matrix to apply to the points.

count
The number of points to transform.

points
A pointer to an array of 2D points to transform.

points_return
A pointer to an array in which to store the transformed points.

Returns

Zero if successful; otherwise, one of the following:

PEXBadHomoCoord
One or more of the transformed points has a homogeneous coordinate of 0.

Description

Invoke PEXTransformPoints2D to apply the specified homogeneous transformation matrix to the list of points.

When applying the transformation, the points are first converted to homogeneous points by assigning them a homogeneous coordinate of 1. The transformation is then applied:

  P' = TxP

Where P is the point, treated as a column vector, and T is the transformation matrix. The points are then mapped to 2D by dividing their first three coordinates by the computed homogeneous coordinate.

If the function returns unsuccessfully, then all points other than those with a homogeneous coordinate of zero are transformed and returned.

If the return array is the same as the input array, then this utility overwrites the input values with the transformed values.

Errors

None.

See Also

For a list of miscellaneous transformation utilities, see Miscellaneous Transformation Utilities. For a list of related topics, see PEXlib Utilities.