µGFX  2.9
version 2.9
GDISP

Detailed Description

Module to interface graphic / pixel oriented displays.

The GDISP module provides high level abstraction to interface pixel oriented graphic displays.

Precondition
GFX_USE_GDISP must be set to GFXON in gfxconf.h
Note
Each drawing routine supports a gdispXXXX and a gdispGXXXX function. The difference is that the gdispXXXX function does not require a display to be specified. Note there is a slight anomaly in the naming with gdispGBlitArea() vs gdispBlitAreaEx() and gdispBlitArea(), the latter of which is now deprecated.

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

Precondition
GDISP_NEED_IMAGE must be GFXON
#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

Precondition
GDISP_NEED_IMAGE and GDISP_NEED_IMAGE_BMP must be GFXON
#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

Precondition
GDISP_NEED_IMAGE and GDISP_NEED_IMAGE_GIF must be GFXON
#define GDISP_IMAGE_GIF_BLIT_BUFFER_SIZE   32
 The GIF blit buffer size. More...
 

GDISP PNG Image Options

Precondition
GDISP_NEED_IMAGE and GDISP_NEED_IMAGE_PNG must be GFXON
#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...
 

Function Documentation

◆ gdispAddFont()

gBool gdispAddFont ( gFont  font)

Add a font permanently to the font list.

Returns
gTrue on success. Reasons it may fail: out of memory, if it is already on the list, it is not a font loaded in RAM.
Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]fontThe font to add to the font list.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispBlendColor()

gColor gdispBlendColor ( gColor  fg,
gColor  bg,
gU8  alpha 
)

Blend 2 colors according to the alpha.

Returns
The combined color
Parameters
[in]fgThe foreground color
[in]bgThe background color
[in]alphaThe alpha value (0-255). 0 is all background, 255 is all foreground.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispCloseFont()

void gdispCloseFont ( gFont  font)

Release a font after use.

Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]fontThe font to release.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispContrastColor()

gColor gdispContrastColor ( gColor  color)

Find a contrasting color.

Returns
The contrasting color
Parameters
[in]colorThe color to contrast
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGBlitArea()

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

Note
If a packed pixel format is used and the width doesn't match a whole number of bytes, the next line will start on a non-byte boundary (no end-of-line padding).
If GDISP_NEED_ASYNC is defined then the buffer must be static or at least retained until this call has finished the blit. You can tell when all graphics drawing is finished by gdispIsBusy() going gFalse.
Parameters
[in]gThe display to use
[in]x,yThe start position
[in]cx,cyThe size of the filled area
[in]srcx,srcyThe bitmap position to start the fill form
[in]srccxThe width of a line in the bitmap
[in]bufferThe bitmap in the driver's pixel format
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGClear()

void gdispGClear ( GDisplay *  g,
gColor  color 
)

Clear the display to the specified color.

Parameters
[in]gThe display to use
[in]colorThe color to use when clearing the screen
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGControl()

void gdispGControl ( GDisplay *  g,
unsigned  what,
void *  value 
)

Control hardware specific parts of the display. eg powermodes, backlight etc.

Precondition
GDISP_NEED_CONTROL must be GFXON in your gfxconf.h
Note
Depending on the hardware implementation this function may not support some codes. They will be ignored.
Parameters
[in]gThe display to use
[in]whatwhat you want to control
[in]valueThe value to be assigned
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawArc()

void gdispGDrawArc ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  radius,
gCoord  startangle,
gCoord  endangle,
gColor  color 
)

Draw an arc.

Precondition
GDISP_NEED_ARC must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center point
[in]radiusThe radius of the arc
[in]startangleThe start angle (0 to 360)
[in]endangleThe end angle (0 to 360)
[in]colorThe color of the arc
Note
If you are just doing 45 degree angles consider using gdispDrawArcSectors() instead.
This routine requires trig support. It can either come from your C runtime library cos() and sin() which requires floating point support (and is slow), or you can define GFX_USE_GMISC and either GMISC_NEED_FIXEDTRIG or GMISC_NEED_FASTTRIG. GMISC_NEED_FASTTRIG uses table based floating point trig operations. GMISC_NEED_FIXEDTRIG uses fixed point integer trig operations. Note accuracy on both the table based options are more than adequate for the one degree resolution provided by these arc routines. Both are much faster than your C runtime library.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawArcSectors()

void gdispGDrawArcSectors ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  radius,
gU8  sectors,
gColor  color 
)

Draw a selection of 45 degree arcs of a circle.

Precondition
GDISP_NEED_ARCSECTORS must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center of the circle
[in]radiusThe radius of the circle
[in]sectorsBits 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]colorThe color to use
Note
This is a more limited versions of the general arc drawing routine. It doesn't require trig libraries or tables or floating point and is smaller in code size. There is probably little point in including both this and the general arc routine as the general arc routine can do everything this can do.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawBox()

void gdispGDrawBox ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  cx,
gCoord  cy,
gColor  color 
)

Draw a rectangular box.

Parameters
[in]gThe display to use
[in]x,yThe start position
[in]cx,cyThe size of the box (outside dimensions)
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawChar()

void gdispGDrawChar ( GDisplay *  g,
gCoord  x,
gCoord  y,
gU16  c,
gFont  font,
gColor  color 
)

Draw a text character.

Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe position for the text
[in]cThe character to draw
[in]fontThe font to use
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawCircle()

