libcucul primitives drawing


Functions

void cucul_draw_line (cucul_canvas_t *, int, int, int, int, char const *)
 Draw a line on the canvas using the given character.
void cucul_draw_polyline (cucul_canvas_t *, int const x[], int const y[], int, char const *)
 Draw a polyline.
void cucul_draw_thin_line (cucul_canvas_t *, int, int, int, int)
 Draw a thin line on the canvas, using ASCII art.
void cucul_draw_thin_polyline (cucul_canvas_t *, int const x[], int const y[], int)
 Draw an ASCII art thin polyline.
void cucul_draw_circle (cucul_canvas_t *, int, int, int, char const *)
 Draw a circle on the canvas using the given character.
void cucul_draw_ellipse (cucul_canvas_t *, int, int, int, int, char const *)
 Draw an ellipse on the canvas using the given character.
void cucul_draw_thin_ellipse (cucul_canvas_t *, int, int, int, int)
 Draw a thin ellipse on the canvas.
void cucul_fill_ellipse (cucul_canvas_t *, int, int, int, int, char const *)
 Fill an ellipse on the canvas using the given character.
void cucul_draw_box (cucul_canvas_t *, int, int, int, int, char const *)
 Draw a box on the canvas using the given character.
void cucul_draw_thin_box (cucul_canvas_t *, int, int, int, int)
 Draw a thin box on the canvas.
void cucul_fill_box (cucul_canvas_t *, int, int, int, int, char const *)
 Fill a box on the canvas using the given character.
void cucul_draw_triangle (cucul_canvas_t *, int, int, int, int, int, int, char const *)
 Draw a triangle on the canvas using the given character.
void cucul_draw_thin_triangle (cucul_canvas_t *, int, int, int, int, int, int)
 Draw a thin triangle on the canvas.
void cucul_fill_triangle (cucul_canvas_t *, int, int, int, int, int, int, char const *)
 Fill a triangle on the canvas using the given character.

Detailed Description

These functions provide routines for primitive drawing, such as lines, boxes, triangles and ellipses.

Function Documentation

void cucul_draw_line cucul_canvas_t cv,
int  x1,
int  y1,
int  x2,
int  y2,
char const *  str
 

Parameters:
cv The handle to the libcucul canvas.
x1 X coordinate of the first point.
y1 Y coordinate of the first point.
x2 X coordinate of the second point.
y2 Y coordinate of the second point.
str UTF-8 string containing the character to use to draw the line.
Returns:
void

void cucul_draw_polyline cucul_canvas_t cv,
int const   x[],
int const   y[],
int  n,
char const *  str
 

Draw a plyline on the canvas using the given character and coordinate arrays. The first and last points are not connected, hence in order to draw a polygon you need to specify the starting point at the end of the list as well.

Parameters:
cv The handle to the libcucul canvas.
x Array of X coordinates. Must have n + 1 elements.
y Array of Y coordinates. Must have n + 1 elements.
n Number of lines to draw.
str UTF-8 string containing the character to use to draw the lines.
Returns:
void

void cucul_draw_thin_line cucul_canvas_t cv,
int  x1,
int  y1,
int  x2,
int  y2
 

Parameters:
cv The handle to the libcucul canvas.
x1 X coordinate of the first point.
y1 Y coordinate of the first point.
x2 X coordinate of the second point.
y2 Y coordinate of the second point.
Returns:
void

void cucul_draw_thin_polyline cucul_canvas_t cv,
int const   x[],
int const   y[],
int  n
 

Draw a thin polyline on the canvas using the given coordinate arrays and with ASCII art. The first and last points are not connected, so in order to draw a polygon you need to specify the starting point at the end of the list as well.

Parameters:
cv The handle to the libcucul canvas.
x Array of X coordinates. Must have n + 1 elements.
y Array of Y coordinates. Must have n + 1 elements.
n Number of lines to draw.
Returns:
void

void cucul_draw_circle cucul_canvas_t cv,
int  x,
int  y,
int  r,
char const *  str
 

