PolygonTransform
Syntax | |||
struct PolygonData *PolygonTransform(struct PolygonData *src, int sze, int (*bbox)(void *x,void *y,int s), int (*trf)(int ssze,void *src,int dsze, void *dst,void *data), void *data); | |||
Header | |||
general/polygon.h | |||
Library | |||
poly | |||
Description | |||
The The argument src points to the polygon group. The argument sze defines the number of bytes required to store a point in the transformed polygon group. The argument bbox is a pointer to a function of the form:
This function is called each time a new point is added to a polygon and its purpose is to calculate the bounding box of the polygon. The first argument x is a pointer to the point added to the polygon, while the second argument y is an array pointer consisting of two elements. The first defines the lower limits of the bounding box, while the second defines the upper limits. In the case of a two dimensional polygon the two elements would define the bottom left and top right hand co-ordinates of the bound box. The final argument s defines the number of bytes required to store a point. The argument trnf is a pointer to a function of the form:
This function performs the modification of the points in the polygon group. The size in bytes of the input coordinate is given be the argument ssze. The coordinate data is pointed to by the argument src. The first two elements stored in the coordinate data block are assumed to be single precision floating point numbers of type The size in bytes of the output coordinate is given be the argument dsze. The coordinate data is pointed to by the argument dst. The first two elements stored in the coordinate data block are assumed to be single precision floating point numbers of type The transformation should read the coordinate from src, modify it and write the value to dst. The data argument of the The function should return a zero if the transformation was successfully applied or (-1) if an error occurred. | |||
Returns | |||
Returns a pointer to the new polygon group on success. On error, a NULL pointer is returned. | |||
Errors | |||
On error, a NULL pointer is returned. | |||
Example | |||
|