void gdispGDrawCircle ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  radius,
gColor  color 
)

Draw a circle.

Precondition
GDISP_NEED_CIRCLE must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center of the circle
[in]radiusThe radius of the circle
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawEllipse()

void gdispGDrawEllipse ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  a,
gCoord  b,
gColor  color 
)

Draw an ellipse.

Precondition
GDISP_NEED_ELLIPSE must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center of the ellipse
[in]a,bThe dimensions of the ellipse
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawLine()

void gdispGDrawLine ( GDisplay *  g,
gCoord  x0,
gCoord  y0,
gCoord  x1,
gCoord  y1,
gColor  color 
)

Draw a line.

Parameters
[in]gThe display to use
[in]x0,y0The start position
[in]x1,y1The end position
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawPixel()

void gdispGDrawPixel ( GDisplay *  g,
gCoord  x,
gCoord  y,
gColor  color 
)

Set a pixel in the specified color.

Parameters
[in]gThe display to use
[in]x,yThe position to set the pixel.
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawPoly()

void gdispGDrawPoly ( GDisplay *  g,
gCoord  tx,
gCoord  ty,
const gPoint pntarray,
unsigned  cnt,
gColor  color 
)

Draw an enclosed polygon (convex, non-convex or complex).

Precondition
GDISP_NEED_CONVEX_POLYGON must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]tx,tyTransform all points in pntarray by tx, ty
[in]pntarrayAn array of points
[in]cntThe number of points in the array
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawRoundedBox()

void gdispGDrawRoundedBox ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  cx,
gCoord  cy,
gCoord  radius,
gColor  color 
)

Draw a rectangular box with rounded corners.

Precondition
GDISP_NEED_ARC or GDISP_NEED_ARCSECTORS must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe start position
[in]cx,cyThe size of the box (outside dimensions)
[in]radiusThe radius of the rounded corners
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawString()

void gdispGDrawString ( GDisplay *  g,
gCoord  x,
gCoord  y,
const char *  str,
gFont  font,
gColor  color 
)

Draw a text string.

Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe position for the text
[in]strThe string to draw
[in]fontThe font to use
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawStringBox()

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.

Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe position for the text (need to define top-right or base-line - check code)
[in]cx,cyThe width and height of the box
[in]strThe string to draw
[in]fontThe font to use
[in]colorThe color to use
[in]justifyJustify the text left, center or right within the box
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawThickArc()

void gdispGDrawThickArc ( GDisplay *  g,
gCoord  xc,
gCoord  yc,
gCoord  startradius,
gCoord  endradius,
gCoord  startangle,
gCoord  endangle,
gColor  color 
)

Draw a thick arc.

Precondition
GDISP_NEED_ARC must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]xc,ycThe center point
[in]startradiusThe inner radius of the thick arc
[in]endradiusThe outer radius of the thick arc
[in]startangleThe start angle (0 to 360)
[in]endangleThe end angle (0 to 360)
[in]colorThe color of the arc
Note
This routine requires trig support. It can either come from your C runtime library cos() and sin() which requires floating point support (and is slow), or you can define GFX_USE_GMISC and either GMISC_NEED_FIXEDTRIG or GMISC_NEED_FASTTRIG. GMISC_NEED_FASTTRIG uses table based floating point trig operations. GMISC_NEED_FIXEDTRIG uses fixed point integer trig operations. Note accuracy on both the table based options are more than adequate for the one degree resolution provided by these arc routines. Both are much faster than your C runtime library.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGDrawThickLine()

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.

Precondition
GDISP_NEED_CONVEX_POLYGON must be GFXON in your gfxconf.h
Note
Uses gdispGFillConvexPoly() internally to perform the drawing.
Parameters
[in]gThe display to use
[in]x0,y0The start position
[in]x1,y1The end position
[in]colorThe color to use
[in]widthThe width of the line
[in]roundUse round ends for the line
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGetCharWidth()

gCoord gdispGetCharWidth ( char  c,
gFont  font 
)

Get the pixel width of a character.

Returns
The width of the character in pixels. Does not include any between character padding.
Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]cThe character to draw
[in]fontThe font to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGetDisplay()

GDisplay* gdispGetDisplay ( unsigned  display)

Get the specified display.

Returns
The pointer to the display or NULL if the display doesn't exist
Note
The GDISP variable contains the display used by the gdispXxxx routines as opposed to the gdispGXxxx routines which take an explicit display parameter.
Displays are numbered from 0 to gdispGetDisplayCount() - 1
Parameters
[in]displayThe display number (0..n)
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGetDisplayCount()

unsigned gdispGetDisplayCount ( void  )

Get the count of currently active displays.

Returns
The count of displays currently in the system
Note
Displays are numbered from 0 to gdispGetDisplayCount() - 1

◆ gdispGetFontMetric()

gCoord gdispGetFontMetric ( gFont  font,
gFontmetric  metric 
)

Get a metric of a font.

Returns
The metric requested in pixels.
Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]fontThe font to test
[in]metricThe metric to measure
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGetFontName()

const char* gdispGetFontName ( gFont  font)

Get the name of the specified font.

Returns
The name of the font.
Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]fontThe font to get the name for.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGetStringWidth()

gCoord gdispGetStringWidth ( const char *  str,
gFont  font 
)

Get the pixel width of an entire string.

