Functions
Line_api

Functions

void Graphics_drawLineH (const Graphics_Context *context, int32_t x1, int32_t x2, int32_t y)
 
void Graphics_drawLineV (const Graphics_Context *context, int32_t x, int32_t y1, int32_t y2)
 
void Graphics_drawLine (const Graphics_Context *context, int32_t x1, int32_t y1, int32_t x2, int32_t y2)
 

Detailed Description

Function Documentation

void Graphics_drawLineH ( const Graphics_Context context,
int32_t  x1,
int32_t  x2,
int32_t  y 
)

Draws a horizontal line.

Parameters
contextis a pointer to the drawing context to use.
x1is the X coordinate of one end of the line.
x2is the X coordinate of the other end of the line.
yis the Y coordinate of the line.

This function draws a horizontal line, taking advantage of the fact that the line is horizontal to draw it more efficiently. The clipping of the horizontal line to the clipping rectangle is performed within this routine; the display driver's horizontal line routine is used to perform the actual line drawing.

Returns
None.

References Graphics_Context::clipRegion, Graphics_Context::display, Graphics_Context::foreground, Graphics_drawHorizontalLineOnDisplay(), Graphics_Rectangle::xMax, Graphics_Rectangle::xMin, and Graphics_Rectangle::yMax.

Referenced by Graphics_drawLine(), Graphics_drawRectangle(), Graphics_drawString(), and Graphics_fillCircle().

void Graphics_drawLineV ( const Graphics_Context context,
int32_t  x,
int32_t  y1,
int32_t  y2 
)

Draws a vertical line.

Parameters
contextis a pointer to the drawing context to use.
xis the X coordinate of the line.
y1is the Y coordinate of one end of the line.
y2is the Y coordinate of the other end of the line.

This function draws a vertical line, taking advantage of the fact that the line is vertical to draw it more efficiently. The clipping of the vertical line to the clipping rectangle is performed within this routine; the display driver's vertical line routine is used to perform the actual line drawing.

Returns
None.

References Graphics_Context::clipRegion, Graphics_Context::display, Graphics_Context::foreground, Graphics_drawVerticalLineOnDisplay(), Graphics_Rectangle::xMax, Graphics_Rectangle::yMax, and Graphics_Rectangle::yMin.

Referenced by Graphics_drawLine(), and Graphics_drawRectangle().

void Graphics_drawLine ( const Graphics_Context context,
int32_t  x1,
int32_t  y1,
int32_t  x2,
int32_t  y2 
)

Draws a line.

Parameters
contextis a pointer to the drawing context to use.
x1is the X coordinate of the start of the line.
y1is the Y coordinate of the start of the line.
x2is the X coordinate of the end of the line.
y2is the Y coordinate of the end of the line.

This function draws a line, utilizing Graphics_drawLineH() and Graphics_drawLineV() to draw the line as efficiently as possible. The line is clipped to the clippping rectangle using the Cohen-Sutherland clipping algorithm, and then scan converted using Bresenham's line drawing algorithm.

Returns
None.

References Graphics_Context::display, Graphics_Context::foreground, Graphics_drawLineH(), Graphics_drawLineV(), and Graphics_drawPixelOnDisplay().

Referenced by Graphics_drawCheckBox(), and Graphics_drawSelectedCheckBox().


Copyright 2016, Texas Instruments Incorporated