Home| base |src.lib|graphic|fbuffer| FrameBufferPolygon Index

FrameBufferPolygon

Syntax
int FrameBufferPolygon(struct FrameBuffer *ptr, struct FrameBufferMatrix *matrix, int x,int y, int num,int *px,int *py,int *t, int fill,unsigned int color, unsigned char m,int width, struct FrameBufferDash *dash, struct FrameBufferClip *clip);
Header
base/rfbuffer.h
Library
rfbuf
Description

The FrameBufferPolygon function plots a polygon.

The argument ptr is a pointer to the frame buffer. The argument matrix is an optional transformation matrix that can be applied to the polygon. If this is set to a NULL pointer then no transformation is applied. The position at which the polygon is plotted is given by the arguments x, and y.

The number of vertices of the polygon is given by the argument num. The arrays containing the X and Y coordinates of each vertex are pointed to by the arguments x and y.

A polygon can be constructed from straight line segments or bezier curves. The array pointed to by the argument t determines what kind of line segment is used to join to a vertex. If the corresponding entry in the array equals zero, then the segment between the current point and the next point is a straight line; if the entry is (1) then the connecting segment is a bezier curve and the next two vertices are the control points, the curve connects to the third point.

If the argument fill is set to a non-zero value then the polygon will be plotted as solid shape, not an outline.

The color used to plot the polygon is given by the color which is a 32-bit number that represents the alpha,red,green and blue components of the color as 8-bit number. The alpha channel occupies the most significant bits and the blue channel occupies the least significant bits. The argument m defines which color channels are active. Setting this argument to (0x0f) will output the color to all four channels. The most significant bit controls the alpha channel and the least significant bit controls the blue channel.

The width of the line used to plot the polygon is controlled using the argument width, a value of zero will plot a hairline. The dot-dash pattern used to plot the polygon is given by dash. If this is set to a NULL pointer, a solid line is plotted.

The clipping polygon is given by the argument clip. If this is set to a NULL pointer, no clipping is performed.

Returns
Returns zero on success. On error, (-1) is returned.
Errors
Returns zero on success. On error, (-1) is returned.
Example
None