grlib.h
Go to the documentation of this file.
1 
2 #include <stdint.h>
3 #include <stdbool.h>
4 
5 #ifndef __GRLIB_H__
6 #define __GRLIB_H__
7 
8 #define NDEBUG
9 #include "assert.h"
10 
11 //*****************************************************************************
12 //
15 //
16 //*****************************************************************************
17 
18 //*****************************************************************************
19 //
20 // If building with a C++ compiler, make all of the definitions in this header
21 // have a C binding.
22 //
23 //*****************************************************************************
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 //*****************************************************************************
30 //
31 // Make sure min and max are defined.
32 //
33 //*****************************************************************************
34 #ifndef min
35 #define min(a, b) (((a) < (b)) ? (a) : (b))
36 #endif
37 
38 #ifndef max
39 #define max(a, b) (((a) < (b)) ? (b) : (a))
40 #endif
41 
42 //*****************************************************************************
43 //
45 //
46 //*****************************************************************************
47 typedef struct Graphics_Image
48 {
49  uint8_t bPP;
50  uint16_t xSize;
51  uint16_t ySize;
52  uint16_t numColors;
53  const uint32_t * pPalette;
54  const uint8_t * pPixel;
56 
57 //*****************************************************************************
58 //
62 //
63 //*****************************************************************************
64 typedef struct Graphics_Rectangle
65 {
66  int16_t xMin;
67  int16_t yMin;
68  int16_t xMax;
69  int16_t yMax;
71 
72 
73 //*****************************************************************************
74 //
76 //
77 //*****************************************************************************
78 typedef struct Graphics_Display
79 {
80  int32_t size;
81  void *displayData;
82  uint16_t width;
83  uint16_t heigth;
84  void (*callPixelDraw)(void *displayData, int16_t x, int16_t y,
85  uint16_t value);
86  void (*callPixelDrawMultiple)(void *displayData, int16_t x, int16_t y,
87  int16_t x0, int16_t count, int16_t bPP, const uint8_t *data,
88  const uint32_t *pucPalette);
89  void (*callLineDrawH)(void *displayData, int16_t x1, int16_t x2, int16_t y,
90  uint16_t value);
91  void (*callLineDrawV)(void *displayData, int16_t x, int16_t y1,
92  int16_t y2, uint16_t value);
93  void (*callRectFill)(void *displayData, const Graphics_Rectangle *rect,
94  uint16_t value);
95  uint32_t (*callColorTranslate)(void *displayData, uint32_t value);
96  void (*callFlush)(void *displayData);
97  void (*callClearDisplay)(void *displayData, uint16_t value);
99 
100 //*****************************************************************************
101 //
103 //
104 //*****************************************************************************
105 typedef struct Graphics_Font
106 {
107  uint8_t format;
108  uint8_t maxWidth;
109  uint8_t height;
110  uint8_t baseline;
111  uint16_t offset[96];
112  const uint8_t *data;
113 } Graphics_Font;
114 
115 //*****************************************************************************
116 //
125 //
126 //*****************************************************************************
127 typedef struct Graphics_FontEx
128 {
129  uint8_t format;
130  uint8_t maxWidth;
131  uint8_t height;
132  uint8_t baseline;
133  uint8_t first;
134  uint8_t last;
135  const uint16_t *offset;
136  const uint8_t *data;
138 
139 //*****************************************************************************
140 //
143 //
144 //*****************************************************************************
145 typedef struct Graphics_Context
146 {
147  int32_t size;
150  uint32_t foreground;
151  uint32_t background;
154 
155 //*****************************************************************************
156 //
157 // Deprecated struct names. These definitions ensure backwards compatibility
158 // but new code should avoid using deprecated struct names since these will
159 // be removed at some point in the future.
160 //
161 //*****************************************************************************
162 #define ClrAliceBlue GRAPHICS_COLOR_ALICE_BLUE
163 #define ClrAntiqueWhite GRAPHICS_COLOR_ANTIQUE_WHITE
164 #define ClrAqua GRAPHICS_COLOR_AQUA
165 #define ClrAquamarine GRAPHICS_COLOR_AQUAMARINE
166 #define ClrAzure GRAPHICS_COLOR_AZURE
167 #define ClrBeige GRAPHICS_COLOR_BEIGE
168 #define ClrBisque GRAPHICS_COLOR_BISQUE
169 #define ClrBlack GRAPHICS_COLOR_BLACK
170 #define ClrBlanchedAlmond GRAPHICS_COLOR_BLANCHED_ALMOND
171 #define ClrBlue GRAPHICS_COLOR_BLUE
172 #define ClrBlueViolet GRAPHICS_COLOR_BLUE_VIOLET
173 #define ClrBrown GRAPHICS_COLOR_BROWN
174 #define ClrBurlyWood GRAPHICS_COLOR_BURLY_WOOD
175 #define ClrCadetBlue GRAPHICS_COLOR_CADET_BLUE
176 #define ClrChartreuse GRAPHICS_COLOR_CHARTREUSE
177 #define ClrChocolate GRAPHICS_COLOR_CHOCOLATE
178 #define ClrCoral GRAPHICS_COLOR_CORAL
179 #define ClrCornflowerBlue GRAPHICS_COLOR_CORNFLOWER_BLUE
180 #define ClrCornsilk GRAPHICS_COLOR_CORNSILK
181 #define ClrCrimson GRAPHICS_COLOR_CRIMSON
182 #define ClrCyan GRAPHICS_COLOR_CYAN
183 #define ClrDarkBlue GRAPHICS_COLOR_DARK_BLUE
184 #define ClrDarkCyan GRAPHICS_COLOR_DARK_CYAN
185 #define ClrDarkGoldenrod GRAPHICS_COLOR_DARK_GOLDENROD
186 #define ClrDarkGray GRAPHICS_COLOR_DARK_GRAY
187 #define ClrDarkGreen GRAPHICS_COLOR_DARK_GREEN
188 #define ClrDarkKhaki GRAPHICS_COLOR_DARK_KHAKI
189 #define ClrDarkMagenta GRAPHICS_COLOR_DARK_MAGENTA
190 #define ClrDarkOliveGreen GRAPHICS_COLOR_DARK_OLIVE_GREEN
191 #define ClrDarkOrange GRAPHICS_COLOR_DARK_ORANGE
192 #define ClrDarkOrchid GRAPHICS_COLOR_DARK_ORCHID
193 #define ClrDarkRed GRAPHICS_COLOR_DARK_RED
194 #define ClrDarkSalmon GRAPHICS_COLOR_DARK_SALMON
195 #define ClrDarkSeaGreen GRAPHICS_COLOR_DARK_SEA_GREEN
196 #define ClrDarkSlateBlue GRAPHICS_COLOR_DARK_SLATE_BLUE
197 #define ClrDarkSlateGray GRAPHICS_COLOR_DARK_SLATE_GRAY
198 #define ClrDarkTurquoise GRAPHICS_COLOR_DARK_TURQUOISE
199 #define ClrDarkViolet GRAPHICS_COLOR_DARK_VIOLET
200 #define ClrDeepPink GRAPHICS_COLOR_DEEP_PINK
201 #define ClrDeepSkyBlue GRAPHICS_COLOR_DEEP_SKY_BLUE
202 #define ClrDimGray GRAPHICS_COLOR_DIM_GRAY
203 #define ClrDodgerBlue GRAPHICS_COLOR_DODGER_BLUE
204 #define ClrFireBrick GRAPHICS_COLOR_FIRE_BRICK
205 #define ClrFloralWhite GRAPHICS_COLOR_FLORAL_WHITE
206 #define ClrForestGreen GRAPHICS_COLOR_FOREST_GREEN
207 #define ClrFuchsia GRAPHICS_COLOR_FUCHSIA
208 #define ClrGainsboro GRAPHICS_COLOR_GAINSBORO
209 #define ClrGhostWhite GRAPHICS_COLOR_GHOST_WHITE
210 #define ClrGold GRAPHICS_COLOR_GOLD
211 #define ClrGoldenrod GRAPHICS_COLOR_GOLDENRON
212 #define ClrGray GRAPHICS_COLOR_GRAY
213 #define ClrGreen GRAPHICS_COLOR_GREEN
214 #define ClrGreenYellow GRAPHICS_COLOR_GREEN_YELLOW
215 #define ClrHoneydew GRAPHICS_COLOR_HONEYDEW
216 #define ClrHotPink GRAPHICS_COLOR_HOT_PINK
217 #define ClrIndianRed GRAPHICS_COLOR_INDIAN_RED
218 #define ClrIndigo GRAPHICS_COLOR_INDIGO
219 #define ClrIvory GRAPHICS_COLOR_IVORY
220 #define ClrKhaki GRAPHICS_COLOR_KHAKI
221 #define ClrLavender GRAPHICS_COLOR_LAVENDER
222 #define ClrLavenderBlush GRAPHICS_COLOR_LAVENDER_BLUSH
223 #define ClrLawnGreen GRAPHICS_COLOR_LAWN_GREEN
224 #define ClrLemonChiffon GRAPHICS_COLOR_LEMON_CHIFFON
225 #define ClrLightBlue GRAPHICS_COLOR_LIGHT_BLUE
226 #define ClrLightCoral GRAPHICS_COLOR_LIGHT_CORAL
227 #define ClrLightCyan GRAPHICS_COLOR_LIGHT_CYAN
228 #define ClrLightGoldenrodYellow GRAPHICS_COLOR_LIGHT_GOLDENRON_YELLOW
229 #define ClrLightGreen GRAPHICS_COLOR_LIGHT_GREEN
230 #define ClrLightGrey GRAPHICS_COLOR_LIGHT_GRAY
231 #define ClrLightPink GRAPHICS_COLOR_LIGHT_PINK
232 #define ClrLightSalmon GRAPHICS_COLOR_LIGHT_SALMON
233 #define ClrLightSeaGreen GRAPHICS_COLOR_LIGHT_SEA_GREEN
234 #define ClrLightSkyBlue GRAPHICS_COLOR_LIGHT_SKY_BLUE
235 #define ClrLightSlateGray GRAPHICS_COLOR_LIGHT_SLATE_GRAY
236 #define ClrLightSteelBlue GRAPHICS_COLOR_LIGHT_STEEL_BLUE
237 #define ClrLightYellow GRAPHICS_COLOR_LIGHT_YELLOW
238 #define ClrLime GRAPHICS_COLOR_LIME
239 #define ClrLimeGreen GRAPHICS_COLOR_LIME_GREEN
240 #define ClrLinen GRAPHICS_COLOR_LINEN
241 #define ClrMagenta GRAPHICS_COLOR_MAGENTA
242 #define ClrMaroon GRAPHICS_COLOR_MAROON
243 #define ClrMediumAquamarine GRAPHICS_COLOR_MEDIUM_AQUAMARINE
244 #define ClrMediumBlue GRAPHICS_COLOR_MEDIUM_BLUE
245 #define ClrMediumOrchid GRAPHICS_COLOR_MEDIUM_ORCHID
246 #define ClrMediumPurple GRAPHICS_COLOR_MEDIUM_PURPLE
247 #define ClrMediumSeaGreen GRAPHICS_COLOR_MEDIUM_SEA_GREEN
248 #define ClrMediumSlateBlue GRAPHICS_COLOR_MEDIUM_SLATE_BLUE
249 #define ClrMediumSpringGreen GRAPHICS_COLOR_MEDIUM_SPRING_GREEN
250 #define ClrMediumTurquoise GRAPHICS_COLOR_MEDIUM_TURQUOISE
251 #define ClrMediumVioletRed GRAPHICS_COLOR_MEDIUM_VIOLET_RED
252 #define ClrMidnightBlue GRAPHICS_COLOR_MIGNIGHT_BLUE
253 #define ClrMintCream GRAPHICS_COLOR_MINT_CREAM
254 #define ClrMistyRose GRAPHICS_COLOR_MISTY_ROSE
255 #define ClrMoccasin GRAPHICS_COLOR_MOCCASIN
256 #define ClrNavajoWhite GRAPHICS_COLOR_NAVAJO_WHITE
257 #define ClrNavy GRAPHICS_COLOR_NAVY
258 #define ClrOldLace GRAPHICS_COLOR_OLD_LACE
259 #define ClrOlive GRAPHICS_COLOR_OLIVE
260 #define ClrOliveDrab GRAPHICS_COLOR_OLIVE_DRAB
261 #define ClrOrange GRAPHICS_COLOR_ORANGE
262 #define ClrOrangeRed GRAPHICS_COLOR_ORANGE_RED
263 #define ClrOrchid GRAPHICS_COLOR_ORCHID
264 #define ClrPaleGoldenrod GRAPHICS_COLOR_PALE_GOLDENRON
265 #define ClrPaleGreen GRAPHICS_COLOR_PALE_GREEN
266 #define ClrPaleTurquoise GRAPHICS_COLOR_PALE_TURQUOISE
267 #define ClrPaleVioletRed GRAPHICS_COLOR_PALE_VIOLET_RED
268 #define ClrPapayaWhip GRAPHICS_COLOR_PAPAYA_WHIP
269 #define ClrPeachPuff GRAPHICS_COLOR_PEACH_PUFF
270 #define ClrPeru GRAPHICS_COLOR_PERU
271 #define ClrPink GRAPHICS_COLOR_PINK
272 #define ClrPlum GRAPHICS_COLOR_PLUM
273 #define ClrPowderBlue GRAPHICS_COLOR_POWDER_BLUE
274 #define ClrPurple GRAPHICS_COLOR_PURPLE
275 #define ClrRed GRAPHICS_COLOR_RED
276 #define ClrRosyBrown GRAPHICS_COLOR_ROSY_BROWN
277 #define ClrRoyalBlue GRAPHICS_COLOR_ROYAL_BLUE
278 #define ClrSaddleBrown GRAPHICS_COLOR_SADDLE_BROWN
279 #define ClrSalmon GRAPHICS_COLOR_SALMON
280 #define ClrSandyBrown GRAPHICS_COLOR_SANDY_BROWN
281 #define ClrSeaGreen GRAPHICS_COLOR_SEA_GREEN
282 #define ClrSeashell GRAPHICS_COLOR_SEASHELL
283 #define ClrSienna GRAPHICS_COLOR_SIENNA
284 #define ClrSilver GRAPHICS_COLOR_SILVER
285 #define ClrSkyBlue GRAPHICS_COLOR_SKY_BLUE
286 #define ClrSlateBlue GRAPHICS_COLOR_SLATE_BLUE
287 #define ClrSlateGray GRAPHICS_COLOR_SLATE_GRAY
288 #define ClrSnow GRAPHICS_COLOR_SNOW
289 #define ClrSpringGreen GRAPHICS_COLOR_SPRING_GREEN
290 #define ClrSteelBlue GRAPHICS_COLOR_STEEL_BLUE
291 #define ClrTan GRAPHICS_COLOR_TAN
292 #define ClrTeal GRAPHICS_COLOR_TEAL
293 #define ClrThistle GRAPHICS_COLOR_THISTLE
294 #define ClrTomato GRAPHICS_COLOR_TOMATO
295 #define ClrTurquoise GRAPHICS_COLOR_TURQUOISE
296 #define ClrViolet GRAPHICS_COLOR_VIOLET
297 #define ClrWheat GRAPHICS_COLOR_WHEAT
298 #define ClrWhite GRAPHICS_COLOR_WHITE
299 #define ClrWhiteSmoke GRAPHICS_COLOR_WHITE_SMOKE
300 #define ClrYellow GRAPHICS_COLOR_YELLOW
301 #define ClrYellowGreen GRAPHICS_COLOR_YELLOW_GREEN
302 #define ClrBlack GRAPHICS_COLOR_BLACK
303 #define FONT_FMT_UNCOMPRESSED GRAPHICS_FONT_FMT_UNCOMPRESSED
304 #define FONT_FMT_PIXEL_RLE GRAPHICS_FONT_FMT_PIXEL_RLE
305 #define FONT_EX_MARKER GRAPHICS_FONT_EX_MARKER
306 #define FONT_FMT_EX_UNCOMPRESSED GRAPHICS_FONT_FMT_EX_UNCOMPRESSED
307 #define FONT_FMT_EX_PIXEL_RLE GRAPHICS_FONT_FMT_EX_PIXEL_RLE
308 #define AUTO_STRING_LENGTH GRAPHICS_AUTO_STRING_LENGTH
309 #define OPAQUE_TEXT GRAPHICS_OPAQUE_TEXT
310 #define TRANSPARENT_TEXT GRAPHICS_TRANSPARENT_TEXT
311 #define IMAGE_FMT_1BPP_UNCOMP GRAPHICS_IMAGE_FMT_1BPP_UNCOMP
312 #define IMAGE_FMT_2BPP_UNCOMP GRAPHICS_IMAGE_FMT_2BPP_UNCOMP
313 #define IMAGE_FMT_4BPP_UNCOMP GRAPHICS_IMAGE_FMT_4BPP_UNCOMP
314 #define IMAGE_FMT_8BPP_UNCOMP GRAPHICS_IMAGE_FMT_8BPP_UNCOMP
315 #define IMAGE_FMT_1BPP_COMP_RLE4 GRAPHICS_IMAGE_FMT_1BPP_COMP_RLE4
316 #define IMAGE_FMT_2BPP_UNCOMP GRAPHICS_IMAGE_FMT_2BPP_UNCOMP
317 #define IMAGE_FMT_4BPP_COMP_RLE4 GRAPHICS_IMAGE_FMT_4BPP_COMP_RLE4
318 #define IMAGE_FMT_1BPP_COMP_RLE8 GRAPHICS_IMAGE_FMT_1BPP_COMP_RLE8
319 #define IMAGE_FMT_2BPP_COMP_RLE8 GRAPHICS_IMAGE_FMT_2BPP_COMP_RLE8
320 #define IMAGE_FMT_4BPP_COMP_RLE8 GRAPHICS_IMAGE_FMT_4BPP_COMP_RLE8
321 #define IMAGE_FMT_8BPP_COMP_RLE8 GRAPHICS_IMAGE_FMT_8BPP_COMP_RLE8
322 #define IMAGE_FMT_8BPP_COMP_RLEBLEND GRAPHICS_IMAGE_FMT_8BPP_COMP_RLEBLEND
323 #define tFontEx Graphics_FontEx
324 #define tFont Graphics_Font
325 #define tDisplay Graphics_Display
326 #define tRectangle Graphics_Rectangle
327 #define tImage Graphics_Image
328 #define tContext Graphics_Context
329 #define sXMax xMax
330 #define sXMin xMin
331 #define sYMax yMax
332 #define sYMin yMin
333 
334 //*****************************************************************************
335 //
336 // Deprecated function names. These definitions ensure backwards compatibility
337 // but new code should avoid using deprecated function names since these will
338 // be removed at some point in the future.
339 //
340 //*****************************************************************************
341 #define GrCircleDraw Graphics_drawCircle
342 #define GrCircleFill Graphics_fillCircle
343 #define GrContextClipRegionSet Graphics_setClipRegion
344 #define GrContextInit Graphics_initContext
345 #define GrImageDraw Graphics_drawImage
346 #define GrLineDraw Graphics_drawLine
347 #define GrLineDrawH Graphics_drawLineH
348 #define GrLineDrawV Graphics_drawLineV
349 #define GrRectDraw Graphics_drawRectangle
350 #define GrRectFill Graphics_fillRectangle
351 #define GrStringDraw Graphics_drawString
352 #define GrStringWidthGet Graphics_getStringWidth
353 #define GrRectOverlapCheck Graphics_isOverlappingRectangle
354 #define GrRectIntersectGet Graphics_getRectangleIntersection
355 #define GrContextBackgroundSet Graphics_setBackgroundColor
356 #define GrContextBackgroundSetTranslated Graphics_setBackgroundColorTranslated
357 #define GrContextDpyWidthGet Graphics_getDisplayWidth
358 #define GrContextDpyHeightGet Graphics_getDisplayHeight
359 #define GrContextFontSet Graphics_setFont
360 #define GrContextForegroundSet Graphics_setForegroundColor
361 #define GrContextForegroundSetTranslated Graphics_setForegroundColorTranslated
362 #define GrFlush Graphics_flushBuffer
363 #define GrClearDisplay Graphics_clearDisplay
364 #define GrFontBaselineGet Graphics_getFontBaseline
365 #define GrFontHeightGet Graphics_getFontHeight
366 #define GrFontMaxWidthGet Graphics_getFontMaxWidth
367 #define GrImageColorsGet Graphics_getImageColors
368 #define GrImageHeightGet Graphics_getImageHeight
369 #define GrImageWidthGet Graphics_getImageWidth
370 #define GrOffScreen1BPPSize Graphics_getOffscreen1BppImageSize
371 #define GrOffScreen4BPPSize Graphics_getOffscreen4BppImageSize
372 #define GrOffScreen8BPPSize Graphics_getOffscreen8BppImageSize
373 #define GrPixelDraw Graphics_drawPixel
374 #define GrStringBaselineGet Graphics_getStringBaseline
375 #define GrStringDrawCentered Graphics_drawStringCentered
376 #define GrStringHeightGet Graphics_getStringHeight
377 #define GrStringMaxWidthGet Graphics_getStringMaxWidth
378 #define DpyColorTranslate Graphics_translateColorOnDisplay
379 #define DpyFlush Graphics_flushOnDisplay
380 #define DpyClearDisplay Graphics_clearDisplayOnDisplay
381 #define DpyHeightGet Graphics_getHeightOfDisplay
382 #define DpyLineDrawH Graphics_drawHorizontalLineOnDisplay
383 #define DpyLineDrawV Graphics_drawVerticalLineOnDisplay
384 #define DpyPixelDraw Graphics_drawPixelOnDisplay
385 #define DpyPixelDrawMultiple Graphics_drawMultiplePixelsOnDisplay
386 #define DpyRectFill Graphics_fillRectangleOnDisplay
387 #define DpyWidthGet Graphics_getWidthOfDisplay
388 #define GrRectContainsPoint Graphics_isPointWithinRectangle
389 
390 //*****************************************************************************
391 //
393 //
394 //*****************************************************************************
395 #define GRAPHICS_FONT_FMT_UNCOMPRESSED 0x00
396 
397 //*****************************************************************************
398 //
400 //
401 //*****************************************************************************
402 #define GRAPHICS_FONT_FMT_PIXEL_RLE 0x01
403 
404 //*****************************************************************************
405 //
408 //
409 //*****************************************************************************
410 #define GRAPHICS_FONT_EX_MARKER 0x80
411 
412 //*****************************************************************************
413 //
416 //
417 //*****************************************************************************
418 #define GRAPHICS_FONT_FMT_EX_UNCOMPRESSED (FONT_FMT_UNCOMPRESSED | FONT_EX_MARKER)
419 
420 //*****************************************************************************
421 //
424 //
425 //*****************************************************************************
426 #define GRAPHICS_FONT_FMT_EX_PIXEL_RLE (FONT_FMT_PIXEL_RLE | FONT_EX_MARKER)
427 
428 //*****************************************************************************
429 //
432 //
433 //*****************************************************************************
434 #define GRAPHICS_AUTO_STRING_LENGTH -1
435 
436 //*****************************************************************************
437 //
440 //
441 //*****************************************************************************
442 #define GRAPHICS_OPAQUE_TEXT 1
443 
444 //*****************************************************************************
445 //
448 //
449 //*****************************************************************************
450 #define GRAPHICS_TRANSPARENT_TEXT 0
451 
452 //*****************************************************************************
453 //
456 //
457 //*****************************************************************************
458 #define GRAPHICS_IMAGE_FMT_1BPP_UNCOMP 0x01
459 
460 //*****************************************************************************
461 //
464 //
465 //*****************************************************************************
466 #define GRAPHICS_IMAGE_FMT_2BPP_UNCOMP 0x02
467 
468 //*****************************************************************************
469 //
472 //
473 //*****************************************************************************
474 #define GRAPHICS_IMAGE_FMT_4BPP_UNCOMP 0x04
475 
476 //*****************************************************************************
477 //
480 //
481 //*****************************************************************************
482 #define GRAPHICS_IMAGE_FMT_8BPP_UNCOMP 0x08
483 
484 //*****************************************************************************
485 //
488 //
489 //*****************************************************************************
490 #define GRAPHICS_IMAGE_FMT_1BPP_COMP_RLE4 0x41
491 
492 //*****************************************************************************
493 //
496 //
497 //*****************************************************************************
498 #define GRAPHICS_IMAGE_FMT_2BPP_COMP_RLE4 0x42
499 
500 //*****************************************************************************
501 //
504 //
505 //*****************************************************************************
506 #define GRAPHICS_IMAGE_FMT_4BPP_COMP_RLE4 0x44
507 
508 //*****************************************************************************
509 //
512 //
513 //*****************************************************************************
514 #define GRAPHICS_IMAGE_FMT_1BPP_COMP_RLE8 0x81
515 
516 //*****************************************************************************
517 //
520 //
521 //*****************************************************************************
522 #define GRAPHICS_IMAGE_FMT_2BPP_COMP_RLE8 0x82
523 
524 //*****************************************************************************
525 //
528 //
529 //*****************************************************************************
530 #define GRAPHICS_IMAGE_FMT_4BPP_COMP_RLE8 0x84
531 
532 //*****************************************************************************
533 //
536 //
537 //*****************************************************************************
538 #define GRAPHICS_IMAGE_FMT_8BPP_COMP_RLE8 0x88
539 
540 //*****************************************************************************
541 //
544 //
545 //*****************************************************************************
546 #define GRAPHICS_IMAGE_FMT_8BPP_COMP_RLEBLEND 0x28
547 
548 //*****************************************************************************
549 //
550 // A set of color definitions. This set is the subset of the X11 colors (from
551 // rgb.txt) that are supported by typical web browsers.
552 //
553 //*****************************************************************************
554 #define GRAPHICS_COLOR_ALICE_BLUE 0x00F0F8FF
555 #define GRAPHICS_COLOR_ANTIQUE_WHITE 0x00FAEBD7
556 #define GRAPHICS_COLOR_AQUA 0x0000FFFF
557 #define GRAPHICS_COLOR_AQUAMARINE 0x007FFFD4
558 #define GRAPHICS_COLOR_AZURE 0x00F0FFFF
559 #define GRAPHICS_COLOR_BEIGE 0x00F5F5DC
560 #define GRAPHICS_COLOR_BISQUE 0x00FFE4C4
561 #define GRAPHICS_COLOR_BLACK 0x00000000
562 #define GRAPHICS_COLOR_BLANCHED_ALMOND 0x00FFEBCD
563 #define GRAPHICS_COLOR_BLUE 0x000000FF
564 #define GRAPHICS_COLOR_BLUE_VIOLET 0x008A2BE2
565 #define GRAPHICS_COLOR_BROWN 0x00A52A2A
566 #define GRAPHICS_COLOR_BURLY_WOOD 0x00DEB887
567 #define GRAPHICS_COLOR_CADET_BLUE 0x005F9EA0
568 #define GRAPHICS_COLOR_CHARTREUSE 0x007FFF00
569 #define GRAPHICS_COLOR_CHOCOLATE 0x00D2691E
570 #define GRAPHICS_COLOR_CORAL 0x00FF7F50
571 #define GRAPHICS_COLOR_CORNFLOWER_BLUE 0x006495ED
572 #define GRAPHICS_COLOR_CORNSILK 0x00FFF8DC
573 #define GRAPHICS_COLOR_CRIMSON 0x00DC143C
574 #define GRAPHICS_COLOR_CYAN 0x0000FFFF
575 #define GRAPHICS_COLOR_DARK_BLUE 0x0000008B
576 #define GRAPHICS_COLOR_DARK_CYAN 0x00008B8B
577 #define GRAPHICS_COLOR_DARK_GOLDENROD 0x00B8860B
578 #define GRAPHICS_COLOR_DARK_GRAY 0x00A9A9A9
579 #define GRAPHICS_COLOR_DARK_GREEN 0x00006400
580 #define GRAPHICS_COLOR_DARK_KHAKI 0x00BDB76B
581 #define GRAPHICS_COLOR_DARK_MAGENTA 0x008B008B
582 #define GRAPHICS_COLOR_DARK_OLIVE_GREEN 0x00556B2F
583 #define GRAPHICS_COLOR_DARK_ORANGE 0x00FF8C00
584 #define GRAPHICS_COLOR_DARK_ORCHID 0x009932CC
585 #define GRAPHICS_COLOR_DARK_RED 0x008B0000
586 #define GRAPHICS_COLOR_DARK_SALMON 0x00E9967A
587 #define GRAPHICS_COLOR_DARK_SEA_GREEN 0x008FBC8F
588 #define GRAPHICS_COLOR_DARK_SLATE_BLUE 0x00483D8B
589 #define GRAPHICS_COLOR_DARK_SLATE_GRAY 0x002F4F4F
590 #define GRAPHICS_COLOR_DARK_TURQUOISE 0x0000CED1
591 #define GRAPHICS_COLOR_DARK_VIOLET 0x009400D3
592 #define GRAPHICS_COLOR_DEEP_PINK 0x00FF1493
593 #define GRAPHICS_COLOR_DEEP_SKY_BLUE 0x0000BFFF
594 #define GRAPHICS_COLOR_DIM_GRAY 0x00696969
595 #define GRAPHICS_COLOR_DODGER_BLUE 0x001E90FF
596 #define GRAPHICS_COLOR_FIRE_BRICK 0x00B22222
597 #define GRAPHICS_COLOR_FLORAL_WHITE 0x00FFFAF0
598 #define GRAPHICS_COLOR_FOREST_GREEN 0x00228B22
599 #define GRAPHICS_COLOR_FUCHSIA 0x00FF00FF
600 #define GRAPHICS_COLOR_GAINSBORO 0x00DCDCDC
601 #define GRAPHICS_COLOR_GHOST_WHITE 0x00F8F8FF
602 #define GRAPHICS_COLOR_GOLD 0x00FFD700
603 #define GRAPHICS_COLOR_GOLDENRON 0x00DAA520
604 #define GRAPHICS_COLOR_GRAY 0x00808080
605 #define GRAPHICS_COLOR_GREEN 0x00008000
606 #define GRAPHICS_COLOR_GREEN_YELLOW 0x00ADFF2F
607 #define GRAPHICS_COLOR_HONEYDEW 0x00F0FFF0
608 #define GRAPHICS_COLOR_HOT_PINK 0x00FF69B4
609 #define GRAPHICS_COLOR_INDIAN_RED 0x00CD5C5C
610 #define GRAPHICS_COLOR_INDIGO 0x004B0082
611 #define GRAPHICS_COLOR_IVORY 0x00FFFFF0
612 #define GRAPHICS_COLOR_KHAKI 0x00F0E68C
613 #define GRAPHICS_COLOR_LAVENDER 0x00E6E6FA
614 #define GRAPHICS_COLOR_LAVENDER_BLUSH 0x00FFF0F5
615 #define GRAPHICS_COLOR_LAWN_GREEN 0x007CFC00
616 #define GRAPHICS_COLOR_LEMON_CHIFFON 0x00FFFACD
617 #define GRAPHICS_COLOR_LIGHT_BLUE 0x00ADD8E6
618 #define GRAPHICS_COLOR_LIGHT_CORAL 0x00F08080
619 #define GRAPHICS_COLOR_LIGHT_CYAN 0x00E0FFFF
620 #define GRAPHICS_COLOR_LIGHT_GOLDENRON_YELLOW 0x00FAFAD2
621 #define GRAPHICS_COLOR_LIGHT_GREEN 0x0090EE90
622 #define GRAPHICS_COLOR_LIGHT_GRAY 0x00D3D3D3
623 #define GRAPHICS_COLOR_LIGHT_PINK 0x00FFB6C1
624 #define GRAPHICS_COLOR_LIGHT_SALMON 0x00FFA07A
625 #define GRAPHICS_COLOR_LIGHT_SEA_GREEN 0x0020B2AA
626 #define GRAPHICS_COLOR_LIGHT_SKY_BLUE 0x0087CEFA
627 #define GRAPHICS_COLOR_LIGHT_SLATE_GRAY 0x00778899
628 #define GRAPHICS_COLOR_LIGHT_STEEL_BLUE 0x00B0C4DE
629 #define GRAPHICS_COLOR_LIGHT_YELLOW 0x00FFFFE0
630 #define GRAPHICS_COLOR_LIME 0x0000FF00
631 #define GRAPHICS_COLOR_LIME_GREEN 0x0032CD32
632 #define GRAPHICS_COLOR_LINEN 0x00FAF0E6
633 #define GRAPHICS_COLOR_MAGENTA 0x00FF00FF
634 #define GRAPHICS_COLOR_MAROON 0x00800000
635 #define GRAPHICS_COLOR_MEDIUM_AQUAMARINE 0x0066CDAA
636 #define GRAPHICS_COLOR_MEDIUM_BLUE 0x000000CD
637 #define GRAPHICS_COLOR_MEDIUM_ORCHID 0x00BA55D3
638 #define GRAPHICS_COLOR_MEDIUM_PURPLE 0x009370DB
639 #define GRAPHICS_COLOR_MEDIUM_SEA_GREEN 0x003CB371
640 #define GRAPHICS_COLOR_MEDIUM_SLATE_BLUE 0x007B68EE
641 #define GRAPHICS_COLOR_MEDIUM_SPRING_GREEN 0x0000FA9A
642 #define GRAPHICS_COLOR_MEDIUM_TURQUOISE 0x0048D1CC
643 #define GRAPHICS_COLOR_MEDIUM_VIOLET_RED 0x00C71585
644 #define GRAPHICS_COLOR_MIGNIGHT_BLUE 0x00191970
645 #define GRAPHICS_COLOR_MINT_CREAM 0x00F5FFFA
646 #define GRAPHICS_COLOR_MISTY_ROSE 0x00FFE4E1
647 #define GRAPHICS_COLOR_MOCCASIN 0x00FFE4B5
648 #define GRAPHICS_COLOR_NAVAJO_WHITE 0x00FFDEAD
649 #define GRAPHICS_COLOR_NAVY 0x00000080
650 #define GRAPHICS_COLOR_OLD_LACE 0x00FDF5E6
651 #define GRAPHICS_COLOR_OLIVE 0x00808000
652 #define GRAPHICS_COLOR_OLIVE_DRAB 0x006B8E23
653 #define GRAPHICS_COLOR_ORANGE 0x00FFA500
654 #define GRAPHICS_COLOR_ORANGE_RED 0x00FF4500
655 #define GRAPHICS_COLOR_ORCHID 0x00DA70D6
656 #define GRAPHICS_COLOR_PALE_GOLDENRON 0x00EEE8AA
657 #define GRAPHICS_COLOR_PALE_GREEN 0x0098FB98
658 #define GRAPHICS_COLOR_PALE_TURQUOISE 0x00AFEEEE
659 #define GRAPHICS_COLOR_PALE_VIOLET_RED 0x00DB7093
660 #define GRAPHICS_COLOR_PAPAYA_WHIP 0x00FFEFD5
661 #define GRAPHICS_COLOR_PEACH_PUFF 0x00FFDAB9
662 #define GRAPHICS_COLOR_PERU 0x00CD853F
663 #define GRAPHICS_COLOR_PINK 0x00FFC0CB
664 #define GRAPHICS_COLOR_PLUM 0x00DDA0DD
665 #define GRAPHICS_COLOR_POWDER_BLUE 0x00B0E0E6
666 #define GRAPHICS_COLOR_PURPLE 0x00800080
667 #define GRAPHICS_COLOR_RED 0x00FF0000
668 #define GRAPHICS_COLOR_ROSY_BROWN 0x00BC8F8F
669 #define GRAPHICS_COLOR_ROYAL_BLUE 0x004169E1
670 #define GRAPHICS_COLOR_SADDLE_BROWN 0x008B4513
671 #define GRAPHICS_COLOR_SALMON 0x00FA8072
672 #define GRAPHICS_COLOR_SANDY_BROWN 0x00F4A460
673 #define GRAPHICS_COLOR_SEA_GREEN 0x002E8B57
674 #define GRAPHICS_COLOR_SEASHELL 0x00FFF5EE
675 #define GRAPHICS_COLOR_SIENNA 0x00A0522D
676 #define GRAPHICS_COLOR_SILVER 0x00C0C0C0
677 #define GRAPHICS_COLOR_SKY_BLUE 0x0087CEEB
678 #define GRAPHICS_COLOR_SLATE_BLUE 0x006A5ACD
679 #define GRAPHICS_COLOR_SLATE_GRAY 0x00708090
680 #define GRAPHICS_COLOR_SNOW 0x00FFFAFA
681 #define GRAPHICS_COLOR_SPRING_GREEN 0x0000FF7F
682 #define GRAPHICS_COLOR_STEEL_BLUE 0x004682B4
683 #define GRAPHICS_COLOR_TAN 0x00D2B48C
684 #define GRAPHICS_COLOR_TEAL 0x00008080
685 #define GRAPHICS_COLOR_THISTLE 0x00D8BFD8
686 #define GRAPHICS_COLOR_TOMATO 0x00FF6347
687 #define GRAPHICS_COLOR_TURQUOISE 0x0040E0D0
688 #define GRAPHICS_COLOR_VIOLET 0x00EE82EE
689 #define GRAPHICS_COLOR_WHEAT 0x00F5DEB3
690 #define GRAPHICS_COLOR_WHITE 0x00FFFFFF
691 #define GRAPHICS_COLOR_WHITE_SMOKE 0x00F5F5F5
692 #define GRAPHICS_COLOR_YELLOW 0x00FFFF00
693 #define GRAPHICS_COLOR_YELLOW_GREEN 0x009ACD32
694 #define GRAPHICS_COLOR_BLACK 0x00000000
695 
696 //*****************************************************************************
697 //
698 // Masks and shifts to aid in color format translation by drivers.
699 //
700 //*****************************************************************************
701 #define ClrRedMask 0x00FF0000
702 #define ClrRedShift 16
703 #define ClrGreenMask 0x0000FF00
704 #define ClrGreenShift 8
705 #define ClrBlueMask 0x000000FF
706 #define ClrBlueShift 0
707 
708 //*****************************************************************************
709 //
710 // Prototypes for the predefined fonts in the graphics library. ..Cm.. is the
711 // computer modern font, which is a serif font. ..Cmsc.. is the computer
712 // modern small-caps font, which is also a serif font. ..Cmss.. is the
713 // computer modern sans-serif font.
714 //
715 //*****************************************************************************
716 extern const Graphics_Font g_sFontCm12;
717 extern const Graphics_Font g_sFontCm12b;
718 extern const Graphics_Font g_sFontCm12i;
719 extern const Graphics_Font g_sFontCm14;
720 extern const Graphics_Font g_sFontCm14b;
721 extern const Graphics_Font g_sFontCm14i;
722 extern const Graphics_Font g_sFontCm16;
723 extern const Graphics_Font g_sFontCm16b;
724 extern const Graphics_Font g_sFontCm16i;
725 extern const Graphics_Font g_sFontCm18;
726 extern const Graphics_Font g_sFontCm18b;
727 extern const Graphics_Font g_sFontCm18i;
728 extern const Graphics_Font g_sFontCm20;
729 extern const Graphics_Font g_sFontCm20b;
730 extern const Graphics_Font g_sFontCm20i;
731 extern const Graphics_Font g_sFontCm22;
732 extern const Graphics_Font g_sFontCm22b;
733 extern const Graphics_Font g_sFontCm22i;
734 extern const Graphics_Font g_sFontCm24;
735 extern const Graphics_Font g_sFontCm24b;
736 extern const Graphics_Font g_sFontCm24i;
737 extern const Graphics_Font g_sFontCm26;
738 extern const Graphics_Font g_sFontCm26b;
739 extern const Graphics_Font g_sFontCm26i;
740 extern const Graphics_Font g_sFontCm28;
741 extern const Graphics_Font g_sFontCm28b;
742 extern const Graphics_Font g_sFontCm28i;
743 extern const Graphics_Font g_sFontCm30;
744 extern const Graphics_Font g_sFontCm30b;
745 extern const Graphics_Font g_sFontCm30i;
746 extern const Graphics_Font g_sFontCm32;
747 extern const Graphics_Font g_sFontCm32b;
748 extern const Graphics_Font g_sFontCm32i;
749 extern const Graphics_Font g_sFontCm34;
750 extern const Graphics_Font g_sFontCm34b;
751 extern const Graphics_Font g_sFontCm34i;
752 extern const Graphics_Font g_sFontCm36;
753 extern const Graphics_Font g_sFontCm36b;
754 extern const Graphics_Font g_sFontCm36i;
755 extern const Graphics_Font g_sFontCm38;
756 extern const Graphics_Font g_sFontCm38b;
757 extern const Graphics_Font g_sFontCm38i;
758 extern const Graphics_Font g_sFontCm40;
759 extern const Graphics_Font g_sFontCm40b;
760 extern const Graphics_Font g_sFontCm40i;
761 extern const Graphics_Font g_sFontCm42;
762 extern const Graphics_Font g_sFontCm42b;
763 extern const Graphics_Font g_sFontCm42i;
764 extern const Graphics_Font g_sFontCm44;
765 extern const Graphics_Font g_sFontCm44b;
766 extern const Graphics_Font g_sFontCm44i;
767 extern const Graphics_Font g_sFontCm46;
768 extern const Graphics_Font g_sFontCm46b;
769 extern const Graphics_Font g_sFontCm46i;
770 extern const Graphics_Font g_sFontCm48;
771 extern const Graphics_Font g_sFontCm48b;
772 extern const Graphics_Font g_sFontCm48i;
773 extern const Graphics_Font g_sFontCmsc12;
774 extern const Graphics_Font g_sFontCmsc14;
775 extern const Graphics_Font g_sFontCmsc16;
776 extern const Graphics_Font g_sFontCmsc18;
777 extern const Graphics_Font g_sFontCmsc20;
778 extern const Graphics_Font g_sFontCmsc22;
779 extern const Graphics_Font g_sFontCmsc24;
780 extern const Graphics_Font g_sFontCmsc26;
781 extern const Graphics_Font g_sFontCmsc28;
782 extern const Graphics_Font g_sFontCmsc30;
783 extern const Graphics_Font g_sFontCmsc32;
784 extern const Graphics_Font g_sFontCmsc34;
785 extern const Graphics_Font g_sFontCmsc36;
786 extern const Graphics_Font g_sFontCmsc38;
787 extern const Graphics_Font g_sFontCmsc40;
788 extern const Graphics_Font g_sFontCmsc42;
789 extern const Graphics_Font g_sFontCmsc44;
790 extern const Graphics_Font g_sFontCmsc46;
791 extern const Graphics_Font g_sFontCmsc48;
792 extern const Graphics_Font g_sFontCmss12;
793 extern const Graphics_Font g_sFontCmss12b;
794 extern const Graphics_Font g_sFontCmss12i;
795 extern const Graphics_Font g_sFontCmss14;
796 extern const Graphics_Font g_sFontCmss14b;
797 extern const Graphics_Font g_sFontCmss14i;
798 extern const Graphics_Font g_sFontCmss16;
799 extern const Graphics_Font g_sFontCmss16b;
800 extern const Graphics_Font g_sFontCmss16i;
801 extern const Graphics_Font g_sFontCmss18;
802 extern const Graphics_Font g_sFontCmss18b;
803 extern const Graphics_Font g_sFontCmss18i;
804 extern const Graphics_Font g_sFontCmss20;
805 extern const Graphics_Font g_sFontCmss20b;
806 extern const Graphics_Font g_sFontCmss20i;
807 extern const Graphics_Font g_sFontCmss22;
808 extern const Graphics_Font g_sFontCmss22b;
809 extern const Graphics_Font g_sFontCmss22i;
810 extern const Graphics_Font g_sFontCmss24;
811 extern const Graphics_Font g_sFontCmss24b;
812 extern const Graphics_Font g_sFontCmss24i;
813 extern const Graphics_Font g_sFontCmss26;
814 extern const Graphics_Font g_sFontCmss26b;
815 extern const Graphics_Font g_sFontCmss26i;
816 extern const Graphics_Font g_sFontCmss28;
817 extern const Graphics_Font g_sFontCmss28b;
818 extern const Graphics_Font g_sFontCmss28i;
819 extern const Graphics_Font g_sFontCmss30;
820 extern const Graphics_Font g_sFontCmss30b;
821 extern const Graphics_Font g_sFontCmss30i;
822 extern const Graphics_Font g_sFontCmss32;
823 extern const Graphics_Font g_sFontCmss32b;
824 extern const Graphics_Font g_sFontCmss32i;
825 extern const Graphics_Font g_sFontCmss34;
826 extern const Graphics_Font g_sFontCmss34b;
827 extern const Graphics_Font g_sFontCmss34i;
828 extern const Graphics_Font g_sFontCmss36;
829 extern const Graphics_Font g_sFontCmss36b;
830 extern const Graphics_Font g_sFontCmss36i;
831 extern const Graphics_Font g_sFontCmss38;
832 extern const Graphics_Font g_sFontCmss38b;
833 extern const Graphics_Font g_sFontCmss38i;
834 extern const Graphics_Font g_sFontCmss40;
835 extern const Graphics_Font g_sFontCmss40b;
836 extern const Graphics_Font g_sFontCmss40i;
837 extern const Graphics_Font g_sFontCmss42;
838 extern const Graphics_Font g_sFontCmss42b;
839 extern const Graphics_Font g_sFontCmss42i;
840 extern const Graphics_Font g_sFontCmss44;
841 extern const Graphics_Font g_sFontCmss44b;
842 extern const Graphics_Font g_sFontCmss44i;
843 extern const Graphics_Font g_sFontCmss46;
844 extern const Graphics_Font g_sFontCmss46b;
845 extern const Graphics_Font g_sFontCmss46i;
846 extern const Graphics_Font g_sFontCmss48;
847 extern const Graphics_Font g_sFontCmss48b;
848 extern const Graphics_Font g_sFontCmss48i;
849 extern const Graphics_Font g_sFontCmtt12;
850 extern const Graphics_Font g_sFontCmtt14;
851 extern const Graphics_Font g_sFontCmtt16;
852 extern const Graphics_Font g_sFontCmtt18;
853 extern const Graphics_Font g_sFontCmtt20;
854 extern const Graphics_Font g_sFontCmtt22;
855 extern const Graphics_Font g_sFontCmtt24;
856 extern const Graphics_Font g_sFontCmtt26;
857 extern const Graphics_Font g_sFontCmtt28;
858 extern const Graphics_Font g_sFontCmtt30;
859 extern const Graphics_Font g_sFontCmtt32;
860 extern const Graphics_Font g_sFontCmtt34;
861 extern const Graphics_Font g_sFontCmtt36;
862 extern const Graphics_Font g_sFontCmtt38;
863 extern const Graphics_Font g_sFontCmtt40;
864 extern const Graphics_Font g_sFontCmtt42;
865 extern const Graphics_Font g_sFontCmtt44;
866 extern const Graphics_Font g_sFontCmtt46;
867 extern const Graphics_Font g_sFontCmtt48;
868 extern const Graphics_Font g_sFontFixed6x8;
869 
870 //*****************************************************************************
871 //
872 // Language identifiers supported by the string table processing functions.
873 //
874 //*****************************************************************************
875 #define GrLangZhPRC 0x0804 // Chinese (PRC)
876 #define GrLangZhTW 0x0404 // Chinese (Taiwan)
877 #define GrLangEnUS 0x0409 // English (United States)
878 #define GrLangEnUK 0x0809 // English (United Kingdom)
879 #define GrLangEnAUS 0x0C09 // English (Australia)
880 #define GrLangEnCA 0x1009 // English (Canada)
881 #define GrLangEnNZ 0x1409 // English (New Zealand)
882 #define GrLangFr 0x040C // French (Standard)
883 #define GrLangDe 0x0407 // German (Standard)
884 #define GrLangHi 0x0439 // Hindi
885 #define GrLangIt 0x0410 // Italian (Standard)
886 #define GrLangJp 0x0411 // Japanese
887 #define GrLangKo 0x0412 // Korean
888 #define GrLangEsMX 0x080A // Spanish (Mexico)
889 #define GrLangEsSP 0x0C0A // Spanish (Spain)
890 #define GrLangSwKE 0x0441 // Swahili (Kenya)
891 #define GrLangUrIN 0x0820 // Urdu (India)
892 #define GrLangUrPK 0x0420 // Urdu (Pakistan)
893 
894 
895 
896 //*****************************************************************************
897 //
898 // Prototypes for the graphics library functions.
899 //
900 //*****************************************************************************
901 
902 //*****************************************************************************
903 //
916 //
917 //*****************************************************************************
918 extern void Graphics_drawCircle(const Graphics_Context *context, int32_t x,
919  int32_t y, int32_t lRadius);
920 extern void Graphics_fillCircle(const Graphics_Context *context, int32_t x,
921  int32_t y, int32_t lRadius);
922 extern void Graphics_setClipRegion(Graphics_Context *context,
923  Graphics_Rectangle *rect);
924 extern void Graphics_initContext(Graphics_Context *context,
925  const Graphics_Display *display);
926 extern void Graphics_drawImage(const Graphics_Context *context,
927  const Graphics_Image *pBitmap, int16_t x, int16_t y);
928 extern void Graphics_drawLine(const Graphics_Context *context, int32_t x1,
929  int32_t y1, int32_t x2, int32_t y2);
930 extern void Graphics_drawLineH(const Graphics_Context *context, int32_t x1,
931  int32_t x2, int32_t y);
932 extern void Graphics_drawLineV(const Graphics_Context *context, int32_t x,
933  int32_t y1, int32_t y2);
934 extern void Graphics_drawRectangle(const Graphics_Context *context,
935  const Graphics_Rectangle *rect);
936 extern void Graphics_fillRectangle(const Graphics_Context *context,
937  const Graphics_Rectangle *rect);
938 extern void Graphics_drawString(const Graphics_Context *context, int8_t *string,
939  int32_t lLength, int32_t x, int32_t y, bool opaque);
940 extern int32_t Graphics_getStringWidth(const Graphics_Context *context,
941  const int8_t *string, int32_t lLength);
943  Graphics_Rectangle *psRect2);
945  Graphics_Rectangle *psRect2, Graphics_Rectangle *psIntersect);
946 extern void Graphics_setBackgroundColor(Graphics_Context *context,
947  int32_t value);
948 extern uint16_t Graphics_getDisplayWidth(Graphics_Context *context);
949 extern uint16_t Graphics_getDisplayHeight(Graphics_Context *context);
950 extern void Graphics_setFont(Graphics_Context *context,
951  const Graphics_Font *font);
952 extern uint8_t Graphics_getFontBaseline(const Graphics_Font *font);
953 extern void Graphics_setForegroundColor(Graphics_Context *context,
954  int32_t value);
956  int32_t value);
957 extern uint8_t Graphics_getFontHeight(const Graphics_Font *font);
958 extern uint8_t Graphics_getFontMaxWidth(const Graphics_Font *font);
959 extern uint16_t Graphics_getImageColors(const Graphics_Image *image);
960 extern uint16_t Graphics_getImageHeight(const Graphics_Image *image);
961 extern uint16_t Graphics_getImageWidth(const Graphics_Image *image);
962 extern uint32_t Graphics_getOffscreen1BppImageSize(uint16_t width,
963  uint16_t height);
964 extern uint32_t Graphics_getOffscreen4BppImageSize(uint16_t width,
965  uint16_t height);
966 extern uint32_t Graphics_getOffScreen8BPPSize(uint16_t width, uint16_t height);
967 extern void Graphics_drawStringCentered(const Graphics_Context *context,
968  int8_t *string, int32_t length, int32_t x, int32_t y,
969  bool opaque);
970 extern uint8_t Graphics_getStringHeight(const Graphics_Context *context);
971 extern uint8_t Graphics_getStringMaxWidth(const Graphics_Context *context);
972 extern uint8_t Graphics_getStringBaseline(const Graphics_Context *context);
973 extern uint32_t Graphics_translateColorOnDisplay(const Graphics_Display *display,
974  uint32_t value);
976  const Graphics_Display *display, uint16_t x1, uint16_t x2, uint16_t y,
977  uint32_t value);
978 extern void Graphics_drawVerticalLineOnDisplay(const Graphics_Display *display,
979  uint16_t x, uint16_t y1, uint16_t y2, uint16_t value);
980 extern void Graphics_fillRectangleOnDisplay(const Graphics_Display *display,
981  const Graphics_Rectangle *rect, uint16_t value);
982 extern void Graphics_flushOnDisplay(const Graphics_Display *display);
983 extern void Graphics_drawPixel(const Graphics_Context *context, uint16_t x,
984  uint16_t y);
985 extern void Graphics_clearDisplay(const Graphics_Context *context);
986 extern uint16_t Graphics_getHeightOfDisplay(const Graphics_Display *display);
987 extern void Graphics_flushBuffer(const Graphics_Context *context);
988 extern uint16_t Graphics_getWidthOfDisplay(const Graphics_Display *display);
990  uint16_t x, uint16_t y);
991 extern void Graphics_drawPixelOnDisplay(const Graphics_Display *display,
992  uint16_t x, uint16_t y, uint16_t value);
993 extern void Graphics_clearDisplayOnDisplay(const Graphics_Display *display,
994  uint16_t value);
996  const Graphics_Display *display, uint16_t x, uint16_t y, uint16_t x0,
997  uint16_t count, uint16_t bPP, const uint8_t *data,
998  const uint32_t *pucPalette);
1000  uint8_t *image, int32_t width, int32_t height);
1002  uint8_t *image, int32_t width, int32_t height);
1004  uint32_t *ppalette, uint32_t offset, uint32_t count);
1006  uint8_t *image, int32_t width, int32_t height);
1008  uint32_t *ppalette, uint32_t offset, uint32_t count);
1009 
1010 //*****************************************************************************
1011 //
1012 // Mark the end of the C bindings section for C++ compilers.
1013 //
1014 //*****************************************************************************
1015 #ifdef __cplusplus
1016 }
1017 #endif
1018 
1019 //*****************************************************************************
1020 //
1021 // Close the Doxygen group.
1023 //
1024 //*****************************************************************************
1025 
1026 #endif // __GRLIB_H__
void Graphics_initOffscreen1BppImage(Graphics_Display *display, uint8_t *image, int32_t width, int32_t height)
uint8_t Graphics_getStringMaxWidth(const Graphics_Context *context)
Definition: string.c:795
const Graphics_Font g_sFontCm36b
void Graphics_drawLine(const Graphics_Context *context, int32_t x1, int32_t y1, int32_t x2, int32_t y2)
Definition: line.c:437
const Graphics_Font g_sFontCmss22b
const Graphics_Font g_sFontCmsc26
Definition: grlib.h:64
const Graphics_Font g_sFontCmss28i
const Graphics_Font g_sFontCmss12
const Graphics_Font g_sFontCm20
const Graphics_Font g_sFontCm38
const Graphics_Font g_sFontCmss30i
const Graphics_Font g_sFontCmss24b
const Graphics_Font g_sFontCm48i
const Graphics_Font g_sFontCmss26i
const Graphics_Font g_sFontCmss26
const uint16_t * offset
A pointer to a table containing the offset within data to the data for each character in the font...
Definition: grlib.h:135
This structure defines the characteristics of a display driver.
Definition: grlib.h:78
const Graphics_Font g_sFontCm34i
int16_t yMin
The minimum Y coordinate of the rectangle.
Definition: grlib.h:67
const Graphics_Font g_sFontCmsc36
const Graphics_Font g_sFontCmtt34
const Graphics_Font g_sFontCm28b
Definition: grlib.h:145
void Graphics_setBackgroundColor(Graphics_Context *context, int32_t value)
Definition: context.c:131
const Graphics_Font g_sFontCm42
This structure describes a font used for drawing text onto the screen.
Definition: grlib.h:105
const Graphics_Font g_sFontCm46b
void Graphics_setOffscreen4BppPalette(Graphics_Display *display, uint32_t *ppalette, uint32_t offset, uint32_t count)
void(* callPixelDrawMultiple)(void *displayData, int16_t x, int16_t y, int16_t x0, int16_t count, int16_t bPP, const uint8_t *data, const uint32_t *pucPalette)
A pointer to the function to draw multiple pixels on this display.
Definition: grlib.h:86
const uint8_t * pPixel
Pointer to pixel data;.
Definition: grlib.h:54
Definition: grlib.h:127
const Graphics_Font g_sFontCmtt24
const Graphics_Font g_sFontCmss20b
uint8_t baseline
The offset between the top of the character cell and the baseline of the glyph. The baseline is the b...
Definition: grlib.h:132
void(* callRectFill)(void *displayData, const Graphics_Rectangle *rect, uint16_t value)
A pointer to the function to draw a filled rectangle on this display.
Definition: grlib.h:93
const Graphics_Font g_sFontCmsc28
Graphics_Rectangle clipRegion
The clipping region to be used when drawing onto the screen.
Definition: grlib.h:149
struct Graphics_Font Graphics_Font
This structure describes a font used for drawing text onto the screen.
const Graphics_Font g_sFontCm26b
void Graphics_drawStringCentered(const Graphics_Context *context, int8_t *string, int32_t length, int32_t x, int32_t y, bool opaque)
Definition: string.c:748
const Graphics_Font g_sFontCm26
const Graphics_Font g_sFontCmss48
const Graphics_Font g_sFontCm28
uint8_t maxWidth
The maximum width of a character; this is the width of the widest character in the font...
Definition: grlib.h:108
const Graphics_Font g_sFontCmsc42
void Graphics_drawString(const Graphics_Context *context, int8_t *string, int32_t lLength, int32_t x, int32_t y, bool opaque)
Definition: string.c:176
uint8_t format
The format of the font. Can be one of FONT_FMT_EX_UNCOMPRESSED or FONT_FMT_EX_PIXEL_RLE.
Definition: grlib.h:129
const Graphics_Font g_sFontCm48
const Graphics_Font g_sFontCm14
uint32_t Graphics_getOffScreen8BPPSize(uint16_t width, uint16_t height)
Definition: image.c:401
uint32_t Graphics_getOffscreen1BppImageSize(uint16_t width, uint16_t height)
Definition: image.c:363
void Graphics_drawHorizontalLineOnDisplay(const Graphics_Display *display, uint16_t x1, uint16_t x2, uint16_t y, uint32_t value)
Definition: display.c:85
const Graphics_Font g_sFontCmss40i
const Graphics_Font g_sFontCm28i
const Graphics_Font g_sFontCmss38
void Graphics_setForegroundColorTranslated(Graphics_Context *context, int32_t value)
Definition: context.c:233
uint8_t maxWidth
The maximum width of a character; this is the width of the widest character in the font...
Definition: grlib.h:130
int32_t Graphics_getRectangleIntersection(Graphics_Rectangle *psRect1, Graphics_Rectangle *psRect2, Graphics_Rectangle *psIntersect)
Definition: rectangle.c:224
const Graphics_Font g_sFontCmss34i
uint16_t Graphics_getWidthOfDisplay(const Graphics_Display *display)
Definition: context.c:399
struct Graphics_Context Graphics_Context
uint32_t background
The background color used to draw primitives onto the screen.
Definition: grlib.h:151
const Graphics_Font g_sFontCmsc40
const Graphics_Font g_sFontCmsc30
const Graphics_Font g_sFontCmsc38
This structure defines the characteristics of a Bitmap Image.
Definition: grlib.h:47
const Graphics_Font g_sFontCmss32
const Graphics_Font g_sFontCm46i
const Graphics_Font g_sFontCmss32i
const Graphics_Font g_sFontCm18i
const Graphics_Font g_sFontCmtt48
const Graphics_Font g_sFontCmsc18
const Graphics_Font g_sFontCmss18
const Graphics_Font g_sFontCmss22i
const Graphics_Font g_sFontCmsc20
const Graphics_Font g_sFontCmtt20
void(* callClearDisplay)(void *displayData, uint16_t value)
A pointer to the function to clears Display. Contents of display buffer unmodified.
Definition: grlib.h:97
const Graphics_Font g_sFontCmsc46
void Graphics_drawLineV(const Graphics_Context *context, int32_t x, int32_t y1, int32_t y2)
Definition: line.c:112
const uint8_t * data
A pointer to the data for the font.
Definition: grlib.h:136
bool Graphics_isPointWithinRectangle(const Graphics_Rectangle *rect, uint16_t x, uint16_t y)
Definition: rectangle.c:273
uint8_t first
The codepoint number representing the first character encoded in the font.
Definition: grlib.h:133
void Graphics_initOffscreen4BppImage(Graphics_Display *display, uint8_t *image, int32_t width, int32_t height)
const Graphics_Font g_sFontCm36i
const Graphics_Font g_sFontCm42i
void Graphics_setForegroundColor(Graphics_Context *context, int32_t value)
Definition: context.c:212
const Graphics_Font g_sFontCm14b
void Graphics_clearDisplayOnDisplay(const Graphics_Display *display, uint16_t value)
Definition: display.c:191
const Graphics_Font g_sFontCmss34
const Graphics_Font g_sFontCm22
uint32_t Graphics_translateColorOnDisplay(const Graphics_Display *display, uint32_t value)
Definition: display.c:155
int16_t xMin
The minimum X coordinate of the rectangle.
Definition: grlib.h:66
const Graphics_Font g_sFontCmss36b
struct Graphics_Rectangle Graphics_Rectangle
void Graphics_clearDisplay(const Graphics_Context *context)
Definition: context.c:355
uint8_t Graphics_getFontHeight(const Graphics_Font *font)
Definition: context.c:252
const Graphics_Font g_sFontCmsc48
const Graphics_Font g_sFontCm12i
const Graphics_Font g_sFontCm22b
const Graphics_Font g_sFontCmss40
const Graphics_Font g_sFontCm26i
const Graphics_Font g_sFontCm12
const Graphics_Font g_sFontCmss26b
const Graphics_Font g_sFontCmss32b
uint32_t foreground
The color used to draw primitives onto the screen.
Definition: grlib.h:150
const Graphics_Font g_sFontCm22i
const Graphics_Font g_sFontCm20b
const Graphics_Font g_sFontCmss34b
uint8_t baseline
The offset between the top of the character cell and the baseline of the glyph. The baseline is the b...
Definition: grlib.h:110
void(* callFlush)(void *displayData)
A pointer to the function to flush any cached drawing operations on this display. ...
Definition: grlib.h:96
const uint32_t * pPalette
Pointer to Palette.
Definition: grlib.h:53
uint16_t xSize
xSize
Definition: grlib.h:50
const Graphics_Font g_sFontCmss16
const Graphics_Font g_sFontCmtt22
uint16_t Graphics_getHeightOfDisplay(const Graphics_Display *display)
Definition: context.c:320
const Graphics_Font g_sFontCmss46b
uint16_t ySize
ySize
Definition: grlib.h:51
const Graphics_Font g_sFontCm40b
const Graphics_Font g_sFontFixed6x8
const Graphics_Font g_sFontCm48b
const Graphics_Font g_sFontCmss16i
const Graphics_Font g_sFontCmsc14
const Graphics_Font g_sFontCmss46
void Graphics_drawRectangle(const Graphics_Context *context, const Graphics_Rectangle *rect)
Definition: rectangle.c:25
const Graphics_Font g_sFontCm44
uint16_t width
The width of this display.
Definition: grlib.h:82
const Graphics_Font g_sFontCmtt14
void Graphics_initContext(Graphics_Context *context, const Graphics_Display *display)
Definition: context.c:27
void Graphics_flushOnDisplay(const Graphics_Display *display)
Definition: display.c:173
const Graphics_Font g_sFontCm38i
const Graphics_Font g_sFontCmsc24
uint32_t Graphics_getOffscreen4BppImageSize(uint16_t width, uint16_t height)
Definition: image.c:382
const Graphics_Font g_sFontCmss30b
const Graphics_Font g_sFontCm34
const Graphics_Font g_sFontCmss12i
uint16_t numColors
Number of Colors in Palette.
Definition: grlib.h:52
const Graphics_Font g_sFontCm30
uint8_t bPP
Bits per pixel and Compressed/Uncompressed.
Definition: grlib.h:49
int16_t xMax
The maximum X coordinate of the rectangle.
Definition: grlib.h:68
const Graphics_Font g_sFontCmss38b
const Graphics_Font g_sFontCmtt40
uint16_t Graphics_getDisplayWidth(Graphics_Context *context)
Definition: context.c:286
uint8_t height
The height of the character cell; this may be taller than the font data for the characters (to provid...
Definition: grlib.h:131
uint16_t Graphics_getDisplayHeight(Graphics_Context *context)
Definition: context.c:303
const Graphics_Font g_sFontCmss48b
const Graphics_Font g_sFontCm40i
const Graphics_Font g_sFontCmss24i
const Graphics_Font g_sFontCm42b
const Graphics_Font g_sFontCm32
const Graphics_Font g_sFontCmss28
int32_t size
The size of this structure.
Definition: grlib.h:80
const Graphics_Font g_sFontCmss20
const uint8_t * data
A pointer to the data for the font.
Definition: grlib.h:112
uint16_t Graphics_getImageWidth(const Graphics_Image *image)
Definition: image.c:344
void Graphics_drawVerticalLineOnDisplay(const Graphics_Display *display, uint16_t x, uint16_t y1, uint16_t y2, uint16_t value)
Definition: display.c:109
const Graphics_Font g_sFontCmss14i
void Graphics_drawCircle(const Graphics_Context *context, int32_t x, int32_t y, int32_t lRadius)
Definition: circle.c:26
const Graphics_Font g_sFontCmtt26
const Graphics_Font g_sFontCmtt30
void(* callLineDrawV)(void *displayData, int16_t x, int16_t y1, int16_t y2, uint16_t value)
A pointer to the function to draw a vertical line on this display.
Definition: grlib.h:91
int16_t yMax
The maximum Y coordinate of the rectangle.
Definition: grlib.h:69
const Graphics_Font g_sFontCm18
void Graphics_fillRectangleOnDisplay(const Graphics_Display *display, const Graphics_Rectangle *rect, uint16_t value)
Definition: display.c:132
void * displayData
A pointer to display driver-specific data.
Definition: grlib.h:81
const Graphics_Font g_sFontCm16b
void(* callPixelDraw)(void *displayData, int16_t x, int16_t y, uint16_t value)
A pointer to the function to draw a pixel on this display.
Definition: grlib.h:84
void Graphics_drawLineH(const Graphics_Context *context, int32_t x1, int32_t x2, int32_t y)
Definition: line.c:29
const Graphics_Font g_sFontCm30b
const Graphics_Font g_sFontCmtt46
int32_t size
The size of this structure.
Definition: grlib.h:147
void Graphics_drawPixel(const Graphics_Context *context, uint16_t x, uint16_t y)
Definition: context.c:373
const Graphics_Font g_sFontCmss18i
const Graphics_Font g_sFontCm18b
const Graphics_Font g_sFontCm32i
int32_t Graphics_isOverlappingRectangle(Graphics_Rectangle *psRect1, Graphics_Rectangle *psRect2)
const Graphics_Font g_sFontCm34b
struct Graphics_Image Graphics_Image
This structure defines the characteristics of a Bitmap Image.
const Graphics_Font g_sFontCm16i
const Graphics_Font g_sFontCm46
uint8_t last
The codepoint number representing the last character encoded in the font.
Definition: grlib.h:134
const Graphics_Font g_sFontCmtt12
const Graphics_Font g_sFontCmss48i
const Graphics_Font g_sFontCm38b
const Graphics_Font g_sFontCm32b
const Graphics_Font g_sFontCm12b
const Graphics_Font g_sFontCmss38i
uint8_t height
The height of the character cell; this may be taller than the font data for the characters (to provid...
Definition: grlib.h:109
const Graphics_Font g_sFontCmss42i
const Graphics_Font g_sFontCm40
const Graphics_Font g_sFontCmss20i
struct Graphics_Display Graphics_Display
This structure defines the characteristics of a display driver.
const Graphics_Font g_sFontCmss36i
const Graphics_Font g_sFontCmss44i
void(* callLineDrawH)(void *displayData, int16_t x1, int16_t x2, int16_t y, uint16_t value)
A pointer to the function to draw a horizontal line on this display.
Definition: grlib.h:89
const Graphics_Font g_sFontCmtt18
const Graphics_Font g_sFontCm16
const Graphics_Font g_sFontCmss42b
void Graphics_setFont(Graphics_Context *context, const Graphics_Font *font)
Definition: context.c:173
const Graphics_Font g_sFontCmss44
const Graphics_Font g_sFontCmtt16
const Graphics_Font g_sFontCmss18b
const Graphics_Font g_sFontCmtt38
const Graphics_Font g_sFontCm24b
const Graphics_Font g_sFontCmss42
void Graphics_drawImage(const Graphics_Context *context, const Graphics_Image *pBitmap, int16_t x, int16_t y)
Definition: image.c:73
void Graphics_fillCircle(const Graphics_Context *context, int32_t x, int32_t y, int32_t lRadius)
Definition: circle.c:290
uint8_t format
The format of the font. Can be one of FONT_FMT_UNCOMPRESSED or FONT_FMT_PIXEL_RLE.
Definition: grlib.h:107
void Graphics_initOffscreen8BppImage(Graphics_Display *display, uint8_t *image, int32_t width, int32_t height)
uint32_t(* callColorTranslate)(void *displayData, uint32_t value)
A pointer to the function to translate 24-bit RGB colors to display-specific colors.
Definition: grlib.h:95
const Graphics_Font g_sFontCmss12b
const Graphics_Font g_sFontCmtt44
uint16_t heigth
The height of this display.
Definition: grlib.h:83
uint8_t Graphics_getStringBaseline(const Graphics_Context *context)
Definition: string.c:718
uint8_t Graphics_getFontBaseline(const Graphics_Font *font)
Definition: context.c:194
const Graphics_Font g_sFontCmsc12
struct Graphics_FontEx Graphics_FontEx
uint16_t Graphics_getImageHeight(const Graphics_Image *image)
Definition: image.c:327
const Graphics_Font g_sFontCmtt28
const Graphics_Font g_sFontCmss40b
const Graphics_Font g_sFontCm44b
const Graphics_Font g_sFontCm14i
uint8_t Graphics_getStringHeight(const Graphics_Context *context)
Definition: string.c:775
const Graphics_Font * font
The font used to render text onto the screen.
Definition: grlib.h:152
const Graphics_Font g_sFontCmsc16
uint8_t Graphics_getFontMaxWidth(const Graphics_Font *font)
Definition: context.c:269
const Graphics_Font g_sFontCmss36
const Graphics_Font g_sFontCmss44b
const Graphics_Font g_sFontCmtt32
const Graphics_Font g_sFontCmss30
const Graphics_Font g_sFontCmsc44
const Graphics_Font g_sFontCmss28b
const Graphics_Font g_sFontCm20i
const Graphics_Font g_sFontCmss46i
uint16_t offset[96]
The offset within data to the data for each character in the font.
Definition: grlib.h:111
const Graphics_Font g_sFontCmss22
const Graphics_Font g_sFontCmss14
uint16_t Graphics_getImageColors(const Graphics_Image *image)
Definition: image.c:311
void Graphics_flushBuffer(const Graphics_Context *context)
Definition: context.c:339
const Graphics_Font g_sFontCmtt36
const Graphics_Font g_sFontCm30i
int32_t Graphics_getStringWidth(const Graphics_Context *context, const int8_t *string, int32_t lLength)
Definition: string.c:57
void Graphics_setClipRegion(Graphics_Context *context, Graphics_Rectangle *rect)
Definition: context.c:83
void Graphics_setOffscreen8BppPalette(Graphics_Display *display, uint32_t *ppalette, uint32_t offset, uint32_t count)
const Graphics_Font g_sFontCm44i
const Graphics_Font g_sFontCmsc34
const Graphics_Font g_sFontCmss16b
const Graphics_Font g_sFontCmss14b
void Graphics_drawMultiplePixelsOnDisplay(const Graphics_Display *display, uint16_t x, uint16_t y, uint16_t x0, uint16_t count, uint16_t bPP, const uint8_t *data, const uint32_t *pucPalette)
Definition: display.c:58
const Graphics_Font g_sFontCm36
const Graphics_Font g_sFontCmss24
void Graphics_fillRectangle(const Graphics_Context *context, const Graphics_Rectangle *rect)
Definition: rectangle.c:96
void Graphics_drawPixelOnDisplay(const Graphics_Display *display, uint16_t x, uint16_t y, uint16_t value)
Definition: display.c:27
const Graphics_Font g_sFontCmsc22
const Graphics_Font g_sFontCmtt42
const Graphics_Font g_sFontCmsc32
const Graphics_Display * display
The screen onto which drawing operations are performed.
Definition: grlib.h:148
const Graphics_Font g_sFontCm24i
const Graphics_Font g_sFontCm24

Copyright 2016, Texas Instruments Incorporated