version 2.8
gdisp.h File Reference

Detailed Description

GDISP Graphic Driver subsystem header file.

Definition in file gdisp.h.

#include "../../gfx.h"
#include "gdisp_colors.h"
#include "gdisp_image.h"
#include "gdisp_pixmap.h"

Go to the source code of this file.

Data Structures

struct  point
 Type for a 2D point on the screen. More...
 

Functions

color_t gdispBlendColor (color_t fg, color_t bg, uint8_t alpha)
 Blend 2 colors according to the alpha. More...
 
color_t gdispContrastColor (color_t 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...
 
coord_t gdispGGetWidth (GDisplay *g)
 Get the display width in pixels. More...
 
coord_t gdispGGetHeight (GDisplay *g)
 Get the display height in pixels. More...
 
powermode_t gdispGGetPowerMode (GDisplay *g)
 Get the current display power mode. More...
 
orientation_t gdispGGetOrientation (GDisplay *g)
 Get the current display orientation. More...
 
uint8_t gdispGGetBacklight (GDisplay *g)
 Get the current display backlight brightness. More...
 
uint8_t 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, color_t color)
 Clear the display to the specified color. More...
 
void gdispGDrawPixel (GDisplay *g, coord_t x, coord_t y, color_t color)
 Set a pixel in the specified color. More...
 
void gdispGDrawLine (GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color)
 Draw a line. More...
 
void gdispGFillArea (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color)
 Fill an area with a color. More...
 
void gdispGBlitArea (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer)
 Fill an area using the supplied bitmap. More...
 
void gdispGDrawBox (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color)
 Draw a rectangular box. More...
 
void gdispGStreamStart (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy)
 Start a streaming operation. More...
 
void gdispGStreamColor (GDisplay *g, color_t color)
 Send pixel data to the stream. More...
 
void gdispGStreamStop (GDisplay *g)
 Finish the current streaming operation. More...
 
void gdispGSetClip (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy)
 Clip all drawing to the defined area. More...
 
void gdispGDrawCircle (GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color)
 Draw a circle. More...
 
void gdispGFillCircle (GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color)
 Draw a filled circle. More...
 
void gdispGFillDualCircle (GDisplay *g, coord_t x, coord_t y, coord_t radius1, color_t color1, coord_t radius2, color_t color2)
 Draw two filled circles with the same centre. More...
 
void gdispGDrawEllipse (GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color)
 Draw an ellipse. More...
 
void gdispGFillEllipse (GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color)
 Draw a filled ellipse. More...
 
void gdispGDrawArcSectors (GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color)
 Draw a selection of 45 degree arcs of a circle. More...
 
void gdispGFillArcSectors (GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color)
 Fill a selection of 45 degree arcs of a circle. More...
 
void gdispGDrawArc (GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color)
 Draw an arc. More...
 
void gdispGDrawThickArc (GDisplay *g, coord_t xc, coord_t yc, coord_t startradius, coord_t endradius, coord_t startangle, coord_t endangle, color_t color)
 Draw a thick arc. More...
 
void gdispGFillArc (GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color)
 Draw a filled arc. More...
 
color_t gdispGGetPixelColor (GDisplay *g, coord_t x, coord_t y)
 Get the color of a pixel. More...
 
void gdispGVerticalScroll (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t 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, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt, color_t color)
 Draw an enclosed polygon (convex, non-convex or complex). More...
 
void gdispGFillConvexPoly (GDisplay *g, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt, color_t color)
 Fill a convex polygon. More...
 
void gdispGDrawThickLine (GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color, coord_t width, bool_t round)
 Draw a line with a specified thickness. More...
 
void gdispGDrawChar (GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color)
 Draw a text character. More...
 
void gdispGFillChar (GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor)
 Draw a text character with a filled background. More...
 
void gdispGDrawString (GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color)
 Draw a text string. More...
 
void gdispGFillString (GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color, color_t bgcolor)
 Draw a text string. More...
 
void gdispGDrawStringBox (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, const char *str, font_t font, color_t color, justify_t justify)
 Draw a text string vertically centered within the specified box. More...
 
void gdispGFillStringBox (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, const char *str, font_t font, color_t color, color_t bgColor, justify_t justify)
 Draw a text string vertically centered within the specified box. The box background is filled with the specified background color. More...
 
coord_t gdispGetFontMetric (font_t font, fontmetric_t metric)
 Get a metric of a font. More...
 
coord_t gdispGetCharWidth (char c, font_t font)
 Get the pixel width of a character. More...
 
coord_t gdispGetStringWidthCount (const char *str, font_t font, uint16_t count)
 Get the pixel width of a string of a given character length. More...
 
coord_t gdispGetStringWidth (const char *str, font_t font)
 Get the pixel width of an entire string. More...
 
font_t gdispOpenFont (const char *name)
 Find a font and return it. More...
 
void gdispCloseFont (font_t font)
 Release a font after use. More...
 
font_t gdispScaleFont (font_t font, uint8_t scale_x, uint8_t scale_y)
 Make a scaled copy of an existing font. More...
 
const char * gdispGetFontName (font_t font)
 Get the name of the specified font. More...
 
bool_t gdispAddFont (font_t font)
 Add a font permanently to the font list. More...
 
void gdispGDrawRoundedBox (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color)
 Draw a rectangular box with rounded corners. More...
 
void gdispGFillRoundedBox (GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color)
 Draw a filled rectangular box with rounded corners. More...
 

Variables

GDisplay * GDISP
 The default screen to use for the gdispXXXX calls. More...
 

Macros

#define GDISP_CONTROL_POWER   0
 Driver Control Constants. More...
 
#define gdispGSetPowerMode(g, powerMode)   gdispGControl((g), GDISP_CONTROL_POWER, (void *)(unsigned)(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 int16_t coord_t
 The type for a coordinate or length on the screen. More...
 
typedef const struct mf_font_s * font_t
 The type of a font. More...
 
typedef color_t pixel_t
 The pixel format. More...
 

Enumerations