Line collection manipulation.
[Geometry.]


Functions

XY_linesXY_new_lines (void)
 Create a new line collection.
XY_linesXY_duplicate_lines (XY_lines *lines)
 Duplicates a collection.
XY_bool XY_free_lines (XY_lines *lines)
 Free a line collection.
XY_bool XY_start_lines (XY_lines *lines)
 Reset a line collection so that it contains no lines.
XY_bool XY_add_line (XY_lines *lines, XY_fixed x1, XY_fixed y1, XY_fixed x2, XY_fixed y2, XY_color color, XY_fixed thickness)
 Add a line to a line collection.
XY_bool XY_translate_lines (XY_lines *lines, XY_fixed x, XY_fixed y)
 Translate all lines within a collection.
XY_bool XY_scale_lines (XY_lines *lines, XY_fixed xscale, XY_fixed yscale)
 Scale all lines within a collection (centered around the origin (0,0)).
XY_bool XY_rotate_lines (XY_lines *lines, int angle)
 Rotate all lines within a collection (centered around the origin (0,0)).

Function Documentation

XY_lines* XY_new_lines ( void   ) 

Create a new line collection.

Returns:
a new XY_lines pointer, with no lines.

XY_lines* XY_duplicate_lines ( XY_lines lines  ) 

Duplicates a collection.

Parameters:
lines is an XY_lines pointer from which you want to copy.
Returns:
a pointer to a new XY_lines with all lines from 'lines' copied to it on success, or NULL on failure, and sets error code to one of the following:

XY_bool XY_free_lines ( XY_lines lines  ) 

Free a line collection.

Parameters:
lines is an XY_lines pointer to free. (Do not use the pointer any more! You may reuse your variable, if you create a new bitmap, of course.)
Returns:
On success: XY_TRUE. On failure, XY_FALSE, and sets error code to one of the following:

XY_bool XY_start_lines ( XY_lines lines  ) 

Reset a line collection so that it contains no lines.

This allows you to reconstruct a line collection (without making a new one) at different times (e.g., at the start of a new frame).

Parameters:
lines is an XY_lines pointer to reset.
Returns:
On success: XY_TRUE. On failure, XY_FALSE, and sets error code to one of the following:

XY_bool XY_add_line ( XY_lines lines,
XY_fixed  x1,
XY_fixed  y1,
XY_fixed  x2,
XY_fixed  y2,
XY_color  color,
XY_fixed  thickness 
)

Add a line to a line collection.

Parameters:
lines is an XY_lines pointer to add a line to.
x1 is the X coordinate of the new line's starting point.
y1 is the Y coordinate of the new line's starting point.
x2 is the X coordinate of the new line's ending point.
y2 is the Y coordinate of the new line's ending point.
color is an XY_color representing the color and transparency of the new line.
thickness is an XY_fixed representing the thickness of the new line.
Returns:
On success: XY_TRUE. On failure, XY_FALSE, and sets error code to one of the following:

XY_bool XY_translate_lines ( XY_lines lines,
XY_fixed  x,
XY_fixed  y 
)

Translate all lines within a collection.

Parameters:
lines is an XY_lines pointer containing a collection of lines to translate.
x is the offset (positive for right, negative for left) by which to translate all of the lines horizontally.
y is the offset (positive for down, negative for up) by which to translate all of the lines vertically.
Returns:
On success: XY_TRUE. On failure, XY_FALSE, and sets error code to one of the following:

XY_bool XY_scale_lines ( XY_lines lines,
XY_fixed  xscale,
XY_fixed  yscale 
)

Scale all lines within a collection (centered around the origin (0,0)).

Parameters:
lines is an XY_lines pointer containing a collection of lines to scale.
xscale is the scale to change all of the lines' X coordinates.
yscale is the scale to change all of the lines' Y coordinates.
Returns:
On success: XY_TRUE. On failure, XY_FALSE, and sets error code to one of the following:

XY_bool XY_rotate_lines ( XY_lines lines,
int  angle 
)

Rotate all lines within a collection (centered around the origin (0,0)).

Parameters:
lines is an XY_lines pointer containing a collection of lines to scale.
angle is angle (in degrees) to rotate each line in the collection.
Returns:
On success: XY_TRUE. On failure, XY_FALSE, and sets error code to one of the following:
Todo:
Implement line rotation


Generated on Sat Aug 16 22:15:09 2008 for libcrtxy by  doxygen 1.5.5