Returns
The width of the string in pixels.
Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]strThe string to measure
[in]fontThe font to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGetStringWidthCount()

gCoord gdispGetStringWidthCount ( const char *  str,
gFont  font,
gU16  count 
)

Get the pixel width of a string of a given character length.

Returns
The width of the string in pixels.
Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Note
Passing 0 to count has the same effect as calling gdispGetStringWidt()
Parameters
[in]strThe string to measure
[in]fontThe font to use
[in]countThe number of characters to take into account
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillArc()

void gdispGFillArc ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  radius,
gCoord  startangle,
gCoord  endangle,
gColor  color 
)

Draw a filled arc.

Precondition
GDISP_NEED_ARC must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center point
[in]radiusThe radius of the arc
[in]startangleThe start angle (0 to 360)
[in]endangleThe end angle (0 to 360)
[in]colorThe color of the arc
Note
If you are just doing 45 degree angles consider using gdispFillArcSectors() instead.
This routine requires trig support. It can either come from your C runtime library cos() and sin() which requires floating point support (and is slow), or you can define GFX_USE_GMISC and either GMISC_NEED_FIXEDTRIG or GMISC_NEED_FASTTRIG. GMISC_NEED_FASTTRIG uses table based floating point trig operations. GMISC_NEED_FIXEDTRIG uses fixed point integer trig operations. Note accuracy on both the table based options are more than adequate for the one degree resolution provided by these arc routines. Both are much faster than your C runtime library.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillArcSectors()

void gdispGFillArcSectors ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  radius,
gU8  sectors,
gColor  color 
)

Fill a selection of 45 degree arcs of a circle.

Precondition
GDISP_NEED_ARCSECTORS must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center of the circle
[in]radiusThe radius of the circle
[in]sectorsBits 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]colorThe color to use
Note
This is a more limited versions of the general arc filling routine. It doesn't require trig libraries or tables or floating point and is smaller in code size. There is probably little point in including both this and the general arc routine as the general arc routine can do everything this can do.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillArea()

void gdispGFillArea ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  cx,
gCoord  cy,
gColor  color 
)

Fill an area with a color.

Parameters
[in]gThe display to use
[in]x,yThe start position
[in]cx,cyThe size of the box (outside dimensions)
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillChar()

void gdispGFillChar ( GDisplay *  g,
gCoord  x,
gCoord  y,
gU16  c,
gFont  font,
gColor  color,
gColor  bgcolor 
)

Draw a text character with a filled background.

Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe position for the text
[in]cThe character to draw
[in]fontThe font to use
[in]colorThe color to use
[in]bgcolorThe background color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillCircle()

void gdispGFillCircle ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  radius,
gColor  color 
)

Draw a filled circle.

Precondition
GDISP_NEED_CIRCLE must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center of the circle
[in]radiusThe radius of the circle
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillConvexPoly()

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.

Precondition
GDISP_NEED_CONVEX_POLYGON must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]tx,tyTransform all points in pntarray by tx, ty
[in]pntarrayAn array of points
[in]cntThe number of points in the array
[in]colorThe color to use
Note
Convex polygons are those that have no internal angles. That is; you can draw a line from any point on the polygon to any other point on the polygon without it going outside the polygon. In our case we generalise this a little by saying that an infinite horizontal line (at any y value) will cross no more than two edges on the polygon. Some non-convex polygons do fit this criteria and can therefore be drawn.
This routine is designed to be very efficient with even simple display hardware.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillDualCircle()

void gdispGFillDualCircle ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  radius1,
gColor  color1,
gCoord  radius2,
gColor  color2 
)

Draw two filled circles with the same centre.

Precondition
GDISP_NEED_DUALCIRCLE must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center of the circle
[in]radius1The radius of the larger circle
[in]color1The color to use for the larger circle
[in]radius2The radius of the smaller circle
[in]color2The color to use for the smaller circle
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillEllipse()

void gdispGFillEllipse ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  a,
gCoord  b,
gColor  color 
)

Draw a filled ellipse.

Precondition
GDISP_NEED_ELLIPSE must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe center of the ellipse
[in]a,bThe dimensions of the ellipse
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillRoundedBox()

void gdispGFillRoundedBox ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  cx,
gCoord  cy,
gCoord  radius,
gColor  color 
)

Draw a filled rectangular box with rounded corners.

Precondition
GDISP_NEED_ARC or GDISP_NEED_ARCSECTORS must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe start position
[in]cx,cyThe size of the box (outside dimensions)
[in]radiusThe radius of the rounded corners
[in]colorThe color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillString()

void gdispGFillString ( GDisplay *  g,
gCoord  x,
gCoord  y,
const char *  str,
gFont  font,
gColor  color,
gColor  bgcolor 
)

Draw a text string.

Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe position for the text
[in]strThe string to draw
[in]fontThe font to use
[in]colorThe color to use
[in]bgcolorThe background color to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFillStringBox()

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.

Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Note
The entire box is filled
Parameters
[in]gThe display to use
[in]x,yThe position for the text (need to define top-right or base-line - check code)
[in]cx,cyThe width and height of the box
[in]strThe string to draw
[in]fontThe font to use
[in]colorThe color to use
[in]bgColorThe background color to use
[in]justifyJustify the text left, center or right within the box
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGFlush()

void gdispGFlush ( GDisplay *  g)

Flush current drawing operations to the display.

