Functions
Context_api

Functions

void Graphics_initContext (Graphics_Context *context, const Graphics_Display *display)
 
void Graphics_setClipRegion (Graphics_Context *context, Graphics_Rectangle *rect)
 
void Graphics_setBackgroundColor (Graphics_Context *context, int32_t value)
 
void Graphics_setBackgroundColorTranslated (Graphics_Context *context, int32_t value)
 
void Graphics_setFont (Graphics_Context *context, const Graphics_Font *font)
 
uint8_t Graphics_getFontBaseline (const Graphics_Font *font)
 
void Graphics_setForegroundColor (Graphics_Context *context, int32_t value)
 
void Graphics_setForegroundColorTranslated (Graphics_Context *context, int32_t value)
 
uint8_t Graphics_getFontHeight (const Graphics_Font *font)
 
uint8_t Graphics_getFontMaxWidth (const Graphics_Font *font)
 
uint16_t Graphics_getDisplayWidth (Graphics_Context *context)
 
uint16_t Graphics_getDisplayHeight (Graphics_Context *context)
 
uint16_t Graphics_getHeightOfDisplay (const Graphics_Display *display)
 
void Graphics_flushBuffer (const Graphics_Context *context)
 
void Graphics_clearDisplay (const Graphics_Context *context)
 
void Graphics_drawPixel (const Graphics_Context *context, uint16_t x, uint16_t y)
 
uint16_t Graphics_getWidthOfDisplay (const Graphics_Display *display)
 

Detailed Description

Function Documentation

void Graphics_initContext ( Graphics_Context context,
const Graphics_Display display 
)

Initializes a drawing context.

Parameters
contextis a pointer to the drawing context to initialize.
displayis a pointer to the Graphics_Display Info structure that describes the display driver to use.

This function initializes a drawing context, preparing it for use. The provided display driver will be used for all subsequent graphics operations, and the default clipping region will be set to the extent of the screen.

Returns
None.

References Graphics_Context::background, Graphics_Context::clipRegion, Graphics_Context::display, Graphics_Context::font, Graphics_Context::foreground, Graphics_Display::heigth, Graphics_Context::size, Graphics_Display::width, Graphics_Rectangle::xMax, Graphics_Rectangle::xMin, Graphics_Rectangle::yMax, and Graphics_Rectangle::yMin.

void Graphics_setClipRegion ( Graphics_Context context,
Graphics_Rectangle rect 
)

Sets the extents of the clipping region.

Parameters
contextis a pointer to the drawing context to use.
rectis a pointer to the structure containing the extents of the clipping region.

This function sets the extents of the clipping region. The clipping region is not allowed to exceed the extents of the screen, but may be a portion of the screen.

The supplied coordinate are inclusive; xMin of 1 and xMax of 1 will define a clipping region that will display only the pixels in the X = 1 column. A consequence of this is that the clipping region must contain at least one row and one column.

Returns
None.

References Graphics_Context::clipRegion, Graphics_Context::display, Graphics_getHeightOfDisplay(), Graphics_getWidthOfDisplay(), Graphics_Rectangle::xMax, Graphics_Rectangle::xMin, Graphics_Rectangle::yMax, and Graphics_Rectangle::yMin.

void Graphics_setBackgroundColor ( Graphics_Context context,
int32_t  value 
)

Sets the background color to be used.

Parameters
contextis a pointer to the drawing context to modify.
valueis the 24-bit RGB color to be used.

This function sets the background color to be used for drawing operations in the specified drawing context.

Returns
None.

References Graphics_Context::background, Graphics_Context::display, and Graphics_translateColorOnDisplay().

void Graphics_setBackgroundColorTranslated ( Graphics_Context context,
int32_t  value 
)

Sets the background color to be used.

Parameters
contextis a pointer to the drawing context to modify.
valueis the display driver-specific color to be used.

This function sets the background color to be used for drawing operations in the specified drawing context, using a color that has been previously translated to a driver-specific color (for example, via Graphics_translateColorDisplay()).

Returns
None.

References Graphics_Context::background.

void Graphics_setFont ( Graphics_Context context,
const Graphics_Font font 
)

Sets the font to be used.

Parameters
contextis a pointer to the drawing context to modify.
fontis a pointer to the font to be used.

This function sets the font to be used for string drawing operations in the specified drawing context. If a tFontEx type font is to be used, cast its pointer to a font pointer before passing it as the font parameter.

Returns
None.

References Graphics_Context::font.

Referenced by Graphics_drawCheckBox(), Graphics_drawImageButton(), Graphics_drawRadioButton(), Graphics_drawReleasedImageButton(), Graphics_drawSelectedImageButton(), and Graphics_drawSelectedRadioButton().

uint8_t Graphics_getFontBaseline ( const Graphics_Font font)

Gets the baseline of a font.

Parameters
fontis a pointer to the font to query.

