![]() |
µGFX
2.9
version 2.9
|
Module to interface graphic / pixel oriented displays.
The GDISP module provides high level abstraction to interface pixel oriented graphic displays.
Data Structures | |
struct | gPoint |
Type for a 2D point on the screen. More... | |
Modules | |
Colors | |
Sub-Module for color handling. | |
Image | |
Sub-Module for image handling. | |
Pixmap | |
Sub-Module for dynamic framebuffers. | |
Functions | |
gColor | gdispBlendColor (gColor fg, gColor bg, gU8 alpha) |
Blend 2 colors according to the alpha. More... | |
gColor | gdispContrastColor (gColor color) |
Find a contrasting color. More... | |
GDisplay * | gdispGetDisplay (unsigned display) |
Get the specified display. More... | |
void | gdispSetDisplay (GDisplay *g) |
Set the current default display to the specified display. More... | |
unsigned | gdispGetDisplayCount (void) |
Get the count of currently active displays. More... | |
gCoord | gdispGGetWidth (GDisplay *g) |
Get the display width in pixels. More... | |
gCoord | gdispGGetHeight (GDisplay *g) |
Get the display height in pixels. More... | |
gPowermode | gdispGGetPowerMode (GDisplay *g) |
Get the current display power mode. More... | |
gOrientation | gdispGGetOrientation (GDisplay *g) |
Get the current display orientation. More... | |
gU8 | gdispGGetBacklight (GDisplay *g) |
Get the current display backlight brightness. More... | |
gU8 | gdispGGetContrast (GDisplay *g) |
Get the current display contrast. More... | |
void | gdispGFlush (GDisplay *g) |
Flush current drawing operations to the display. More... | |
void | gdispGClear (GDisplay *g, gColor color) |
Clear the display to the specified color. More... | |
void | gdispGDrawPixel (GDisplay *g, gCoord x, gCoord y, gColor color) |
Set a pixel in the specified color. More... | |
void | gdispGDrawLine (GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color) |
Draw a line. More... | |
void | gdispGFillArea (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color) |
Fill an area with a color. More... | |
void | gdispGBlitArea (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord srcx, gCoord srcy, gCoord srccx, const gPixel *buffer) |
Fill an area using the supplied bitmap. More... | |
void | gdispGDrawBox (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color) |
Draw a rectangular box. More... | |
void | gdispGStreamStart (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy) |
Start a streaming operation. More... | |
void | gdispGStreamColor (GDisplay *g, gColor color) |
Send pixel data to the stream. More... | |
void | gdispGStreamStop (GDisplay *g) |
Finish the current streaming operation. More... | |
void | gdispGSetClip (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy) |
Clip all drawing to the defined area. More... | |
void | gdispGDrawCircle (GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color) |
Draw a circle. More... | |
void | gdispGFillCircle (GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color) |
Draw a filled circle. More... | |
void | gdispGFillDualCircle (GDisplay *g, gCoord x, gCoord y, gCoord radius1, gColor color1, gCoord radius2, gColor color2) |
Draw two filled circles with the same centre. More... | |
void | gdispGDrawEllipse (GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) |
Draw an ellipse. More... | |
void | gdispGFillEllipse (GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) |
Draw a filled ellipse. More... | |
void | gdispGDrawArcSectors (GDisplay *g, gCoord x, gCoord y, gCoord radius, gU8 sectors, gColor color) |
Draw a selection of 45 degree arcs of a circle. More... | |
void | gdispGFillArcSectors (GDisplay *g, gCoord x, gCoord y, gCoord radius, gU8 sectors, gColor color) |
Fill a selection of 45 degree arcs of a circle. More... | |
void | gdispGDrawArc (GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, gColor color) |
Draw an arc. More... | |
void | gdispGDrawThickArc (GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, gColor color) |
Draw a thick arc. More... | |
void | gdispGFillArc (GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, gColor color) |
Draw a filled arc. More... | |
gColor | gdispGGetPixelColor (GDisplay *g, gCoord x, gCoord y) |
Get the color of a pixel. More... | |
void | gdispGVerticalScroll (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, gColor bgcolor) |
Scroll vertically a section of the screen. More... | |
void | gdispGControl (GDisplay *g, unsigned what, void *value) |
Control hardware specific parts of the display. eg powermodes, backlight etc. More... | |
void * | gdispGQuery (GDisplay *g, unsigned what) |
Query a property of the display. More... | |
void | gdispGDrawPoly (GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color) |
Draw an enclosed polygon (convex, non-convex or complex). More... | |
void | gdispGFillConvexPoly (GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color) |
Fill a convex polygon. More... | |
void | gdispGDrawThickLine (GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color, gCoord width, gBool round) |
Draw a line with a specified thickness. More... | |
void | gdispGDrawChar (GDisplay *g, gCoord x, gCoord y, gU16 c, gFont font, gColor color) |
Draw a text character. More... | |
void | gdispGFillChar (GDisplay *g, gCoord x, gCoord y, gU16 c, gFont font, gColor color, gColor bgcolor) |
Draw a text character with a filled background. More... | |
void | gdispGDrawString (GDisplay *g, gCoord x, gCoord y, const char *str, gFont font, gColor color) |
Draw a text string. More... | |
void | gdispGFillString (GDisplay *g, gCoord x, gCoord y, const char *str, gFont font, gColor color, gColor bgcolor) |
Draw a text string. More... | |
void | gdispGDrawStringBox (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char *str, gFont font, gColor color, gJustify justify) |
Draw a text string vertically centered within the specified box. More... | |
void | gdispGFillStringBox (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char *str, gFont font, gColor color, gColor bgColor, gJustify justify) |
Draw a text string vertically centered within the specified box. The box background is filled with the specified background color. More... | |
gCoord | gdispGetFontMetric (gFont font, gFontmetric metric) |
Get a metric of a font. More... | |
gCoord | gdispGetCharWidth (char c, gFont font) |
Get the pixel width of a character. More... | |
gCoord | gdispGetStringWidthCount (const char *str, gFont font, gU16 count) |
Get the pixel width of a string of a given character length. More... | |
gCoord | gdispGetStringWidth (const char *str, gFont font) |
Get the pixel width of an entire string. More... | |
gFont | gdispOpenFont (const char *name) |
Find a font and return it. More... | |
void | gdispCloseFont (gFont font) |
Release a font after use. More... | |
gFont | gdispScaleFont (gFont font, gU8 scale_x, gU8 scale_y) |
Make a scaled copy of an existing font. More... | |
const char * | gdispGetFontName (gFont font) |
Get the name of the specified font. More... | |
gBool | gdispAddFont (gFont font) |
Add a font permanently to the font list. More... | |
void | gdispGDrawRoundedBox (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color) |
Draw a rectangular box with rounded corners. More... | |
void | gdispGFillRoundedBox (GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color) |
Draw a filled rectangular box with rounded corners. More... | |
Variables | |
GDisplay * | GDISP |
The default screen to use for the gdispXXXX calls. More... | |
GDISP Functionality to be included | |
#define | GDISP_NEED_AUTOFLUSH GFXOFF |
Should drawing operations be automatically flushed. More... | |
#define | GDISP_NEED_TIMERFLUSH GFXOFF |
Should drawing operations be automatically flushed on a timer. More... | |
#define | GDISP_NEED_VALIDATION GFXON |
Should all operations be clipped to the screen and colors validated. More... | |
#define | GDISP_NEED_CLIP GFXON |
Are clipping functions needed. More... | |
#define | GDISP_NEED_STREAMING GFXOFF |
Streaming functions are needed. More... | |
#define | GDISP_NEED_TEXT GFXOFF |
Are text functions needed. More... | |
#define | GDISP_NEED_CIRCLE GFXOFF |
Are circle functions needed. More... | |
#define | GDISP_NEED_DUALCIRCLE GFXOFF |
Are dual circle functions needed (one circle inside another). More... | |
#define | GDISP_NEED_ELLIPSE GFXOFF |
Are ellipse functions needed. More... | |
#define | GDISP_NEED_ARCSECTORS GFXOFF |
Are arc sector functions needed. More... | |
#define | GDISP_NEED_ARC GFXOFF |
Are arc functions needed. More... | |
#define | GDISP_NEED_CONVEX_POLYGON GFXOFF |
Are convex polygon functions needed. More... | |
#define | GDISP_NEED_SCROLL GFXOFF |
Are scrolling functions needed. More... | |
#define | GDISP_NEED_PIXELREAD GFXOFF |
Is the capability to read pixels back needed. More... | |
#define | GDISP_NEED_CONTROL GFXOFF |
Control some aspect of the hardware operation. More... | |
#define | GDISP_NEED_QUERY GFXOFF |
Query some aspect of the hardware operation. More... | |
#define | GDISP_NEED_IMAGE GFXOFF |
Is the image interface required. More... | |
#define | GDISP_NEED_PIXMAP GFXOFF |
Is the image interface required. More... | |
GDISP Multi-Threading Options | |
#define | GDISP_NEED_MULTITHREAD GFXOFF |
Do the drawing functions need to be thread-safe. More... | |
GDISP Optional Parameters | |
#define | GDISP_NEED_STARTUP_LOGO GFXON |
Should the startup logo be displayed. More... | |
#define | GDISP_STARTUP_COLOR GFX_BLACK |
Define the initial background color for all displays in the system. More... | |
#define | GDISP_LINEBUF_SIZE 128 |
Define the default orientation for all displays in the system. More... | |
GDISP Multiple Display Support | |
#define | GDISP_TOTAL_DISPLAYS 1 |
The total number of displays using the default driver. More... | |
#define | GDISP_DRIVER_LIST GDISPVMT_Win32, GDISPVMT_SSD1963 |
The list of display drivers. More... | |
GDISP Image Options | |
| |
#define | GDISP_NEED_IMAGE_NATIVE GFXOFF |
Is native image decoding required. More... | |
#define | GDISP_NEED_IMAGE_GIF GFXOFF |
Is GIF image decoding required. More... | |
#define | GDISP_NEED_IMAGE_BMP GFXOFF |
Is BMP image decoding required. More... | |
#define | GDISP_NEED_IMAGE_JPG GFXOFF |
Is JPG image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG GFXOFF |
Is PNG image decoding required. More... | |
#define | GDISP_NEED_IMAGE_ACCOUNTING GFXOFF |
Is memory accounting required during image decoding. More... | |
GDISP BMP Image Options | |
| |
#define | GDISP_NEED_IMAGE_BMP_1 GFXON |
Is BMP 1 bit per pixel (monochrome/2 color) image decoding required. More... | |
#define | GDISP_NEED_IMAGE_BMP_4 GFXON |
Is BMP 4 bits per pixel (16 color) image decoding required. More... | |
#define | GDISP_NEED_IMAGE_BMP_4_RLE GFXON |
Is BMP 4 bits per pixel (16 color) with RLE compression image decoding required. More... | |
#define | GDISP_NEED_IMAGE_BMP_8 GFXON |
Is BMP 8 bits per pixel (256 color) image decoding required. More... | |
#define | GDISP_NEED_IMAGE_BMP_8_RLE GFXON |
Is BMP 8 bits per pixel (256 color) with RLE compression image decoding required. More... | |
#define | GDISP_NEED_IMAGE_BMP_16 GFXON |
Is BMP 16 bits per pixel (65536 color) image decoding required. More... | |
#define | GDISP_NEED_IMAGE_BMP_24 GFXON |
Is BMP 24 bits per pixel (true-color) image decoding required. More... | |
#define | GDISP_NEED_IMAGE_BMP_32 GFXON |
Is BMP 32 bits per pixel (true-color) image decoding required. More... | |
#define | GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE 32 |
The BMP blit buffer size in pixels. More... | |
GDISP GIF Image Options | |
| |
#define | GDISP_IMAGE_GIF_BLIT_BUFFER_SIZE 32 |
The GIF blit buffer size. More... | |
GDISP PNG Image Options | |
| |
#define | GDISP_NEED_IMAGE_PNG_INTERLACED GFXOFF |
Is PNG Interlaced image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_TRANSPARENCY GFXON |
Is PNG image transparency processed. More... | |
#define | GDISP_NEED_IMAGE_PNG_BACKGROUND GFXON |
Is PNG background data processed. More... | |
#define | GDISP_NEED_IMAGE_PNG_ALPHACLIFF 32 |
What is the cliff between non-blended alpha pixels being displayed or not. More... | |
#define | GDISP_NEED_IMAGE_PNG_PALETTE_124 GFXON |
Is 1, 2 and 4 bit PNG palettized image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_PALETTE_8 GFXON |
Is 8 bit PNG palettized image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_GRAYSCALE_124 GFXON |
Is 1,2 and 4 bit PNG grayscale image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_GRAYSCALE_8 GFXON |
Is 8 bit PNG grayscale image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_GRAYSCALE_16 GFXON |
Is 16 bit PNG grayscale image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_GRAYALPHA_8 GFXON |
Is 8 bit PNG grayscale with 8 bit alpha image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_GRAYALPHA_16 GFXON |
Is 16 bit PNG grayscale with 16 bit alpha image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_RGB_8 GFXON |
Is 8/8/8 bit PNG RGB image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_RGB_16 GFXON |
Is 16/16/16 bit PNG RGB image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_RGBALPHA_8 GFXON |
Is 8/8/8 bit PNG RGB with 8 bit alpha image decoding required. More... | |
#define | GDISP_NEED_IMAGE_PNG_RGBALPHA_16 GFXON |
Is 16/16/16 bit PNG RGB with 16 bit alpha image decoding required. More... | |
#define | GDISP_IMAGE_PNG_BLIT_BUFFER_SIZE 32 |
The PNG blit buffer size in pixels. More... | |
#define | GDISP_IMAGE_PNG_FILE_BUFFER_SIZE 8 |
The PNG input file buffer size in bytes. More... | |
#define | GDISP_IMAGE_PNG_Z_BUFFER_SIZE 32768 |
The PNG inflate decompression buffer size in bytes. More... | |
GDISP Text Rendering Options | |
#define | GDISP_NEED_TEXT_WORDWRAP GFXOFF |
Enable advanced word-wrapping. More... | |
#define | GDISP_NEED_TEXT_BOXPADLR 1 |
Adding pixels to the left and right side of the box to pad text. More... | |
#define | GDISP_NEED_TEXT_BOXPADTB 1 |
Adding pixels to the top and bottom side of the box to pad text. More... | |
#define | GDISP_NEED_UTF8 GFXOFF |
Enable UTF-8 support for text rendering. More... | |
#define | GDISP_NEED_TEXT_KERNING GFXOFF |
Enable kerning for font rendering (improves character placement). More... | |
#define | GDISP_NEED_ANTIALIAS GFXOFF |
Enable antialiased font support. More... | |
GDISP Pixmap Options | |
#define | GDISP_NEED_PIXMAP_IMAGE GFXOFF |
Macros | |
#define | GDISP_CONTROL_POWER 0 |
Driver Control Constants. More... | |
#define | gdispGSetPowerMode(g, powerMode) gdispGControl((g), GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode)) |
Set the display power mode. More... | |
#define | gdispGSetOrientation(g, newOrientation) gdispGControl((g), GDISP_CONTROL_ORIENTATION, (void *)(unsigned)(newOrientation)) |
Set the display orientation. More... | |
#define | gdispGSetBacklight(g, percent) gdispGControl((g), GDISP_CONTROL_BACKLIGHT, (void *)(unsigned)(percent)) |
Set the display backlight. More... | |
#define | gdispGSetContrast(g, percent) gdispGControl((g), GDISP_CONTROL_CONTRAST, (void *)(unsigned)(percent)) |
Set the display contrast. More... | |
#define | gdispGUnsetClip(g) gdispGSetClip((g),0,0,gdispGGetWidth(g),gdispGGetHeight(g)) |
Reset the clip area to the full screen. More... | |
Typedefs | |
typedef gI16 | gCoord |
The type for a coordinate or length on the screen. More... | |
typedef const struct mf_font_s * | gFont |
The type of a font. More... | |
typedef gColor | gPixel |
The pixel format. More... | |
Enumerations | |
enum | gJustify { gJustifyLeft = 0x00 , gJustifyCenter = 0x01 , gJustifyRight = 0x02 , gJustifyTop = 0x10 , gJustifyMiddle = 0x00 , gJustifyBottom = 0x20 , gJustifyWordWrap = 0x00 , gJustifyNoWordWrap = 0x40 , gJustifyPad = 0x00 , gJustifyNoPad = 0x04 } |
Type for the text justification. More... | |
enum | gFontmetric { gFontHeight , gFontDescendersHeight , gFontLineSpacing , gFontCharPadding , gFontMinWidth , gFontMaxWidth , gFontBaselineX , gFontBaselineY } |
Type for the font metric. More... | |
enum | gOrientation { gOrientation0 = 0 , gOrientation90 = 90 , gOrientation180 = 180 , gOrientation270 = 270 , gOrientationPortrait = 1000 , gOrientationLandscape = 1001 } |
Type for the screen orientation. More... | |
enum | gPowermode { gPowerOff , gPowerSleep , gPowerDeepSleep , gPowerOn } |
Type for the available power modes for the screen. More... | |
gBool gdispAddFont | ( | gFont | font | ) |
Add a font permanently to the font list.
[in] | font | The font to add to the font list. |
Blend 2 colors according to the alpha.
[in] | fg | The foreground color |
[in] | bg | The background color |
[in] | alpha | The alpha value (0-255). 0 is all background, 255 is all foreground. |
void gdispCloseFont | ( | gFont | font | ) |
Release a font after use.
[in] | font | The font to release. |
Find a contrasting color.
[in] | color | The color to contrast |
void gdispGBlitArea | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | cx, | ||
gCoord | cy, | ||
gCoord | srcx, | ||
gCoord | srcy, | ||
gCoord | srccx, | ||
const gPixel * | buffer | ||
) |
Fill an area using the supplied bitmap.
The bitmap is in the pixel format specified by the low level driver
gdispIsBusy()
going gFalse.[in] | g | The display to use |
[in] | x,y | The start position |
[in] | cx,cy | The size of the filled area |
[in] | srcx,srcy | The bitmap position to start the fill form |
[in] | srccx | The width of a line in the bitmap |
[in] | buffer | The bitmap in the driver's pixel format |
void gdispGClear | ( | GDisplay * | g, |
gColor | color | ||
) |
Clear the display to the specified color.
[in] | g | The display to use |
[in] | color | The color to use when clearing the screen |
void gdispGControl | ( | GDisplay * | g, |
unsigned | what, | ||
void * | value | ||
) |
Control hardware specific parts of the display. eg powermodes, backlight etc.
[in] | g | The display to use |
[in] | what | what you want to control |
[in] | value | The value to be assigned |
void gdispGDrawArc | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | radius, | ||
gCoord | startangle, | ||
gCoord | endangle, | ||
gColor | color | ||
) |
Draw an arc.
[in] | g | The display to use |
[in] | x,y | The center point |
[in] | radius | The radius of the arc |
[in] | startangle | The start angle (0 to 360) |
[in] | endangle | The end angle (0 to 360) |
[in] | color | The color of the arc |
gdispDrawArcSectors()
instead. void gdispGDrawArcSectors | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | radius, | ||
gU8 | sectors, | ||
gColor | color | ||
) |
Draw a selection of 45 degree arcs of a circle.
[in] | g | The display to use |
[in] | x,y | The center of the circle |
[in] | radius | The radius of the circle |
[in] | sectors | Bits determine which sectors are drawn. Bits go anti-clockwise from the 0 degree mark (y = 0, x is positive), as follows: bit 0 - upper right right --— bit 1 - upper upper right /2 1\ bit 2 - upper upper left /3 0\ bit 3 - upper left left \4 7/ bit 4 - lower left left \5 6/ bit 5 - lower lower left --— bit 6 - lower lower right bit 7 - lower left left |
[in] | color | The color to use |
Draw a rectangular box.
[in] | g | The display to use |
[in] | x,y | The start position |
[in] | cx,cy | The size of the box (outside dimensions) |
[in] | color | The color to use |
Draw a text character.
[in] | g | The display to use |
[in] | x,y | The position for the text |
[in] | c | The character to draw |
[in] | font | The font to use |
[in] | color | The color to use |
Draw a circle.
[in] | g | The display to use |
[in] | x,y | The center of the circle |
[in] | radius | The radius of the circle |
[in] | color | The color to use |
Draw an ellipse.
[in] | g | The display to use |
[in] | x,y | The center of the ellipse |
[in] | a,b | The dimensions of the ellipse |
[in] | color | The color to use |
Draw a line.
[in] | g | The display to use |
[in] | x0,y0 | The start position |
[in] | x1,y1 | The end position |
[in] | color | The color to use |
Set a pixel in the specified color.
[in] | g | The display to use |
[in] | x,y | The position to set the pixel. |
[in] | color | The color to use |
void gdispGDrawPoly | ( | GDisplay * | g, |
gCoord | tx, | ||
gCoord | ty, | ||
const gPoint * | pntarray, | ||
unsigned | cnt, | ||
gColor | color | ||
) |
Draw an enclosed polygon (convex, non-convex or complex).
[in] | g | The display to use |
[in] | tx,ty | Transform all points in pntarray by tx, ty |
[in] | pntarray | An array of points |
[in] | cnt | The number of points in the array |
[in] | color | The color to use |
void gdispGDrawRoundedBox | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | cx, | ||
gCoord | cy, | ||
gCoord | radius, | ||
gColor | color | ||
) |
Draw a rectangular box with rounded corners.
[in] | g | The display to use |
[in] | x,y | The start position |
[in] | cx,cy | The size of the box (outside dimensions) |
[in] | radius | The radius of the rounded corners |
[in] | color | The color to use |
void gdispGDrawString | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
const char * | str, | ||
gFont | font, | ||
gColor | color | ||
) |
Draw a text string.
[in] | g | The display to use |
[in] | x,y | The position for the text |
[in] | str | The string to draw |
[in] | font | The font to use |
[in] | color | The color to use |
void gdispGDrawStringBox | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | cx, | ||
gCoord | cy, | ||
const char * | str, | ||
gFont | font, | ||
gColor | color, | ||
gJustify | justify | ||
) |
Draw a text string vertically centered within the specified box.
[in] | g | The display to use |
[in] | x,y | The position for the text (need to define top-right or base-line - check code) |
[in] | cx,cy | The width and height of the box |
[in] | str | The string to draw |
[in] | font | The font to use |
[in] | color | The color to use |
[in] | justify | Justify the text left, center or right within the box |
void gdispGDrawThickArc | ( | GDisplay * | g, |
gCoord | xc, | ||
gCoord | yc, | ||
gCoord | startradius, | ||
gCoord | endradius, | ||
gCoord | startangle, | ||
gCoord | endangle, | ||
gColor | color | ||
) |
Draw a thick arc.
[in] | g | The display to use |
[in] | xc,yc | The center point |
[in] | startradius | The inner radius of the thick arc |
[in] | endradius | The outer radius of the thick arc |
[in] | startangle | The start angle (0 to 360) |
[in] | endangle | The end angle (0 to 360) |
[in] | color | The color of the arc |
void gdispGDrawThickLine | ( | GDisplay * | g, |
gCoord | x0, | ||
gCoord | y0, | ||
gCoord | x1, | ||
gCoord | y1, | ||
gColor | color, | ||
gCoord | width, | ||
gBool | round | ||
) |
Draw a line with a specified thickness.
The line thickness is specified in pixels. The line ends can be selected to be either flat or round.
[in] | g | The display to use |
[in] | x0,y0 | The start position |
[in] | x1,y1 | The end position |
[in] | color | The color to use |
[in] | width | The width of the line |
[in] | round | Use round ends for the line |
Get the pixel width of a character.
[in] | c | The character to draw |
[in] | font | The font to use |
GDisplay* gdispGetDisplay | ( | unsigned | display | ) |
Get the specified display.
gdispGetDisplayCount()
- 1[in] | display | The display number (0..n) |
unsigned gdispGetDisplayCount | ( | void | ) |
Get the count of currently active displays.
gdispGetDisplayCount()
- 1 gCoord gdispGetFontMetric | ( | gFont | font, |
gFontmetric | metric | ||
) |
Get a metric of a font.
[in] | font | The font to test |
[in] | metric | The metric to measure |
const char* gdispGetFontName | ( | gFont | font | ) |
Get the name of the specified font.
[in] | font | The font to get the name for. |
Get the pixel width of an entire string.
[in] | str | The string to measure |
[in] | font | The font to use |
Get the pixel width of a string of a given character length.
[in] | str | The string to measure |
[in] | font | The font to use |
[in] | count | The number of characters to take into account |
void gdispGFillArc | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | radius, | ||
gCoord | startangle, | ||
gCoord | endangle, | ||
gColor | color | ||
) |
Draw a filled arc.
[in] | g | The display to use |
[in] | x,y | The center point |
[in] | radius | The radius of the arc |
[in] | startangle | The start angle (0 to 360) |
[in] | endangle | The end angle (0 to 360) |
[in] | color | The color of the arc |
gdispFillArcSectors()
instead. void gdispGFillArcSectors | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | radius, | ||
gU8 | sectors, | ||
gColor | color | ||
) |
Fill a selection of 45 degree arcs of a circle.
[in] | g | The display to use |
[in] | x,y | The center of the circle |
[in] | radius | The radius of the circle |
[in] | sectors | Bits determine which sectors are drawn. Bits go anti-clockwise from the 0 degree mark (y = 0, x is positive), as follows: bit 0 - upper right right --— bit 1 - upper upper right /2 1\ bit 2 - upper upper left /3 0\ bit 3 - upper left left \4 7/ bit 4 - lower left left \5 6/ bit 5 - lower lower left --— bit 6 - lower lower right bit 7 - lower left left |
[in] | color | The color to use |
Fill an area with a color.
[in] | g | The display to use |
[in] | x,y | The start position |
[in] | cx,cy | The size of the box (outside dimensions) |
[in] | color | The color to use |
void gdispGFillChar | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gU16 | c, | ||
gFont | font, | ||
gColor | color, | ||
gColor | bgcolor | ||
) |
Draw a text character with a filled background.
[in] | g | The display to use |
[in] | x,y | The position for the text |
[in] | c | The character to draw |
[in] | font | The font to use |
[in] | color | The color to use |
[in] | bgcolor | The background color to use |
Draw a filled circle.
[in] | g | The display to use |
[in] | x,y | The center of the circle |
[in] | radius | The radius of the circle |
[in] | color | The color to use |
void gdispGFillConvexPoly | ( | GDisplay * | g, |
gCoord | tx, | ||
gCoord | ty, | ||
const gPoint * | pntarray, | ||
unsigned | cnt, | ||
gColor | color | ||
) |
Fill a convex polygon.
Doesn't handle non-convex or complex polygons.
[in] | g | The display to use |
[in] | tx,ty | Transform all points in pntarray by tx, ty |
[in] | pntarray | An array of points |
[in] | cnt | The number of points in the array |
[in] | color | The color to use |
void gdispGFillDualCircle | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | radius1, | ||
gColor | color1, | ||
gCoord | radius2, | ||
gColor | color2 | ||
) |
Draw two filled circles with the same centre.
[in] | g | The display to use |
[in] | x,y | The center of the circle |
[in] | radius1 | The radius of the larger circle |
[in] | color1 | The color to use for the larger circle |
[in] | radius2 | The radius of the smaller circle |
[in] | color2 | The color to use for the smaller circle |
Draw a filled ellipse.
[in] | g | The display to use |
[in] | x,y | The center of the ellipse |
[in] | a,b | The dimensions of the ellipse |
[in] | color | The color to use |
void gdispGFillRoundedBox | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | cx, | ||
gCoord | cy, | ||
gCoord | radius, | ||
gColor | color | ||
) |
Draw a filled rectangular box with rounded corners.
[in] | g | The display to use |
[in] | x,y | The start position |
[in] | cx,cy | The size of the box (outside dimensions) |
[in] | radius | The radius of the rounded corners |
[in] | color | The color to use |
void gdispGFillString | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
const char * | str, | ||
gFont | font, | ||
gColor | color, | ||
gColor | bgcolor | ||
) |
Draw a text string.
[in] | g | The display to use |
[in] | x,y | The position for the text |
[in] | str | The string to draw |
[in] | font | The font to use |
[in] | color | The color to use |
[in] | bgcolor | The background color to use |
void gdispGFillStringBox | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | cx, | ||
gCoord | cy, | ||
const char * | str, | ||
gFont | font, | ||
gColor | color, | ||
gColor | bgColor, | ||
gJustify | justify | ||
) |
Draw a text string vertically centered within the specified box. The box background is filled with the specified background color.
[in] | g | The display to use |
[in] | x,y | The position for the text (need to define top-right or base-line - check code) |
[in] | cx,cy | The width and height of the box |
[in] | str | The string to draw |
[in] | font | The font to use |
[in] | color | The color to use |
[in] | bgColor | The background color to use |
[in] | justify | Justify the text left, center or right within the box |
void gdispGFlush | ( | GDisplay * | g | ) |
Flush current drawing operations to the display.
[in] | g | The display to use |
gU8 gdispGGetBacklight | ( | GDisplay * | g | ) |
Get the current display backlight brightness.
[in] | g | The display to use |
gU8 gdispGGetContrast | ( | GDisplay * | g | ) |
Get the current display contrast.
[in] | g | The display to use |
gCoord gdispGGetHeight | ( | GDisplay * | g | ) |
Get the display height in pixels.
[in] | g | The display to use |
gOrientation gdispGGetOrientation | ( | GDisplay * | g | ) |
Get the current display orientation.
[in] | g | The display to use |
Get the color of a pixel.
[in] | g | The display to use |
[in] | x,y | The position of the pixel |
gPowermode gdispGGetPowerMode | ( | GDisplay * | g | ) |
Get the current display power mode.
[in] | g | The display to use |
gCoord gdispGGetWidth | ( | GDisplay * | g | ) |
Get the display width in pixels.
[in] | g | The display to use |
void* gdispGQuery | ( | GDisplay * | g, |
unsigned | what | ||
) |
Query a property of the display.
[in] | g | The display to use |
[in] | what | What to query |
Clip all drawing to the defined area.
[in] | g | The display to use |
[in] | x,y | The start position |
[in] | cx,cy | The size of the clip area |
void gdispGStreamColor | ( | GDisplay * | g, |
gColor | color | ||
) |
Send pixel data to the stream.
Write a pixel to the next position in the streamed area and increment the position
gdispStreamStart()
has been called. [in] | g | The display to use |
[in] | color | The color of the pixel to write |
Start a streaming operation.
Stream data to a window on the display sequentially and very fast.
gdispBlendColor()
and streaming functions). If a call is made (eg in a multi-threaded application) the other call is blocked waiting for the streaming operation to finish. gdispStreamStop()
must be called to finish the streaming operation. gdispStreamStop()
.[in] | g | The display to use |
[in] | x,y | The start position |
[in] | cx,cy | The size of the streamable area |
void gdispGStreamStop | ( | GDisplay * | g | ) |
Finish the current streaming operation.
Completes the current streaming operation and allows other GDISP calls to operate again.
gdispStreamStart()
has been called. [in] | g | The display to use |
void gdispGVerticalScroll | ( | GDisplay * | g, |
gCoord | x, | ||
gCoord | y, | ||
gCoord | cx, | ||
gCoord | cy, | ||
int | lines, | ||
gColor | bgcolor | ||
) |
Scroll vertically a section of the screen.
[in] | g | The display to use |
[in] | x,y | The start of the area to be scrolled |
[in] | cx,cy | The size of the area to be scrolled |
[in] | lines | The number of lines to scroll (Can be positive or negative) |
[in] | bgcolor | The color to fill the newly exposed area. |
gFont gdispOpenFont | ( | const char * | name | ) |
Find a font and return it.
The supplied name is matched against the font name. A '*' will replace 0 or more characters.
[in] | name | The font name to find. |
Make a scaled copy of an existing font.
Allocates memory for new font metadata using gfxAlloc, remember to close font after use!
[in] | font | The base font to use. |
[in] | scale_x | The scale factor in horizontal direction. |
[in] | scale_y | The scale factor in vertical direction. |
void gdispSetDisplay | ( | GDisplay * | g | ) |
Set the current default display to the specified display.
[in] | g | The display to use |
|
extern |
The default screen to use for the gdispXXXX calls.
gdispSetDisplay()
. #define GDISP_CONTROL_POWER 0 |
Driver Control Constants.
Unsupported control codes are ignored.
#define GDISP_DRIVER_LIST GDISPVMT_Win32, GDISPVMT_SSD1963 |
The list of display drivers.
Definition at line 277 of file gdisp_options.h.
#define GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE 32 |
The BMP blit buffer size in pixels.
Defaults to 32 pixels
Definition at line 398 of file gdisp_options.h.
#define GDISP_IMAGE_GIF_BLIT_BUFFER_SIZE 32 |
The GIF blit buffer size.
Defaults to 32
Definition at line 413 of file gdisp_options.h.
#define GDISP_IMAGE_PNG_BLIT_BUFFER_SIZE 32 |
The PNG blit buffer size in pixels.
Defaults to 32
Definition at line 542 of file gdisp_options.h.
#define GDISP_IMAGE_PNG_FILE_BUFFER_SIZE 8 |
The PNG input file buffer size in bytes.
Defaults to 8
Definition at line 551 of file gdisp_options.h.
#define GDISP_IMAGE_PNG_Z_BUFFER_SIZE 32768 |
The PNG inflate decompression buffer size in bytes.
Defaults to 32768
Definition at line 561 of file gdisp_options.h.
#define GDISP_LINEBUF_SIZE 128 |
Define the default orientation for all displays in the system.
The size of pixel buffer (in pixels) used for optimization.
Set to zero to guarantee disabling of the buffer.
Definition at line 249 of file gdisp_options.h.
#define GDISP_NEED_ANTIALIAS GFXOFF |
#define GDISP_NEED_ARC GFXOFF |
Are arc functions needed.
Defaults to GFXOFF
Definition at line 132 of file gdisp_options.h.
#define GDISP_NEED_ARCSECTORS GFXOFF |
Are arc sector functions needed.
Defaults to GFXOFF
Definition at line 118 of file gdisp_options.h.
#define GDISP_NEED_AUTOFLUSH GFXOFF |
Should drawing operations be automatically flushed.
Defaults to GFXOFF
gdispGFlush()
. Setting this to GFXON causes GDISP to automatically flush after each drawing operation. Note this may be slow but enables an application to avoid having to manually call the flush routine. Definition at line 36 of file gdisp_options.h.
#define GDISP_NEED_CIRCLE GFXOFF |
Are circle functions needed.
Defaults to GFXOFF
Definition at line 94 of file gdisp_options.h.
#define GDISP_NEED_CLIP GFXON |
#define GDISP_NEED_CONTROL GFXOFF |
Control some aspect of the hardware operation.
Defaults to GFXOFF
Definition at line 171 of file gdisp_options.h.
#define GDISP_NEED_CONVEX_POLYGON GFXOFF |
Are convex polygon functions needed.
Defaults to GFXOFF
Definition at line 142 of file gdisp_options.h.
#define GDISP_NEED_DUALCIRCLE GFXOFF |
Are dual circle functions needed (one circle inside another).
Defaults to GFXOFF
Definition at line 102 of file gdisp_options.h.
#define GDISP_NEED_ELLIPSE GFXOFF |
Are ellipse functions needed.
Defaults to GFXOFF
Definition at line 110 of file gdisp_options.h.
#define GDISP_NEED_IMAGE GFXOFF |
#define GDISP_NEED_IMAGE_ACCOUNTING GFXOFF |
Is memory accounting required during image decoding.
Defaults to GFXOFF
Definition at line 326 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_BMP GFXOFF |
#define GDISP_NEED_IMAGE_BMP_1 GFXON |
Is BMP 1 bit per pixel (monochrome/2 color) image decoding required.
Defaults to GFXON
Definition at line 340 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_BMP_16 GFXON |
Is BMP 16 bits per pixel (65536 color) image decoding required.
Defaults to GFXON
Definition at line 375 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_BMP_24 GFXON |
Is BMP 24 bits per pixel (true-color) image decoding required.
Defaults to GFXON
Definition at line 382 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_BMP_32 GFXON |
Is BMP 32 bits per pixel (true-color) image decoding required.
Defaults to GFXON
Definition at line 389 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_BMP_4 GFXON |
Is BMP 4 bits per pixel (16 color) image decoding required.
Defaults to GFXON
Definition at line 347 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_BMP_4_RLE GFXON |
Is BMP 4 bits per pixel (16 color) with RLE compression image decoding required.
Defaults to GFXON
Definition at line 354 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_BMP_8 GFXON |
Is BMP 8 bits per pixel (256 color) image decoding required.
Defaults to GFXON
Definition at line 361 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_BMP_8_RLE GFXON |
Is BMP 8 bits per pixel (256 color) with RLE compression image decoding required.
Defaults to GFXON
Definition at line 368 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_GIF GFXOFF |
#define GDISP_NEED_IMAGE_JPG GFXOFF |
#define GDISP_NEED_IMAGE_NATIVE GFXOFF |
Is native image decoding required.
Defaults to GFXOFF
Definition at line 291 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG GFXOFF |
#define GDISP_NEED_IMAGE_PNG_ALPHACLIFF 32 |
What is the cliff between non-blended alpha pixels being displayed or not.
Range of 0 to 255
Definition at line 457 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_BACKGROUND GFXON |
Is PNG background data processed.
Defaults to GFXON
Definition at line 444 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_GRAYALPHA_16 GFXON |
Is 16 bit PNG grayscale with 16 bit alpha image decoding required.
Defaults to GFXON
Definition at line 506 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_GRAYALPHA_8 GFXON |
Is 8 bit PNG grayscale with 8 bit alpha image decoding required.
Defaults to GFXON
Definition at line 499 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_GRAYSCALE_124 GFXON |
Is 1,2 and 4 bit PNG grayscale image decoding required.
Defaults to GFXON
Definition at line 478 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_GRAYSCALE_16 GFXON |
Is 16 bit PNG grayscale image decoding required.
Defaults to GFXON
Definition at line 492 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_GRAYSCALE_8 GFXON |
Is 8 bit PNG grayscale image decoding required.
Defaults to GFXON
Definition at line 485 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_INTERLACED GFXOFF |
Is PNG Interlaced image decoding required.
Defaults to GFXOFF
Definition at line 428 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_PALETTE_124 GFXON |
Is 1, 2 and 4 bit PNG palettized image decoding required.
Defaults to GFXON
Definition at line 464 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_PALETTE_8 GFXON |
Is 8 bit PNG palettized image decoding required.
Defaults to GFXON
Definition at line 471 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_RGB_16 GFXON |
Is 16/16/16 bit PNG RGB image decoding required.
Defaults to GFXON
Definition at line 520 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_RGB_8 GFXON |
Is 8/8/8 bit PNG RGB image decoding required.
Defaults to GFXON
Definition at line 513 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_RGBALPHA_16 GFXON |
Is 16/16/16 bit PNG RGB with 16 bit alpha image decoding required.
Defaults to GFXON
Definition at line 534 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_RGBALPHA_8 GFXON |
Is 8/8/8 bit PNG RGB with 8 bit alpha image decoding required.
Defaults to GFXON
Definition at line 527 of file gdisp_options.h.
#define GDISP_NEED_IMAGE_PNG_TRANSPARENCY GFXON |
Is PNG image transparency processed.
Defaults to GFXON
Definition at line 435 of file gdisp_options.h.
#define GDISP_NEED_MULTITHREAD GFXOFF |
Do the drawing functions need to be thread-safe.
Defaults to GFXOFF
Definition at line 206 of file gdisp_options.h.
#define GDISP_NEED_PIXELREAD GFXOFF |
Is the capability to read pixels back needed.
Defaults to GFXOFF
Definition at line 162 of file gdisp_options.h.
#define GDISP_NEED_PIXMAP GFXOFF |
#define GDISP_NEED_QUERY GFXOFF |
Query some aspect of the hardware operation.
Defaults to GFXOFF
Definition at line 179 of file gdisp_options.h.
#define GDISP_NEED_SCROLL GFXOFF |
Are scrolling functions needed.
Defaults to GFXOFF
Definition at line 152 of file gdisp_options.h.
#define GDISP_NEED_STARTUP_LOGO GFXON |
Should the startup logo be displayed.
Defaults to GFXON
Definition at line 220 of file gdisp_options.h.
#define GDISP_NEED_STREAMING GFXOFF |
#define GDISP_NEED_TEXT GFXOFF |
Are text functions needed.
Defaults to GFXOFF
Definition at line 86 of file gdisp_options.h.
#define GDISP_NEED_TEXT_BOXPADLR 1 |
Adding pixels to the left and right side of the box to pad text.
Only has an effect with gdispGDrawStringBox()
and gdispGFillStringBox()
Defaults to 1
Definition at line 584 of file gdisp_options.h.
#define GDISP_NEED_TEXT_BOXPADTB 1 |
Adding pixels to the top and bottom side of the box to pad text.
Only has an effect with gdispGDrawStringBox()
and gdispGFillStringBox()
Defaults to 1
Definition at line 593 of file gdisp_options.h.
#define GDISP_NEED_TEXT_KERNING GFXOFF |
Enable kerning for font rendering (improves character placement).
Defaults to GFXOFF
Definition at line 607 of file gdisp_options.h.
#define GDISP_NEED_TEXT_WORDWRAP GFXOFF |
Enable advanced word-wrapping.
Only has an effect with gdispGDrawStringBox()
and gdispGFillStringBox()
Defaults to GFXOFF
Definition at line 575 of file gdisp_options.h.
#define GDISP_NEED_TIMERFLUSH GFXOFF |
Should drawing operations be automatically flushed on a timer.
Defaults to GFXOFF, Can be set to GFXOFF or a timer period in milliseconds.
Definition at line 48 of file gdisp_options.h.
#define GDISP_NEED_UTF8 GFXOFF |
Enable UTF-8 support for text rendering.
Defaults to GFXOFF
Definition at line 600 of file gdisp_options.h.
#define GDISP_NEED_VALIDATION GFXON |
Should all operations be clipped to the screen and colors validated.
Defaults to GFXON.
Definition at line 64 of file gdisp_options.h.
#define GDISP_STARTUP_COLOR GFX_BLACK |
Define the initial background color for all displays in the system.
Definition at line 226 of file gdisp_options.h.
#define GDISP_TOTAL_DISPLAYS 1 |
The total number of displays using the default driver.
Definition at line 263 of file gdisp_options.h.
#define gdispGSetBacklight | ( | g, | |
percent | |||
) | gdispGControl((g), GDISP_CONTROL_BACKLIGHT, (void *)(unsigned)(percent)) |
Set the display backlight.
[in] | g | The display to use |
[in] | percent | The new brightness (0 - 100%) |
#define gdispGSetContrast | ( | g, | |
percent | |||
) | gdispGControl((g), GDISP_CONTROL_CONTRAST, (void *)(unsigned)(percent)) |
#define gdispGSetOrientation | ( | g, | |
newOrientation | |||
) | gdispGControl((g), GDISP_CONTROL_ORIENTATION, (void *)(unsigned)(newOrientation)) |
#define gdispGSetPowerMode | ( | g, | |
powerMode | |||
) | gdispGControl((g), GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode)) |
#define gdispGUnsetClip | ( | g | ) | gdispGSetClip((g),0,0,gdispGGetWidth(g),gdispGGetHeight(g)) |
typedef gI16 gCoord |
The pixel format.
It generally defaults to the hardware pixel format.
Do pixels require packing for a blit
Do lines of pixels require packing for a blit
The type of a pixel.
enum gFontmetric |
Type for the font metric.
enum gJustify |
Type for the text justification.
enum gOrientation |
Type for the screen orientation.
enum gPowermode |