DS_DRAW_POLYGON(3)

FUNCTION
ds_draw_polygon - Draw a polygon into a 2 dimensional array.

SYNOPSIS
#include <karma_ds.h>

flag ds_draw_polygon

(char *array, unsigned int elem_type, dim_desc *abs_dim_desc, unsigned int abs_stride, dim_desc *ord_dim_desc, unsigned int ord_stride, edit_coord *coords, unsigned int num_points, double value[2])

DESCRIPTION
This routine will draw a concave non-simple polygon into a 2 dimensional Karma array. The polygon can be clockwise or anti-clockwise. Inside-outside test done by Jordan's rule: a point is considered inside if an emanating ray intersects the polygon an odd number of times. The algorithm is modified from the Concave Polygon Scan Conversion by Paul Heckbert from "Graphics Gems", Academic Press, 1990.

array
    The start of the array (plane) data.

elem_type
    The type of the element to draw.

abs_dim_desc
    The abscissa dimension descriptor.

abs_stride
    The stride of abscissa co-ordinates in memory (in bytes).

ord_dim_desc
    The ordinate dimension descriptor.

ord_stride
    The stride of ordinate co-ordinates in memory (in bytes).

coords
    The co-ordinate array for the vertices. The co-ordinates must be stored in clockwise rotation order (any point to start).

num_points
    The number of vertices.

value
    The value to write the polygon into the array.

RETURN VALUE
TRUE on success, else FALSE.

Multi-threading Level
Unsafe.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/