Note
Some low level drivers do not update the display until the display is flushed. For others it is optional but can help prevent tearing effects. For some it is ignored. Calling it at the end of a logic set of drawing operations in your application will ensure controller portability. If you know your controller does not need to be flushed there is no need to call it (which is in reality most controllers).
Even for displays that require flushing, there is no need to call this function if GDISP_NEED_AUTOFLUSH is GFXON. Calling it again won't hurt though.
Parameters
[in]gThe display to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGGetBacklight()

gU8 gdispGGetBacklight ( GDisplay *  g)

Get the current display backlight brightness.

Parameters
[in]gThe display to use
Returns
The current backlight value
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGGetContrast()

gU8 gdispGGetContrast ( GDisplay *  g)

Get the current display contrast.

Parameters
[in]gThe display to use
Returns
The current contrast value
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGGetHeight()

gCoord gdispGGetHeight ( GDisplay *  g)

Get the display height in pixels.

Parameters
[in]gThe display to use
Returns
The height of the display
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGGetOrientation()

gOrientation gdispGGetOrientation ( GDisplay *  g)

Get the current display orientation.

Parameters
[in]gThe display to use
Returns
The current orientation
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGGetPixelColor()

gColor gdispGGetPixelColor ( GDisplay *  g,
gCoord  x,
gCoord  y 
)

Get the color of a pixel.

Returns
The color of the pixel.
Precondition
GDISP_NEED_PIXELREAD must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe position of the pixel
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGGetPowerMode()

gPowermode gdispGGetPowerMode ( GDisplay *  g)

Get the current display power mode.

Parameters
[in]gThe display to use
Returns
The current power mode
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGGetWidth()

gCoord gdispGGetWidth ( GDisplay *  g)

Get the display width in pixels.

Parameters
[in]gThe display to use
Returns
The width of the display
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGQuery()

void* gdispGQuery ( GDisplay *  g,
unsigned  what 
)

Query a property of the display.

Precondition
GDISP_NEED_QUERY must be GFXON in your gfxconf.h
Note
The result must be typecast to the correct type.
An unsupported query will return (void *)-1.
Parameters
[in]gThe display to use
[in]whatWhat to query
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGSetClip()

void gdispGSetClip ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  cx,
gCoord  cy 
)

Clip all drawing to the defined area.

Precondition
GDISP_NEED_CLIP must be GFXON in your gfxconf.h
Parameters
[in]gThe display to use
[in]x,yThe start position
[in]cx,cyThe size of the clip area
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGStreamColor()

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

Precondition
GDISP_NEED_STREAMING must be GFXON in your gfxconf.h
gdispStreamStart() has been called.
Note
If the gdispStreamStart() has not been called (or failed due to clipping), the data provided here is simply thrown away.
Parameters
[in]gThe display to use
[in]colorThe color of the pixel to write
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGStreamStart()

void gdispGStreamStart ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  cx,
gCoord  cy 
)

Start a streaming operation.

Stream data to a window on the display sequentially and very fast.

