Synopsis
typedef struct {
long (*get_parameter)(CTL_GFX_DRIVER_s *, int);
void (*draw_pixel)(CTL_GFX_DRIVER_s *, int , int);
void (*draw_line)(CTL_GFX_DRIVER_s *, int , int , int , int);
void (*fill_rectangle)(CTL_GFX_DRIVER_s *, int , int , int , int);
void (*draw_circle)(CTL_GFX_DRIVER_s *, int , int , int);
void (*fill_circle)(CTL_GFX_DRIVER_s *, int , int , int);
void (*draw_glyph)(CTL_GFX_DRIVER_s *, int , int , const CTL_GFX_GLYPH_t *);
void (*flush)(CTL_GFX_DRIVER_s *);
unsigned long (*convert_pixel)(unsigned);
void (*set_backlight)(CTL_GFX_DRIVER_s *, float);
void (*set_contrast)(CTL_GFX_DRIVER_s *, float);
int display_depth;
int display_width;
int display_height;
int visible_width;
int visible_height;
unsigned default_background;
unsigned default_foreground;
} CTL_GFX_DRIVER_t;
Description
CTL_GFX_DRIVER_t describes a graphics driver for an LCD or similar
display.
-
extra
- A place to store client-side data, not used by the graphics library.
-
get_parameter
- Low-level method to inquire graphics controller capabilities.
-
draw_pixel
- Method to draw a pixel at coordinate (x, y) using the
active pen color.
-
draw_line
- Method to draw a line from coordinate (x0, y0) to coordinate
(x1, y1) using the active pen color. The driver implementation
of this function does not need to distinguish horizontal and vertical
lines, that's detected done by higher-level functions.
-
fill_rectangle
- Method to fill a rectangle with top left (x0, y0) with width w
and height h. The driver implementation can assume w and
h and both non-zero and positive.
-
draw_circle
- Method to draw a circle with center coordinate (x, y) and
radius r in the active pen color.
-
fill_circle
- Method to fill a circle with center coordinate (x, y) and
radius r in the active pen color.
-
draw_glyph
- Method to draw a raster glyph glyph at coordinate (x, y).
-
flush
- Method to flush any outstanding graphics commands; may be zero to indicate
that flushing is not supported by the driver.
-
convert_pixel
- Method to convert a 24-bit RGB device-independent pixel to a
controller-dependent device pixel.
-
set_backlight
- Method to set the backlight level, 0 (dimmest) to 1 (brightest).
-
set_contrast
- Method to set the contrast level, 0 (lowest) to 1 (highest).
-
depth
- Cached color depth of display, in bits.