Mapping Between Image and Client Coordinates

All of the vision tools that operate on a pel buffer and require or return locations, perform mapping between client and image coordinates automatically.

To map between client and image coordinates yourself, use clientFromImageXform() and imageFromClientXform() along with the cc2XformLinear multiplication operator. To map an arbitrary point (x,y) in image coordinates to client coordinates, write something like this:

cc2Vect clientPt;

clientPt = thePelBuf.clientFromImageXform() * cc2Vect(x, y);

The function cc2XformLinear::mapPoint() provides the same functionality as the multiplication operator. The cc2XformLinear class provides several other member functions that you can use to map angles, areas, and vectors between image and client coordinates.