Precondition
GDISP_NEED_STREAMING must be GFXON in your gfxconf.h
Note
While streaming is in operation - no other calls to GDISP functions can be made (with the exception of 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.
If more data is written than the defined area then the results are unspecified. Some drivers may wrap back to the beginning of the area, others may just ignore subsequent data.
Unlike most operations that clip the defined area to the display to generate a smaller active area, this call will just silently fail if any of the stream region lies outside the current clipping area.
A streaming operation may be terminated early (without writing to every location in the stream area) by calling gdispStreamStop().
Parameters
[in]gThe display to use
[in]x,yThe start position
[in]cx,cyThe size of the streamable area
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGStreamStop()

void gdispGStreamStop ( GDisplay *  g)

Finish the current streaming operation.

Completes the current streaming operation and allows other GDISP calls to operate again.

Precondition
GDISP_NEED_STREAMING must be GFXON in your gfxconf.h
gdispStreamStart() has been called.
Note
If the gdispStreamStart() has not been called (or failed due to clipping), this call is simply ignored.
Parameters
[in]gThe display to use
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispGVerticalScroll()

void gdispGVerticalScroll ( GDisplay *  g,
gCoord  x,
gCoord  y,
gCoord  cx,
gCoord  cy,
int  lines,
gColor  bgcolor 
)

Scroll vertically a section of the screen.

Precondition
GDISP_NEED_SCROLL must be set to GFXON in gfxconf.h
Note
Optional.
If lines is >= cy, it is equivelent to an area fill with bgcolor.
Parameters
[in]gThe display to use
[in]x,yThe start of the area to be scrolled
[in]cx,cyThe size of the area to be scrolled
[in]linesThe number of lines to scroll (Can be positive or negative)
[in]bgcolorThe color to fill the newly exposed area.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispOpenFont()

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.

Returns
Returns a font or NULL if no matching font could be found.
Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Parameters
[in]nameThe font name to find.
Note
Wildcard matching will match the shortest possible match.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gdispScaleFont()

gFont gdispScaleFont ( gFont  font,
gU8  scale_x,
gU8  scale_y 
)

Make a scaled copy of an existing font.

Allocates memory for new font metadata using gfxAlloc, remember to close font after use!

Returns
A new font or NULL if out of memory.
Precondition
GDISP_NEED_TEXT must be GFXON in your gfxconf.h
Note
A scaled font should probably not be added to the font list as it will prevent the unscaled font of the same name being found as it will be the scaled version that will be found.
Parameters
[in]fontThe base font to use.
[in]scale_xThe scale factor in horizontal direction.
[in]scale_yThe scale factor in vertical direction.

◆ gdispSetDisplay()

void gdispSetDisplay ( GDisplay *  g)

Set the current default display to the specified display.

Note
The default display is used for the gdispXxxx functions.
The default display is contained in the variable GDISP. Using this function to set it protects against it being set to a NULL value.
If a NULL is passed for the dispay this call is ignored.
Parameters
[in]gThe display to use
Function Class: Normal API, this function can be invoked by regular system threads.

Variable Documentation

◆ GDISP

GDisplay* GDISP
extern

The default screen to use for the gdispXXXX calls.

Note
This is set by default to the first display in the system. You can change it by calling gdispSetDisplay().

Macro Definition Documentation

◆ GDISP_CONTROL_POWER

#define GDISP_CONTROL_POWER   0

Driver Control Constants.

Unsupported control codes are ignored.

Note
The value parameter should always be typecast to (void *).
There are some predefined and some specific to the low level driver.
GDISP_CONTROL_POWER - Takes a gPowermode GDISP_CONTROL_ORIENTATION - Takes a gdisp_orientation_t GDISP_CONTROL_BACKLIGHT - Takes an int from 0 to 100. For a driver that only supports off/on anything other than zero is on. GDISP_CONTROL_CONTRAST - Takes an int from 0 to 100. GDISP_CONTROL_LLD - Low level driver control constants start at this value.

Definition at line 151 of file gdisp.h.

◆ GDISP_DRIVER_LIST

#define GDISP_DRIVER_LIST   GDISPVMT_Win32, GDISPVMT_SSD1963

The list of display drivers.

Note
Replace this example with your own definition in your gfxconf.h file. See the gdisp_lld.c in each driver (near the top) to get the name of the VMT for a driver.
The same driver can occur more than once in the list to create an extra instance of that driver.
If defining this you must also define GDISP_PIXELFORMAT for your application to use. Choose a value that is most common accross all your drivers for efficiency.
If using this you may optionally define the GDISP_HARDWARE_xxx values as either GFXON or GFXOFF. Doing this causes GDISP to assume that all (GFXON) or none (GFXOFF) of the listed drivers have that capability. This can help improve drawing speed and efficiency.

Definition at line 277 of file gdisp_options.h.

◆ GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE

#define GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE   32

The BMP blit buffer size in pixels.

Defaults to 32 pixels

Note
Bigger is faster but requires more RAM.
This must be greater than 40 bytes and 32 pixels as we read our headers into this space as well.

Definition at line 398 of file gdisp_options.h.

◆ GDISP_IMAGE_GIF_BLIT_BUFFER_SIZE

#define GDISP_IMAGE_GIF_BLIT_BUFFER_SIZE   32

The GIF blit buffer size.

Defaults to 32

Note
Bigger is faster but requires more RAM.

Definition at line 413 of file gdisp_options.h.

◆ GDISP_IMAGE_PNG_BLIT_BUFFER_SIZE

#define GDISP_IMAGE_PNG_BLIT_BUFFER_SIZE   32

The PNG blit buffer size in pixels.

Defaults to 32

Note
Bigger is faster but requires more RAM.

Definition at line 542 of file gdisp_options.h.

◆ GDISP_IMAGE_PNG_FILE_BUFFER_SIZE

#define GDISP_IMAGE_PNG_FILE_BUFFER_SIZE   8

The PNG input file buffer size in bytes.

Defaults to 8

Note
Bigger is faster but requires more RAM.
Must be >= 8

Definition at line 551 of file gdisp_options.h.

◆ GDISP_IMAGE_PNG_Z_BUFFER_SIZE

#define GDISP_IMAGE_PNG_Z_BUFFER_SIZE   32768

The PNG inflate decompression buffer size in bytes.

Defaults to 32768

Note
Bigger is faster but requires more RAM.
Must be >= 32768 due to the PNG 32K sliding window.
More efficient code is generated if this value is a power of 2.

Definition at line 561 of file gdisp_options.h.

◆ GDISP_LINEBUF_SIZE

#define GDISP_LINEBUF_SIZE   128

Define the default orientation for all displays in the system.

Note
GDISP_NEED_CONTROL must also be set (and the hardware must support it)
If not specified then displays default to the native hardware orientation

The size of pixel buffer (in pixels) used for optimization.

Set to zero to guarantee disabling of the buffer.

Note
Depending on the driver and what operations the application needs, this buffer may never be allocated.
Setting the size to zero may cause some operations to not compile eg. Scrolling if there is no hardware scroll support.
Increasing the size will speedup certain operations at the expense of RAM.
Currently only used to support scrolling on hardware without scrolling support, and to increase the speed of streaming operations on non-streaming hardware where there is a hardware supported bit-blit.

Definition at line 249 of file gdisp_options.h.

◆ GDISP_NEED_ANTIALIAS

#define GDISP_NEED_ANTIALIAS   GFXOFF

Enable antialiased font support.

Defaults to GFXOFF

Definition at line 614 of file gdisp_options.h.

◆ GDISP_NEED_ARC

#define GDISP_NEED_ARC   GFXOFF

Are arc functions needed.

Defaults to GFXOFF

Note
This can be compiled using fully integer mathematics by defining GFX_USE_GMISC and GMISC_NEED_FIXEDTRIG as GFXON.
This can be compiled to use floating point but no trig functions by defining GFX_USE_GMISC and GMISC_NEED_FASTTRIG as GFXON.
If neither of the above are defined it requires the maths library to be included in the link to provide floating point and trig support. ie include -lm in your compiler flags.

Definition at line 132 of file gdisp_options.h.

◆ GDISP_NEED_ARCSECTORS

#define GDISP_NEED_ARCSECTORS   GFXOFF

Are arc sector functions needed.

Defaults to GFXOFF

Note
Uses integer algorithms only. It does not use any trig or floating point.

Definition at line 118 of file gdisp_options.h.

◆ GDISP_NEED_AUTOFLUSH

#define GDISP_NEED_AUTOFLUSH   GFXOFF

Should drawing operations be automatically flushed.

Defaults to GFXOFF

Note
If set to GFXOFF and the controller requires flushing then the application must manually call 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.
If GFXON and GDISP_NEED_TIMERFLUSH is also GFXON, this takes precedence.
Most controllers don't need flushing which is why this is set to GFXOFF by default.

Definition at line 36 of file gdisp_options.h.

◆ GDISP_NEED_CIRCLE

#define GDISP_NEED_CIRCLE   GFXOFF

Are circle functions needed.

Defaults to GFXOFF

Note
Uses integer algorithms only. It does not use any trig or floating point.

Definition at line 94 of file gdisp_options.h.

◆ GDISP_NEED_CLIP

#define GDISP_NEED_CLIP   GFXON

Are clipping functions needed.

Defaults to GFXON

Definition at line 71 of file gdisp_options.h.

◆ GDISP_NEED_CONTROL

#define GDISP_NEED_CONTROL   GFXOFF

Control some aspect of the hardware operation.

Defaults to GFXOFF

Note
This allows control of hardware specific features such as screen rotation, backlight levels, contrast etc

Definition at line 171 of file gdisp_options.h.

◆ GDISP_NEED_CONVEX_POLYGON

#define GDISP_NEED_CONVEX_POLYGON   GFXOFF

Are convex polygon functions needed.

Defaults to GFXOFF

Note
Convex polygons are those that have no internal angles. That is; you can draw a line from any point on the polygon to any other point on the polygon without it going outside the polygon.

Definition at line 142 of file gdisp_options.h.

◆ GDISP_NEED_DUALCIRCLE

#define GDISP_NEED_DUALCIRCLE   GFXOFF

Are dual circle functions needed (one circle inside another).

Defaults to GFXOFF

Note
Uses integer algorithms only. It does not use any trig or floating point.

Definition at line 102 of file gdisp_options.h.

◆ GDISP_NEED_ELLIPSE

#define GDISP_NEED_ELLIPSE   GFXOFF

Are ellipse functions needed.

Defaults to GFXOFF

Note
Uses integer algorithms only. It does not use any trig or floating point.

Definition at line 110 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE

#define GDISP_NEED_IMAGE   GFXOFF

Is the image interface required.

Defaults to GFXOFF

Definition at line 186 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_ACCOUNTING

#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.

◆ GDISP_NEED_IMAGE_BMP

#define GDISP_NEED_IMAGE_BMP   GFXOFF

Is BMP image decoding required.

Defaults to GFXOFF

Definition at line 305 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_BMP_1

#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.

◆ GDISP_NEED_IMAGE_BMP_16

#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.

◆ GDISP_NEED_IMAGE_BMP_24

#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.

◆ GDISP_NEED_IMAGE_BMP_32

#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.

◆ GDISP_NEED_IMAGE_BMP_4

#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.

◆ GDISP_NEED_IMAGE_BMP_4_RLE

#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.

◆ GDISP_NEED_IMAGE_BMP_8

#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.

◆ GDISP_NEED_IMAGE_BMP_8_RLE

#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.

◆ GDISP_NEED_IMAGE_GIF

#define GDISP_NEED_IMAGE_GIF   GFXOFF

Is GIF image decoding required.

Defaults to GFXOFF

Definition at line 298 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_JPG

#define GDISP_NEED_IMAGE_JPG   GFXOFF

Is JPG image decoding required.

Defaults to GFXOFF

Definition at line 312 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_NATIVE

#define GDISP_NEED_IMAGE_NATIVE   GFXOFF

Is native image decoding required.

Defaults to GFXOFF

Definition at line 291 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_PNG

#define GDISP_NEED_IMAGE_PNG   GFXOFF

Is PNG image decoding required.

Defaults to GFXOFF

Definition at line 319 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_PNG_ALPHACLIFF

#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

Note
If GDISP_NEED_IMAGE_PNG_BACKGROUND is GFXON and the PNG file contains a background color then the pixel will be blended with the background color according to the alpha. If not then no blending occurs. The pixel will either be set or not. Any alpha value greater or equal to this number will be displayed. Anything less than this number is not displayed.

Definition at line 457 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_PNG_BACKGROUND

#define GDISP_NEED_IMAGE_PNG_BACKGROUND   GFXON

Is PNG background data processed.

Defaults to GFXON

Note
If the background is specified in the image file and this define is GFXON, that background color is used for transparency and alpha blending.

Definition at line 444 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_PNG_GRAYALPHA_16

#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.

◆ GDISP_NEED_IMAGE_PNG_GRAYALPHA_8

#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.

◆ GDISP_NEED_IMAGE_PNG_GRAYSCALE_124

#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.

◆ GDISP_NEED_IMAGE_PNG_GRAYSCALE_16

#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.

◆ GDISP_NEED_IMAGE_PNG_GRAYSCALE_8

#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.

◆ GDISP_NEED_IMAGE_PNG_INTERLACED

#define GDISP_NEED_IMAGE_PNG_INTERLACED   GFXOFF

Is PNG Interlaced image decoding required.

Defaults to GFXOFF

Note
Currently not supported due to the complex decoding and display requirements

Definition at line 428 of file gdisp_options.h.

◆ GDISP_NEED_IMAGE_PNG_PALETTE_124

#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.

◆ GDISP_NEED_IMAGE_PNG_PALETTE_8

#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.

◆ GDISP_NEED_IMAGE_PNG_RGB_16

#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.

◆ GDISP_NEED_IMAGE_PNG_RGB_8

#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.

◆ GDISP_NEED_IMAGE_PNG_RGBALPHA_16

#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.

◆ GDISP_NEED_IMAGE_PNG_RGBALPHA_8

#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.

◆ GDISP_NEED_IMAGE_PNG_TRANSPARENCY

#define GDISP_NEED_IMAGE_PNG_TRANSPARENCY   GFXON

Is PNG image transparency processed.

Defaults to GFXON

Definition at line 435 of file gdisp_options.h.

◆ GDISP_NEED_MULTITHREAD

#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.

◆ GDISP_NEED_PIXELREAD

#define GDISP_NEED_PIXELREAD   GFXOFF

Is the capability to read pixels back needed.

Defaults to GFXOFF

Note
This function must be supported by the low level GDISP driver you have included in your project. If it isn't, defining this option will cause a compile error.

Definition at line 162 of file gdisp_options.h.

◆ GDISP_NEED_PIXMAP

#define GDISP_NEED_PIXMAP   GFXOFF

Is the image interface required.

Defaults to GFXOFF

Definition at line 193 of file gdisp_options.h.

◆ GDISP_NEED_QUERY

#define GDISP_NEED_QUERY   GFXOFF

Query some aspect of the hardware operation.

Defaults to GFXOFF

Note
This allows query of hardware specific features

Definition at line 179 of file gdisp_options.h.

◆ GDISP_NEED_SCROLL

#define GDISP_NEED_SCROLL   GFXOFF

Are scrolling functions needed.

Defaults to GFXOFF

Note
This function must be supported by the low level GDISP driver you have included in your project. If it isn't, defining this option will cause a compile error.

Definition at line 152 of file gdisp_options.h.

◆ GDISP_NEED_STARTUP_LOGO

#define GDISP_NEED_STARTUP_LOGO   GFXON

Should the startup logo be displayed.

Defaults to GFXON

Definition at line 220 of file gdisp_options.h.

◆ GDISP_NEED_STREAMING

#define GDISP_NEED_STREAMING   GFXOFF

Streaming functions are needed.

Defaults to GFXOFF.

Definition at line 78 of file gdisp_options.h.

◆ GDISP_NEED_TEXT

#define GDISP_NEED_TEXT   GFXOFF

Are text functions needed.

Defaults to GFXOFF

Note
You must also define at least one font.

Definition at line 86 of file gdisp_options.h.

◆ GDISP_NEED_TEXT_BOXPADLR

#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()

Note
Can be turned off by using gJustifyNoPad

Defaults to 1

Definition at line 584 of file gdisp_options.h.

◆ GDISP_NEED_TEXT_BOXPADTB

#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()

Note
Can be turned off by using gJustifyNoPad

Defaults to 1

Definition at line 593 of file gdisp_options.h.

◆ GDISP_NEED_TEXT_KERNING

#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.

◆ GDISP_NEED_TEXT_WORDWRAP

#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.

◆ GDISP_NEED_TIMERFLUSH

#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.

Note
The period should not be set too short or it will consume all your CPU. A value between 250 and 500 milliseconds would probably be suitable.
If GFXON and GDISP_NEED_AUTOFLUSH is also GFXON, this is ineffective.
Most controllers don't need flushing which is why this is set to GFXOFF by default.

Definition at line 48 of file gdisp_options.h.

◆ GDISP_NEED_UTF8

#define GDISP_NEED_UTF8   GFXOFF

Enable UTF-8 support for text rendering.

Defaults to GFXOFF

Definition at line 600 of file gdisp_options.h.

◆ GDISP_NEED_VALIDATION

#define GDISP_NEED_VALIDATION   GFXON

Should all operations be clipped to the screen and colors validated.

Defaults to GFXON.

Note
If this is GFXOFF, any operations that extend beyond the edge of the screen will have undefined results. Any out-of-range colors will produce undefined results.
This should always be left as the default (GFXON) unless you are a maniac for speed and you have thoroughly tested your code and it never overwrites the edges of the screen.
Setting GDISP_NEED_CLIP to GFXON internally uses the same mechanism as this validation. There is no advantage in setting this GFXOFF if GDISP_NEED_CLIP is GFXON.

Definition at line 64 of file gdisp_options.h.

◆ GDISP_STARTUP_COLOR

#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.

◆ GDISP_TOTAL_DISPLAYS

#define GDISP_TOTAL_DISPLAYS   1

The total number of displays using the default driver.

Note
If you want to use multiple displays either set GDISP_TOTAL_DISPLAYS or GDISP_DRIVER_LIST but not both.

Definition at line 263 of file gdisp_options.h.

◆ gdispGSetBacklight

#define gdispGSetBacklight (   g,
  percent 
)    gdispGControl((g), GDISP_CONTROL_BACKLIGHT, (void *)(unsigned)(percent))