This function determines the baseline position of a font. The baseline is the offset between the top of the font and the bottom of the capital letters. The only font data that exists below the baseline are the descenders on some lower-case letters (such as ``y'').

Returns
Returns the baseline of the font, in pixels.

References Graphics_Font::baseline.

void Graphics_setForegroundColor ( Graphics_Context context,
int32_t  value 
)

Sets the foreground color to be used.

Parameters
contextis a pointer to the drawing context to modify.
valueis the 24-bit RGB color to be used.

This function sets the color to be used for drawing operations in the specified drawing context.

Returns
None.

References Graphics_Context::display, Graphics_Context::foreground, and Graphics_translateColorOnDisplay().

Referenced by Graphics_drawCheckBox(), Graphics_drawImageButton(), Graphics_drawRadioButton(), Graphics_drawReleasedCheckBox(), Graphics_drawReleasedImageButton(), Graphics_drawReleasedRadioButton(), Graphics_drawSelectedCheckBox(), Graphics_drawSelectedImageButton(), and Graphics_drawSelectedRadioButton().

void Graphics_setForegroundColorTranslated ( Graphics_Context context,
int32_t  value 
)

Sets the foreground color to be used.

Parameters
contextis a pointer to the drawing context to modify.
valueis the display driver-specific color to be used.

This function sets the foreground color to be used for drawing operations in the specified drawing context, using a color that has been previously translated to a driver-specific color (for example, via Graphics_translateColorDisplay()).

Returns
None.

References Graphics_Context::foreground.

uint8_t Graphics_getFontHeight ( const Graphics_Font font)

Gets the height of a font.

Parameters
fontis a pointer to the font to query.

This function determines the height of a font. The height is the offset between the top of the font and the bottom of the font, including any ascenders and descenders.

Returns
Returns the height of the font, in pixels.

References Graphics_Font::height.

uint8_t Graphics_getFontMaxWidth ( const Graphics_Font font)

Gets the maximum width of a font.

Parameters
fontis a pointer to the font to query.

This function determines the maximum width of a font. The maximum width is the width of the widest individual character in the font.

Returns
Returns the maximum width of the font, in pixels.

References Graphics_Font::maxWidth.

uint16_t Graphics_getDisplayWidth ( Graphics_Context context)

Gets the width of the display being used by this drawing context.

Parameters
contextis a pointer to the drawing context to query.

This function returns the width of the display that is being used by this drawing context.

Returns
Returns the width of the display in pixels.

References Graphics_Context::display, and Graphics_Display::width.

uint16_t Graphics_getDisplayHeight ( Graphics_Context context)

Gets the height of the display being used by this drawing context.

Parameters
contextis a pointer to the drawing context to query.

This function returns the height of the display that is being used by this drawing context.

Returns
Returns the height of the display in pixels.

References Graphics_Context::display, and Graphics_Display::heigth.

uint16_t Graphics_getHeightOfDisplay ( const Graphics_Display display)

Gets the height of the display.

Parameters
displayis a pointer to the display driver structure for the display to query.

This function determines the height of the display.

Returns
Returns the height of the display in pixels.

References Graphics_Display::heigth.

Referenced by Graphics_setClipRegion().

void Graphics_flushBuffer ( const Graphics_Context context)

Flushes any cached drawing operations.

Parameters
contextis a pointer to the drawing context to use.

This function flushes any cached drawing operations. For display drivers that draw into a local frame buffer before writing to the actual display, calling this function will cause the display to be updated to match the contents of the local frame buffer.

Returns
None.

References Graphics_Context::display, and Graphics_flushOnDisplay().

void Graphics_clearDisplay ( const Graphics_Context context)

Forces a clear screen. Contents of Display buffer unmodified

Parameters
contextis a pointer to the drawing context to use.

This function forces a clear screen.

Returns
None.

References Graphics_Context::background, Graphics_Context::display, and Graphics_clearDisplayOnDisplay().

void Graphics_drawPixel ( const Graphics_Context context,
uint16_t  x,
uint16_t  y 
)

Draws a pixel.

Parameters
contextis a pointer to the drawing context to use.
xis the X coordinate of the pixel.
yis the Y coordinate of the pixel.

This function draws a pixel if it resides within the clipping region.

Returns
None.

References Graphics_Context::clipRegion, Graphics_Context::display, Graphics_Context::foreground, Graphics_drawPixelOnDisplay(), Graphics_Rectangle::xMin, and Graphics_Rectangle::yMin.

Referenced by Graphics_drawCircle().

uint16_t Graphics_getWidthOfDisplay ( const Graphics_Display display)

Gets the width of the display.

Parameters
displayis a pointer to the display driver structure for the display to query.

This function determines the width of the display.

Returns
Returns the width of the display in pixels.

References Graphics_Display::width.

Referenced by Graphics_setClipRegion().


Copyright 2016, Texas Instruments Incorporated