Tscope5
primitives.c File Reference

Definitions of primitives drawing functions. More...

Go to the source code of this file.

Functions

Primitives drawing functions

The drawing functions all take the smallest possible number of parameters to put something on the screen: some coordinates.

Drawing parameters are set with the graphics parameter functions.

void ts5_draw_pixel (double x, double y)
 Draw a pixel. More...
 
TS5_COLOR ts5_get_pixel_color (double x, double y)
 Get the color of a pixel. More...
 
void ts5_draw_line (double x1, double y1, double x2, double y2)
 Draw a line segment. More...
 
void ts5_draw_rectangle (double x1, double y1, double x2, double y2)
 Draw a rectangle. More...
 
void ts5_draw_rounded_rectangle (double x1, double y1, double x2, double y2, double rx, double ry)
 Draw a rounded rectangle. More...
 
void ts5_draw_triangle (double x1, double y1, double x2, double y2, double x3, double y3)
 Draw a triangle. More...
 
void ts5_draw_circle (double cx, double cy, double r)
 Draw a circle. More...
 
void ts5_draw_ellipse (double cx, double cy, double rx, double ry)
 Draw an ellipse. More...
 
void ts5_draw_arc (double cx, double cy, double r, double start, double delta)
 Draw an arc. More...
 

Detailed Description

Definitions of primitives drawing functions.

Definition in file primitives.c.

Function Documentation

void ts5_draw_pixel ( double  x,
double  y 
)

Draw a pixel.

Parameters
xHorizontal position of the pixel.
yVertical position of the pixel.
Examples:
display06.c, primitives01.c, primitives02.c, primitives03.c, and primitives04.c.

Definition at line 43 of file primitives.c.

TS5_COLOR ts5_get_pixel_color ( double  x,
double  y 
)

Get the color of a pixel.

Parameters
xHorizontal position of the pixel.
yVertical position of the pixel.

Return value: TS5_COLOR structure.

Definition at line 84 of file primitives.c.

void ts5_draw_line ( double  x1,
double  y1,
double  x2,
double  y2 
)

Draw a line segment.

Parameters
x1Horizontal position of the start point of the line segment.
y1Vertical position of the start point of the line segment.
x2Horizontal position of the end point of the line segment.
y2Vertical position of the end point of the line segment.
Examples:
display06.c, primitives01.c, primitives02.c, primitives03.c, primitives04.c, and textio01.c.

Definition at line 116 of file primitives.c.

void ts5_draw_rectangle ( double  x1,
double  y1,
double  x2,
double  y2 
)

Draw a rectangle.

Parameters
x1Horizontal position of the first corner of the rectangle.
y1Vertical position of the first corner of the rectangle.
x2Horizontal position of the second corner of the rectangle.
y2Vertical position of the second corner of the rectangle.
Examples:
display06.c, graphics05.c, mouse02.c, primitives01.c, primitives02.c, primitives03.c, and primitives04.c.

Definition at line 156 of file primitives.c.

void ts5_draw_rounded_rectangle ( double  x1,
double  y1,
double  x2,
double  y2,
double  rx,
double  ry 
)

Draw a rounded rectangle.

Parameters
x1Horizontal position of the first corner of the rectangle.
y1Vertical position of the first corner of the rectangle.
x2Horizontal position of the second corner of the rectangle.
y2Vertical position of the second corner of the rectangle.
rxHorizontal radius of the round.
ryVertical radius of the round.
Examples:
display06.c, primitives01.c, primitives02.c, primitives03.c, and primitives04.c.

Definition at line 206 of file primitives.c.

void ts5_draw_triangle ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
)

Draw a triangle.

Parameters
x1Horizontal position of the first corner of the triangle.
y1Vertical position of the first corner of the triangle.
x2Horizontal position of the second corner of the triangle.
y2Vertical position of the second corner of the triangle.
x3Horizontal position of the third corner of the triangle.
y3Vertical position of the third corner of the triangle.
Examples:
display06.c, primitives01.c, primitives02.c, primitives03.c, and primitives04.c.

Definition at line 285 of file primitives.c.

void ts5_draw_circle ( double  cx,
double  cy,
double  r 
)

Draw a circle.

Parameters
cxHorizontal position of the center of the circle.
cyVertical position of the center of the circle.
rRadius of the circle.
Examples:
bitmaps05.c, display06.c, graphics01.c, graphics02.c, graphics03.c, graphics04.c, graphics06.c, graphics07.c, graphics08.c, graphics09.c, primitives01.c, primitives02.c, primitives03.c, and primitives04.c.

Definition at line 339 of file primitives.c.

void ts5_draw_ellipse ( double  cx,
double  cy,
double  rx,
double  ry 
)

Draw an ellipse.

Parameters
cxHorizontal position of the center of the ellipse.
cyVertical position of the center of the ellipse.
rxHorizontal radius of the ellipse.
ryVertical radius of the ellipse.
Examples:
display06.c, primitives01.c, primitives02.c, primitives03.c, and primitives04.c.

Definition at line 381 of file primitives.c.

void ts5_draw_arc ( double  cx,
double  cy,
double  r,
double  start,
double  delta 
)

Draw an arc.

Parameters
cxHorizontal position of the center of the arc.
cyVertical position of the center of the arc.
rRadius of the arc.
startThe initial angle of the arc (0.0 = west, 90.0 = north, ...).
deltaSpan of the arc (positive is counter clockwise, negative is clockwise).
Examples:
display06.c, primitives01.c, primitives02.c, primitives03.c, and primitives04.c.

Definition at line 428 of file primitives.c.