Set the display backlight.

Note
Ignored if not supported by the display.
Parameters
[in]gThe display to use
[in]percentThe new brightness (0 - 100%)
Note
For displays that only support backlight off and on, 0 = off, anything else = on
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 1197 of file gdisp.h.

◆ gdispGSetContrast

#define gdispGSetContrast (   g,
  percent 
)    gdispGControl((g), GDISP_CONTROL_CONTRAST, (void *)(unsigned)(percent))

Set the display contrast.

Note
Ignored if not supported by the display.
Parameters
[in]gThe display to use
[in]percentThe new contrast (0 - 100%)
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 1209 of file gdisp.h.

◆ gdispGSetOrientation

#define gdispGSetOrientation (   g,
  newOrientation 
)    gdispGControl((g), GDISP_CONTROL_ORIENTATION, (void *)(unsigned)(newOrientation))

Set the display orientation.

Note
Ignored if not supported by the display.
Parameters
[in]gThe display to use
[in]newOrientationThe new orientation
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 1182 of file gdisp.h.

◆ gdispGSetPowerMode

#define gdispGSetPowerMode (   g,
  powerMode 
)    gdispGControl((g), GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode))

Set the display power mode.

Note
Ignored if not supported by the display.
Parameters
[in]gThe display to use
[in]powerModeThe new power mode
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 1170 of file gdisp.h.

