void Graphics_initContext | ( | Graphics_Context * | context, |
const Graphics_Display * | display | ||
) |
Initializes a drawing context.
context | is a pointer to the drawing context to initialize. |
display | is 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.
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.
context | is a pointer to the drawing context to use. |
rect | is 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.
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.
context | is a pointer to the drawing context to modify. |
value | is 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.
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.
context | is a pointer to the drawing context to modify. |
value | is 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()).
References Graphics_Context::background.
void Graphics_setFont | ( | Graphics_Context * | context, |
const Graphics_Font * | font | ||
) |
Sets the font to be used.
context | is a pointer to the drawing context to modify. |
font | is 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.
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.
font | is 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'').
References Graphics_Font::baseline.
void Graphics_setForegroundColor | ( | Graphics_Context * | context, |
int32_t | value | ||
) |
Sets the foreground color to be used.
context | is a pointer to the drawing context to modify. |
value | is the 24-bit RGB color to be used. |
This function sets the color to be used for drawing operations in the specified drawing context.
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.
context | is a pointer to the drawing context to modify. |
value | is 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()).
References Graphics_Context::foreground.
uint8_t Graphics_getFontHeight | ( | const Graphics_Font * | font | ) |
Gets the height of a font.
font | is 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.
References Graphics_Font::height.
uint8_t Graphics_getFontMaxWidth | ( | const Graphics_Font * | font | ) |
Gets the maximum width of a font.
font | is 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.
References Graphics_Font::maxWidth.
uint16_t Graphics_getDisplayWidth | ( | Graphics_Context * | context | ) |
Gets the width of the display being used by this drawing context.
context | is a pointer to the drawing context to query. |
This function returns the width of the display that is being used by this drawing context.
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.
context | is a pointer to the drawing context to query. |
This function returns the height of the display that is being used by this drawing context.
References Graphics_Context::display, and Graphics_Display::heigth.
uint16_t Graphics_getHeightOfDisplay | ( | const Graphics_Display * | display | ) |
Gets the height of the display.
display | is a pointer to the display driver structure for the display to query. |
This function determines the height of the display.
References Graphics_Display::heigth.
Referenced by Graphics_setClipRegion().
void Graphics_flushBuffer | ( | const Graphics_Context * | context | ) |
Flushes any cached drawing operations.
context | is 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.
References Graphics_Context::display, and Graphics_flushOnDisplay().
void Graphics_clearDisplay | ( | const Graphics_Context * | context | ) |
Forces a clear screen. Contents of Display buffer unmodified
context | is a pointer to the drawing context to use. |
This function forces a clear screen.
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.
context | is a pointer to the drawing context to use. |
x | is the X coordinate of the pixel. |
y | is the Y coordinate of the pixel. |
This function draws a pixel if it resides within the clipping region.
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.
display | is a pointer to the display driver structure for the display to query. |
This function determines the width of the display.
References Graphics_Display::width.
Referenced by Graphics_setClipRegion().