Parameters:
cv The handle to the libcucul canvas.
x Center X coordinate.
y Center Y coordinate.
r Circle radius.
str UTF-8 string representing the character that should be used to draw the circle outline.
Returns:
void

void cucul_draw_ellipse cucul_canvas_t cv,
int  xo,
int  yo,
int  a,
int  b,
char const *  str
 

Parameters:
cv The handle to the libcucul canvas.
xo Center X coordinate.
yo Center Y coordinate.
a Ellipse X radius.
b Ellipse Y radius.
str UTF-8 string representing the character that should be used to draw the ellipse outline.
Returns:
void

void cucul_draw_thin_ellipse cucul_canvas_t cv,
int  xo,
int  yo,
int  a,
int  b
 

Parameters:
cv The handle to the libcucul canvas.
xo Center X coordinate.
yo Center Y coordinate.
a Ellipse X radius.
b Ellipse Y radius.
Returns:
void

void cucul_fill_ellipse cucul_canvas_t cv,
int  xo,
int  yo,
int  a,
int  b,
char const *  str
 

Parameters:
cv The handle to the libcucul canvas.
xo Center X coordinate.
yo Center Y coordinate.
a Ellipse X radius.
b Ellipse Y radius.
str UTF-8 string representing the character that should be used to fill the ellipse.
Returns:
void

void cucul_draw_box cucul_canvas_t cv,
int  x1,
int  y1,
int  x2,
int  y2,
char const *  str
 

Parameters:
cv The handle to the libcucul canvas.
x1 X coordinate of the upper-left corner of the box.
y1 Y coordinate of the upper-left corner of the box.
x2 X coordinate of the lower-right corner of the box.
y2 Y coordinate of the lower-right corner of the box.
str UTF-8 string containing the character to use to draw the box.
Returns:
void

void cucul_draw_thin_box cucul_canvas_t cv,
int  x1,
int  y1,
int  x2,
int  y2
 

Parameters:
cv The handle to the libcucul canvas.
x1 X coordinate of the upper-left corner of the box.
y1 Y coordinate of the upper-left corner of the box.
x2 X coordinate of the lower-right corner of the box.
y2 Y coordinate of the lower-right corner of the box.
Returns:
void

void cucul_fill_box cucul_canvas_t cv,
int  x1,
int  y1,
int  x2,
int  y2,
char const *  str
 

Parameters:
cv The handle to the libcucul canvas.
x1 X coordinate of the upper-left corner of the box.
y1 Y coordinate of the upper-left corner of the box.
x2 X coordinate of the lower-right corner of the box.
y2 Y coordinate of the lower-right corner of the box.
str UTF-8 string containing the character to fill the box with.
Returns:
void

void cucul_draw_triangle cucul_canvas_t cv,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3,
char const *  str
 

Parameters:
cv The handle to the libcucul canvas.
x1 X coordinate of the first point.
y1 Y coordinate of the first point.
x2 X coordinate of the second point.
y2 Y coordinate of the second point.
x3 X coordinate of the third point.
y3 Y coordinate of the third point.
str UTF-8 string representing the character that should be used to draw the triangle outline.
Returns:
void

void cucul_draw_thin_triangle cucul_canvas_t cv,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3
 

Parameters:
cv The handle to the libcucul canvas.
x1 X coordinate of the first point.
y1 Y coordinate of the first point.
x2 X coordinate of the second point.
y2 Y coordinate of the second point.
x3 X coordinate of the third point.
y3 Y coordinate of the third point.
Returns:
void

void cucul_fill_triangle cucul_canvas_t cv,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3,
char const *  str
 

Parameters:
cv The handle to the libcucul canvas.
x1 X coordinate of the first point.
y1 Y coordinate of the first point.
x2 X coordinate of the second point.
y2 Y coordinate of the second point.
x3 X coordinate of the third point.
y3 Y coordinate of the third point.
str UTF-8 string representing the character that should be used to fill the triangle.
Returns:
void