◆ gdispGUnsetClip

#define gdispGUnsetClip (   g)    gdispGSetClip((g),0,0,gdispGGetWidth(g),gdispGGetHeight(g))

Reset the clip area to the full screen.

Parameters
[in]gThe display to use
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 1221 of file gdisp.h.

Typedef Documentation

◆ gCoord

typedef gI16 gCoord

The type for a coordinate or length on the screen.

Definition at line 39 of file gdisp.h.

◆ gFont

typedef const struct mf_font_s* gFont

The type of a font.

Definition at line 93 of file gdisp.h.

◆ gPixel

typedef gColor gPixel

The pixel format.

It generally defaults to the hardware pixel format.

Note
This doesn't need to match the hardware pixel format. It is definitely more efficient when it does.
When GDISP_DRIVER_LIST is defined, this must be explicitly defined and you should ensure the best match with your hardware across all devices.

Do pixels require packing for a blit

Note
Is only valid for a pixel format that doesn't fill it's datatype. eg formats: GDISP_PIXELFORMAT_RGB888 GDISP_PIXELFORMAT_RGB444 GDISP_PIXELFORMAT_RGB666 GDISP_PIXELFORMAT_CUSTOM
Very few cases should actually require packed pixels as the low level driver can also pack on the fly as it is sending it to the graphics device.
Packed pixels are not really supported at this point.

Do lines of pixels require packing for a blit

Note
Ignored if GDISP_PACKED_PIXELS is GFXOFF

The type of a pixel.

Definition at line 226 of file gdisp.h.

Enumeration Type Documentation

◆ gFontmetric

Type for the font metric.

Enumerator
gFontHeight 

The height of the font

gFontDescendersHeight 

The descenders height

gFontLineSpacing 

The line spacing

gFontCharPadding 

The char padding

gFontMinWidth 

The minimum width

gFontMaxWidth 

The maximum width

gFontBaselineX 

The base line in x direction

gFontBaselineY 

The base line in y direction

Definition at line 79 of file gdisp.h.

◆ gJustify

enum gJustify

Type for the text justification.

Enumerator
gJustifyLeft 

Justify Left (the default)

gJustifyCenter 

Justify Center

gJustifyRight 

Justify Right

gJustifyTop 

Justify Top

gJustifyMiddle 

Justify Middle (the default)

gJustifyBottom 

Justify Bottom

gJustifyWordWrap 

Word wrap (the default if GDISP_NEED_TEXT_WORDWRAP is on)

gJustifyNoWordWrap 

No word wrap

gJustifyPad 

Pad the text box (the default)

gJustifyNoPad 

No padding the text box

Definition at line 60 of file gdisp.h.

◆ gOrientation

Type for the screen orientation.

Note
gOrientationLandscape and gOrientationPortrait are internally converted to the most appropriate other orientation.
Enumerator
gOrientation0 

Don't rotate. This is the displays native orientation.

gOrientation90 

Rotate by 90 degrees absolute to the native rotation.

gOrientation180 

Rotate by 180 degrees absolute to the native rotation.

gOrientation270 

Rotate by 270 degrees absolute to the native rotation.

gOrientationPortrait 

Put the display into portrait mode.

gOrientationLandscape 

Put the display into landscape mode.

Definition at line 101 of file gdisp.h.

◆ gPowermode

enum gPowermode

Type for the available power modes for the screen.

Enumerator
gPowerOff 

Turn the display off.

gPowerSleep 

Put the display into sleep mode.

gPowerDeepSleep 

Put the display into deep-sleep mode.

gPowerOn 

Turn the display on.

Definition at line 114 of file gdisp.h.