diff options
author | inmarket <andrewh@inmarket.com.au> | 2018-07-08 10:54:19 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2018-07-08 10:54:19 +1000 |
commit | 2ab2d77fcba42467b62f2be732cb8dc00510fe19 (patch) | |
tree | 8dbd616faa116a2946ad47c62c20d4a34fb749b2 /src/gdisp | |
parent | 7e95acb7310d83284288a6e89a6b3fe4bf4e8668 (diff) | |
download | uGFX-2ab2d77fcba42467b62f2be732cb8dc00510fe19.tar.gz uGFX-2ab2d77fcba42467b62f2be732cb8dc00510fe19.tar.bz2 uGFX-2ab2d77fcba42467b62f2be732cb8dc00510fe19.zip |
Change coord_t to gCoord
Diffstat (limited to 'src/gdisp')
-rw-r--r-- | src/gdisp/gdisp.c | 138 | ||||
-rw-r--r-- | src/gdisp/gdisp.h | 79 | ||||
-rw-r--r-- | src/gdisp/gdisp_driver.h | 24 | ||||
-rw-r--r-- | src/gdisp/gdisp_image.c | 18 | ||||
-rw-r--r-- | src/gdisp/gdisp_image.h | 4 | ||||
-rw-r--r-- | src/gdisp/gdisp_image_bmp.c | 12 | ||||
-rw-r--r-- | src/gdisp/gdisp_image_gif.c | 14 | ||||
-rw-r--r-- | src/gdisp/gdisp_image_jpg.c | 6 | ||||
-rw-r--r-- | src/gdisp/gdisp_image_native.c | 4 | ||||
-rw-r--r-- | src/gdisp/gdisp_image_png.c | 16 | ||||
-rw-r--r-- | src/gdisp/gdisp_pixmap.c | 18 | ||||
-rw-r--r-- | src/gdisp/gdisp_pixmap.h | 2 |
12 files changed, 168 insertions, 167 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index 23e9061f..96e425fd 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -70,7 +70,7 @@ GDisplay *GDISP; #if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE static GFXINLINE void setglobalwindow(GDisplay *g) { - coord_t x, y; + gCoord x, y; x = g->p.x; y = g->p.y; g->p.x = g->p.y = 0; g->p.cx = g->g.Width; g->p.cy = g->g.Height; @@ -227,7 +227,7 @@ static GFXINLINE void fillarea(GDisplay *g) { // if (gvmt(g)->pixel) //#endif { - coord_t x0, y0, x1, y1; + gCoord x0, y0, x1, y1; x0 = g->p.x; y0 = g->p.y; @@ -503,9 +503,9 @@ static void line_clip(GDisplay *g) { #if GDISP_STARTUP_LOGO_TIMEOUT > 0 static gBool gdispInitDone; static void StartupLogoDisplay(GDisplay *g) { - coord_t x, y, w; - const coord_t * p; - static const coord_t blks[] = { + gCoord x, y, w; + const gCoord * p; + static const gCoord blks[] = { // u 2, 6, 1, 10, 3, 11, 4, 1, @@ -709,8 +709,8 @@ unsigned gdispGetDisplayCount(void) { return gdriverInstanceCount(GDRIVER_TYPE_DISPLAY); } -coord_t gdispGGetWidth(GDisplay *g) { return g->g.Width; } -coord_t gdispGGetHeight(GDisplay *g) { return g->g.Height; } +gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; } +gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; } powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; } orientation_t gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; } uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; } @@ -732,7 +732,7 @@ void gdispGFlush(GDisplay *g) { } #if GDISP_NEED_STREAMING - void gdispGStreamStart(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy) { + void gdispGStreamStart(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy) { MUTEX_ENTER(g); #if NEED_CLIPPING @@ -794,7 +794,7 @@ void gdispGFlush(GDisplay *g) { void gdispGStreamColor(GDisplay *g, color_t color) { #if !GDISP_HARDWARE_STREAM_WRITE && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS - coord_t sx1, sy1; + gCoord sx1, sy1; #endif // Don't touch the mutex as we should already own it @@ -978,7 +978,7 @@ void gdispGFlush(GDisplay *g) { } #endif -void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color) { +void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color) { MUTEX_ENTER(g); g->p.x = x; g->p.y = y; @@ -988,7 +988,7 @@ void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color) { MUTEX_EXIT(g); } -void gdispGDrawLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) { +void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color) { MUTEX_ENTER(g); g->p.x = x0; g->p.y = y0; @@ -1083,7 +1083,7 @@ void gdispGClear(GDisplay *g, color_t color) { #endif } -void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) { +void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) { MUTEX_ENTER(g); g->p.x = x; g->p.y = y; @@ -1097,7 +1097,7 @@ void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c MUTEX_EXIT(g); } -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) { +void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord srcx, gCoord srcy, gCoord srccx, const pixel_t *buffer) { MUTEX_ENTER(g); #if NEED_CLIPPING @@ -1234,7 +1234,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c } #if GDISP_NEED_CLIP || GDISP_NEED_VALIDATION - void gdispGSetClip(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy) { + void gdispGSetClip(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy) { MUTEX_ENTER(g); // Best is using hardware clipping @@ -1271,8 +1271,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_CIRCLE - void gdispGDrawCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color) { - coord_t a, b, P; + void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) { + gCoord a, b, P; MUTEX_ENTER(g); @@ -1313,8 +1313,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_CIRCLE - void gdispGFillCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color) { - coord_t a, b, P; + void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) { + gCoord a, b, P; MUTEX_ENTER(g); @@ -1357,8 +1357,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c g->p.x = x+r2+1; g->p.x1 = x+r1; g->p.color = color1; hline_clip(g) #define DRAW_SINGLELINE(yval, r) g->p.y = yval; g->p.x = x-r; g->p.x1 = x+r; hline_clip(g) - void gdispGFillDualCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius1, color_t color1, coord_t radius2, color_t color2) { - coord_t a, b1, b2, p1, p2; + void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2) { + gCoord a, b1, b2, p1, p2; MUTEX_ENTER(g); @@ -1426,8 +1426,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_ELLIPSE - void gdispGDrawEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color) { - coord_t dx, dy; + void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) { + gCoord dx, dy; int32_t a2, b2; int32_t err, e2; @@ -1465,8 +1465,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_ELLIPSE - void gdispGFillEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color) { - coord_t dx, dy; + void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) { + gCoord dx, dy; int32_t a2, b2; int32_t err, e2; @@ -1502,8 +1502,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_ARCSECTORS - void gdispGDrawArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color) { - coord_t a, b, P; + void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) { + gCoord a, b, P; MUTEX_ENTER(g); @@ -1546,8 +1546,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_ARCSECTORS - void gdispGFillArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color) { - coord_t a, b, P; + void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) { + gCoord a, b, P; MUTEX_ENTER(g); @@ -1731,8 +1731,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #include <math.h> #endif - void gdispGDrawArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) { - coord_t a, b, P, sedge, eedge; + void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) { + gCoord a, b, P, sedge, eedge; uint8_t full, sbit, ebit, tbit; // Normalize the angles @@ -1917,10 +1917,10 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #include <math.h> #endif - void gdispGDrawThickArc(GDisplay *g, coord_t xc, coord_t yc, coord_t radiusStart, coord_t radiusEnd, coord_t start, coord_t end, color_t color) { - coord_t x, y, d, r; - coord_t startTan, endTan, curangle; - coord_t precision = 512; + void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, color_t color) { + gCoord x, y, d, r; + gCoord startTan, endTan, curangle; + gCoord precision = 512; // Normalize the angles if (start < 0) @@ -2032,9 +2032,9 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_ARC - void gdispGFillArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) { - coord_t a, b, P; - coord_t sy, ey; + void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) { + gCoord a, b, P; + gCoord sy, ey; fixed sxa, sxb, sxd, exa, exb, exd; uint8_t qtr; @@ -2042,7 +2042,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c // We add a half pixel so that we are drawing from the centre of the pixel // instead of the left edge of the pixel. This also fixes the implied floor() - // when converting back to a coord_t + // when converting back to a gCoord sxa = exa = FIXED(x) + FIXED0_5; // Do the trig to get the formulas for the start and end lines. @@ -2534,7 +2534,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS - void gdispGDrawRoundedBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color) { + void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) { if (2*radius > cx || 2*radius > cy) { gdispGDrawBox(g, x, y, cx, cy, color); return; @@ -2559,8 +2559,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS - void gdispGFillRoundedBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color) { - coord_t radius2; + void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) { + gCoord radius2; radius2 = radius*2; if (radius2 > cx || radius2 > cy) { @@ -2585,7 +2585,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_PIXELREAD - color_t gdispGGetPixelColor(GDisplay *g, coord_t x, coord_t y) { + color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y) { color_t c; /* Always synchronous as it must return a value */ @@ -2632,10 +2632,10 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c #endif #if GDISP_NEED_SCROLL - void gdispGVerticalScroll(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { - coord_t abslines; + void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor) { + gCoord abslines; #if GDISP_HARDWARE_SCROLL != GFXON - coord_t fy, dy, ix, fx, i, j; + gCoord fy, dy, ix, fx, i, j; #endif if (!lines) return; @@ -2938,7 +2938,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c return -1; #endif MUTEX_ENTER(g); - g->p.x = (coord_t)what; + g->p.x = (gCoord)what; res = gdisp_lld_query(g); MUTEX_EXIT(g); return res; @@ -2955,7 +2955,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c /* High Level Driver Routines. */ /*===========================================================================*/ -void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) { +void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) { if (cx <= 0 || cy <= 0) return; cx = x+cx-1; cy = y+cy-1; // cx, cy are now the end point. @@ -2985,7 +2985,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co } #if GDISP_NEED_CONVEX_POLYGON - void gdispGDrawPoly(GDisplay *g, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt, color_t color) { + void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) { const gPoint *epnt, *p; epnt = &pntarray[cnt-1]; @@ -3001,10 +3001,10 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co MUTEX_EXIT(g); } - void gdispGFillConvexPoly(GDisplay *g, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt, color_t color) { + void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) { const gPoint *lpnt, *rpnt, *epnts; fixed lx, rx, lk, rk; - coord_t y, ymax, lxc, rxc; + gCoord y, ymax, lxc, rxc; epnts = &pntarray[cnt-1]; @@ -3109,9 +3109,9 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co /* Find a vector (nx, ny) that is perpendicular to (dx, dy) and has length * equal to 'norm'. */ - static void get_normal_vector(coord_t dx, coord_t dy, coord_t norm, coord_t *nx, coord_t *ny) + static void get_normal_vector(gCoord dx, gCoord dy, gCoord norm, gCoord *nx, gCoord *ny) { - coord_t absDx, absDy; + gCoord absDx, absDy; int32_t len_n, len, len2; char maxSteps; @@ -3150,8 +3150,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co return; } - void gdispGDrawThickLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color, coord_t width, gBool round) { - coord_t dx, dy, nx = 0, ny = 0; + void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round) { + gCoord dx, dy, nx = 0, ny = 0; /* Compute the direction vector for the line */ dx = x1 - x0; @@ -3211,7 +3211,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * pt0 -------------------pt7 */ gPoint pntarray[8]; - coord_t nx2, ny2; + gCoord nx2, ny2; /* Magic numbers: * 75/256 = sin(45) / (1 + sqrt(2)) diagonal octagon segments @@ -3344,7 +3344,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co (void) line; (void) count; - ((coord_t*)state)[0]++; + ((gCoord*)state)[0]++; return gTrue; } static gBool mf_drawline_callback(mf_str line, uint16_t count, void *state) { @@ -3363,7 +3363,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co } #endif - void gdispGDrawChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color) { + void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color) { if (!font) return; MUTEX_ENTER(g); @@ -3378,7 +3378,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co MUTEX_EXIT(g); } - void gdispGFillChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor) { + void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color, color_t bgcolor) { if (!font) return; MUTEX_ENTER(g); @@ -3400,7 +3400,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co MUTEX_EXIT(g); } - void gdispGDrawString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color) { + void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color) { if (!font) return; MUTEX_ENTER(g); @@ -3416,7 +3416,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co MUTEX_EXIT(g); } - void gdispGFillString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color, color_t bgcolor) { + void gdispGFillString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color, color_t bgcolor) { if (!font) return; MUTEX_ENTER(g); @@ -3439,8 +3439,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co MUTEX_EXIT(g); } - 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) { - coord_t totalHeight; + void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, justify_t justify) { + gCoord totalHeight; if (!font) return; @@ -3517,8 +3517,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co MUTEX_EXIT(g); } - 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) { - coord_t totalHeight; + void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, color_t bgcolor, justify_t justify) { + gCoord totalHeight; if (!font) return; @@ -3608,7 +3608,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co MUTEX_EXIT(g); } - coord_t gdispGetFontMetric(font_t font, fontmetric_t metric) { + gCoord gdispGetFontMetric(font_t font, fontmetric_t metric) { if (!font) return 0; /* No mutex required as we only read static data */ @@ -3625,14 +3625,14 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co return 0; } - coord_t gdispGetCharWidth(char c, font_t font) { + gCoord gdispGetCharWidth(char c, font_t font) { if (!font) return 0; /* No mutex required as we only read static data */ return mf_character_width(font, c); } - coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count) { + gCoord gdispGetStringWidthCount(const char* str, font_t font, uint16_t count) { if (!str || !font) return 0; @@ -3644,7 +3644,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co #endif } - coord_t gdispGetStringWidth(const char* str, font_t font) { + gCoord gdispGetStringWidth(const char* str, font_t font) { return gdispGetStringWidthCount(str, font, 0); } #endif @@ -3732,7 +3732,7 @@ color_t gdispContrastColor(color_t color) { } #if (!defined(gdispPackPixels) && !defined(GDISP_PIXELFORMAT_CUSTOM)) - void gdispPackPixels(pixel_t *buf, coord_t cx, coord_t x, coord_t y, color_t color) { + void gdispPackPixels(pixel_t *buf, gCoord cx, gCoord x, gCoord y, color_t color) { /* No mutex required as we only read static data */ #if defined(GDISP_PIXELFORMAT_RGB888) #error "GDISP: Packed pixels not supported yet" diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h index 33ac5468..3a92d784 100644 --- a/src/gdisp/gdisp.h +++ b/src/gdisp/gdisp.h @@ -36,7 +36,7 @@ /** * @brief The type for a coordinate or length on the screen. */ -typedef int16_t coord_t; +typedef int16_t gCoord; #if GFX_USE_GDISP || defined(__DOXYGEN__) @@ -49,8 +49,8 @@ typedef int16_t coord_t; * @brief Type for a 2D point on the screen. */ typedef struct gPoint { - coord_t x; /**< The x coordinate of the point. */ - coord_t y; /**< The y coordinate of the point. */ + gCoord x; /**< The x coordinate of the point. */ + gCoord y; /**< The y coordinate of the point. */ } gPoint; /** @@ -298,7 +298,7 @@ unsigned gdispGetDisplayCount(void); * * @api */ -coord_t gdispGGetWidth(GDisplay *g); +gCoord gdispGGetWidth(GDisplay *g); #define gdispGetWidth() gdispGGetWidth(GDISP) /** @@ -310,7 +310,7 @@ coord_t gdispGGetWidth(GDisplay *g); * * @api */ -coord_t gdispGGetHeight(GDisplay *g); +gCoord gdispGGetHeight(GDisplay *g); #define gdispGetHeight() gdispGGetHeight(GDISP) /** @@ -404,7 +404,7 @@ void gdispGClear(GDisplay *g, color_t color); * * @api */ -void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color); +void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color); #define gdispDrawPixel(x,y,c) gdispGDrawPixel(GDISP,x,y,c) /** @@ -417,7 +417,7 @@ void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color); * * @api */ -void gdispGDrawLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color); +void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color); #define gdispDrawLine(x0,y0,x1,y1,c) gdispGDrawLine(GDISP,x0,y0,x1,y1,c) /** @@ -430,7 +430,7 @@ void gdispGDrawLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, * * @api */ -void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color); +void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color); #define gdispFillArea(x,y,cx,cy,c) gdispGFillArea(GDISP,x,y,cx,cy,c) /** @@ -452,7 +452,7 @@ void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c * * @api */ -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); +void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord srcx, gCoord srcy, gCoord srccx, const pixel_t *buffer); #define gdispBlitAreaEx(x,y,cx,cy,sx,sy,rx,b) gdispGBlitArea(GDISP,x,y,cx,cy,sx,sy,rx,b) /** @@ -465,7 +465,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c * * @api */ -void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color); +void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color); #define gdispDrawBox(x,y,cx,cy,c) gdispGDrawBox(GDISP,x,y,cx,cy,c) /* Streaming Functions */ @@ -495,7 +495,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGStreamStart(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy); + void gdispGStreamStart(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy); #define gdispStreamStart(x,y,cx,cy) gdispGStreamStart(GDISP,x,y,cx,cy) /** @@ -543,7 +543,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGSetClip(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy); + void gdispGSetClip(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy); #define gdispSetClip(x,y,cx,cy) gdispGSetClip(GDISP,x,y,cx,cy) #endif @@ -561,7 +561,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color); + void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color); #define gdispDrawCircle(x,y,r,c) gdispGDrawCircle(GDISP,x,y,r,c) /** @@ -575,7 +575,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color); + void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color); #define gdispFillCircle(x,y,r,c) gdispGFillCircle(GDISP,x,y,r,c) #endif @@ -593,7 +593,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillDualCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius1, color_t color1, coord_t radius2, color_t color2); + void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2); #define gdispFillDualCircle(x,y,r1,c1,r2,c2) gdispGFillDualCircle(GDISP,x,y,r1,c1,r2,c2) #endif @@ -611,7 +611,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color); + void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color); #define gdispDrawEllipse(x,y,a,b,c) gdispGDrawEllipse(GDISP,x,y,a,b,c) /** @@ -625,7 +625,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color); + void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color); #define gdispFillEllipse(x,y,a,b,c) gdispGFillEllipse(GDISP,x,y,a,b,c) #endif @@ -657,7 +657,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color); + void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color); #define gdispDrawArcSectors(x,y,r,s,c) gdispGDrawArcSectors(GDISP,x,y,r,s,c) /** @@ -686,7 +686,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color); + void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color); #define gdispFillArcSectors(x,y,r,s,c) gdispGFillArcSectors(GDISP,x,y,r,s,c) #endif @@ -713,7 +713,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color); + void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, color_t color); #define gdispDrawArc(x,y,r,s,e,c) gdispGDrawArc(GDISP,x,y,r,s,e,c) /** @@ -738,7 +738,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - 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); + void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, color_t color); #define gdispDrawThickArc(x,y,rs,re,s,e,c) gdispGDrawThickArc(GDISP,x,y,rs,re,s,e,c) /** @@ -763,7 +763,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color); + void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, color_t color); #define gdispFillArc(x,y,r,s,e,c) gdispGFillArc(GDISP,x,y,r,s,e,c) #endif @@ -780,7 +780,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - color_t gdispGGetPixelColor(GDisplay *g, coord_t x, coord_t y); + color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y); #define gdispGetPixelColor(x,y) gdispGGetPixelColor(GDISP,x,y) #endif @@ -801,7 +801,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGVerticalScroll(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor); + void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor); #define gdispVerticalScroll(x,y,cx,cy,l,b) gdispGVerticalScroll(GDISP,x,y,cx,cy,l,b) #endif @@ -855,7 +855,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawPoly(GDisplay *g, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt, color_t color); + void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color); #define gdispDrawPoly(x,y,p,i,c) gdispGDrawPoly(GDISP,x,y,p,i,c) /** @@ -879,7 +879,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillConvexPoly(GDisplay *g, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt, color_t color); + void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color); #define gdispFillConvexPoly(x,y,p,i,c) gdispGFillConvexPoly(GDISP,x,y,p,i,c) /** @@ -898,7 +898,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawThickLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color, coord_t width, gBool round); + void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round); #define gdispDrawThickLine(x0,y0,x1,y1,c,w,r) gdispGDrawThickLine(GDISP,x0,y0,x1,y1,c,w,r) #endif @@ -917,7 +917,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color); + void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color); #define gdispDrawChar(x,y,s,f,c) gdispGDrawChar(GDISP,x,y,s,f,c) /** @@ -933,7 +933,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor); + void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color, color_t bgcolor); #define gdispFillChar(x,y,s,f,c,b) gdispGFillChar(GDISP,x,y,s,f,c,b) /** @@ -948,7 +948,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color); + void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color); #define gdispDrawString(x,y,s,f,c) gdispGDrawString(GDISP,x,y,s,f,c) /** @@ -964,7 +964,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color, color_t bgcolor); + void gdispGFillString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color, color_t bgcolor); #define gdispFillString(x,y,s,f,c,b) gdispGFillString(GDISP,x,y,s,f,c,b) /** @@ -981,7 +981,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - 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); + void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, justify_t justify); #define gdispDrawStringBox(x,y,cx,cy,s,f,c,j) gdispGDrawStringBox(GDISP,x,y,cx,cy,s,f,c,j) /** @@ -1000,7 +1000,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - 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); + void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, color_t bgColor, justify_t justify); #define gdispFillStringBox(x,y,cx,cy,s,f,c,b,j) gdispGFillStringBox(GDISP,x,y,cx,cy,s,f,c,b,j) /** @@ -1013,7 +1013,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - coord_t gdispGetFontMetric(font_t font, fontmetric_t metric); + gCoord gdispGetFontMetric(font_t font, fontmetric_t metric); /** * @brief Get the pixel width of a character. @@ -1025,7 +1025,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - coord_t gdispGetCharWidth(char c, font_t font); + gCoord gdispGetCharWidth(char c, font_t font); /** * @brief Get the pixel width of a string of a given character length. @@ -1040,7 +1040,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count); + gCoord gdispGetStringWidthCount(const char* str, font_t font, uint16_t count); /** * @brief Get the pixel width of an entire string. @@ -1052,7 +1052,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - coord_t gdispGetStringWidth(const char* str, font_t font); + gCoord gdispGetStringWidth(const char* str, font_t font); /** * @brief Find a font and return it. @@ -1130,7 +1130,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGDrawRoundedBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color); + void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color); #define gdispDrawRoundedBox(x,y,cx,cy,r,c) gdispGDrawRoundedBox(GDISP,x,y,cx,cy,r,c) /** @@ -1145,7 +1145,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * * @api */ - void gdispGFillRoundedBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color); + void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color); #define gdispFillRoundedBox(x,y,cx,cy,r,c) gdispGFillRoundedBox(GDISP,x,y,cx,cy,r,c) #endif @@ -1230,6 +1230,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co /* V2 compatibility */ #if GFX_COMPAT_V2 + typedef gCoord coord_t; typedef gPoint point, point_t; #endif diff --git a/src/gdisp/gdisp_driver.h b/src/gdisp/gdisp_driver.h index dffce58d..1b6b89d6 100644 --- a/src/gdisp/gdisp_driver.h +++ b/src/gdisp/gdisp_driver.h @@ -308,7 +308,7 @@ * * @api */ - void gdispPackPixels(const pixel_t *buf, coord_t cx, coord_t x, coord_t y, color_t color); + void gdispPackPixels(const pixel_t *buf, gCoord cx, gCoord x, gCoord y, color_t color); #endif //------------------------------------------------------------------------------------------------------------ @@ -318,8 +318,8 @@ struct GDisplay { #define gvmt(g) ((const GDISPVMT const *)((g)->d.vmt)) // For ease of access to the vmt member struct GDISPControl { - coord_t Width; - coord_t Height; + gCoord Width; + gCoord Height; orientation_t Orientation; powermode_t Powermode; uint8_t Backlight; @@ -343,16 +343,16 @@ struct GDisplay { // Software clipping #if GDISP_HARDWARE_CLIP != GFXON && (GDISP_NEED_CLIP || GDISP_NEED_VALIDATION) - coord_t clipx0, clipy0; - coord_t clipx1, clipy1; /* not inclusive */ + gCoord clipx0, clipy0; + gCoord clipx1, clipy1; /* not inclusive */ #endif // Driver call parameters struct { - coord_t x, y; - coord_t cx, cy; - coord_t x1, y1; - coord_t x2, y2; + gCoord x, y; + gCoord cx, cy; + gCoord x1, y1; + gCoord x2, y2; color_t color; void *ptr; } p; @@ -365,10 +365,10 @@ struct GDisplay { font_t font; color_t color; color_t bgcolor; - coord_t clipx0, clipy0; - coord_t clipx1, clipy1; + gCoord clipx0, clipy0; + gCoord clipx1, clipy1; #if GDISP_NEED_TEXT_WORDWRAP - coord_t wrapx, wrapy; + gCoord wrapx, wrapy; justify_t lrj; #endif } t; diff --git a/src/gdisp/gdisp_image.c b/src/gdisp/gdisp_image.c index ae6a1a77..3e202b18 100644 --- a/src/gdisp/gdisp_image.c +++ b/src/gdisp/gdisp_image.c @@ -15,7 +15,7 @@ extern gdispImageError gdispImageOpen_NATIVE(gdispImage *img); extern void gdispImageClose_NATIVE(gdispImage *img); extern gdispImageError gdispImageCache_NATIVE(gdispImage *img); - extern gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy); + extern gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern delaytime_t gdispImageNext_NATIVE(gdispImage *img); #endif @@ -23,7 +23,7 @@ extern gdispImageError gdispImageOpen_GIF(gdispImage *img); extern void gdispImageClose_GIF(gdispImage *img); extern gdispImageError gdispImageCache_GIF(gdispImage *img); - extern gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy); + extern gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern delaytime_t gdispImageNext_GIF(gdispImage *img); #endif @@ -31,7 +31,7 @@ extern gdispImageError gdispImageOpen_BMP(gdispImage *img); extern void gdispImageClose_BMP(gdispImage *img); extern gdispImageError gdispImageCache_BMP(gdispImage *img); - extern gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy); + extern gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern delaytime_t gdispImageNext_BMP(gdispImage *img); extern uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img); extern color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index); @@ -42,7 +42,7 @@ extern gdispImageError gdispImageOpen_JPG(gdispImage *img); extern void gdispImageClose_JPG(gdispImage *img); extern gdispImageError gdispImageCache_JPG(gdispImage *img); - extern gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy); + extern gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern delaytime_t gdispImageNext_JPG(gdispImage *img); #endif @@ -50,7 +50,7 @@ extern gdispImageError gdispImageOpen_PNG(gdispImage *img); extern void gdispImageClose_PNG(gdispImage *img); extern gdispImageError gdispImageCache_PNG(gdispImage *img); - extern gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy); + extern gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern delaytime_t gdispImageNext_PNG(gdispImage *img); #endif @@ -61,9 +61,9 @@ typedef struct gdispImageHandlers { gdispImageError (*cache)(gdispImage *img); /* The cache function */ gdispImageError (*draw)(GDisplay *g, gdispImage *img, - coord_t x, coord_t y, - coord_t cx, coord_t cy, - coord_t sx, coord_t sy); /* The draw function */ + gCoord x, gCoord y, + gCoord cx, gCoord cy, + gCoord sx, gCoord sy); /* The draw function */ delaytime_t (*next)(gdispImage *img); /* The next frame function */ uint16_t (*getPaletteSize)(gdispImage *img); /* Retrieve the size of the palette (number of entries) */ color_t (*getPalette)(gdispImage *img, uint16_t index); /* Retrieve a specific color value of the palette */ @@ -170,7 +170,7 @@ gdispImageError gdispImageCache(gdispImage *img) { return img->fns->cache(img); } -gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) { +gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { if (!img) return GDISP_IMAGE_ERR_NULLPOINTER; if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT; diff --git a/src/gdisp/gdisp_image.h b/src/gdisp/gdisp_image.h index 99391850..864c0a20 100644 --- a/src/gdisp/gdisp_image.h +++ b/src/gdisp/gdisp_image.h @@ -60,7 +60,7 @@ typedef struct gdispImage { gdispImageType type; /* @< The image type */ gdispImageFlags flags; /* @< The image flags */ color_t bgcolor; /* @< The default background color */ - coord_t width, height; /* @< The image dimensions */ + gCoord width, height; /* @< The image dimensions */ GFILE * f; /* @< The underlying GFILE */ #if GDISP_NEED_IMAGE_ACCOUNTING uint32_t memused; /* @< How much RAM is currently allocated */ @@ -221,7 +221,7 @@ gdispImageError gdispImageCache(gdispImage *img); * is drawing. This may be significantly slower than if the image has been cached (but * uses a lot less RAM) */ -gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy); +gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); #define gdispImageDraw(img,x,y,cx,cy,sx,sy) gdispGImageDraw(GDISP,img,x,y,cx,cy,sx,sy) /** diff --git a/src/gdisp/gdisp_image_bmp.c b/src/gdisp/gdisp_image_bmp.c index 2cb00853..54e66abb 100644 --- a/src/gdisp/gdisp_image_bmp.c +++ b/src/gdisp/gdisp_image_bmp.c @@ -352,10 +352,10 @@ unsupportedcleanup: return GDISP_IMAGE_ERR_UNSUPPORTED; // Not supported } -static coord_t getPixels(gdispImage *img, coord_t x) { +static gCoord getPixels(gdispImage *img, gCoord x) { gdispImagePrivate_BMP * priv; color_t * pc; - coord_t len; + gCoord len; priv = (gdispImagePrivate_BMP *)img->priv; pc = priv->buf; @@ -695,7 +695,7 @@ gdispImageError gdispImageCache_BMP(gdispImage *img) { gdispImagePrivate_BMP * priv; color_t * pcs; color_t * pcd; - coord_t pos, x, y; + gCoord pos, x, y; size_t len; /* If we are already cached - just return OK */ @@ -749,10 +749,10 @@ gdispImageError gdispImageCache_BMP(gdispImage *img) { return GDISP_IMAGE_ERR_OK; } -gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) { +gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImagePrivate_BMP * priv; - coord_t mx, my; - coord_t pos, len, st; + gCoord mx, my; + gCoord pos, len, st; priv = (gdispImagePrivate_BMP *)img->priv; diff --git a/src/gdisp/gdisp_image_gif.c b/src/gdisp/gdisp_image_gif.c index 91a47b6c..5aaeaeb1 100644 --- a/src/gdisp/gdisp_image_gif.c +++ b/src/gdisp/gdisp_image_gif.c @@ -52,8 +52,8 @@ typedef struct gifimgdecode { // The data on a single frame typedef struct gifimgframe { - coord_t x, y; // position relative to full image - coord_t width, height; // size of frame + gCoord x, y; // position relative to full image + gCoord width, height; // size of frame uint16_t delay; // delay after processing uint8_t flags; // Local flags #define GIFL_TRANSPARENT 0x01 // There exists a transparent color @@ -80,8 +80,8 @@ typedef struct gifimgcache { typedef struct gifimgdispose { uint8_t flags; // Frame flags uint8_t paltrans; // Transparency - coord_t x, y; // position relative to full image - coord_t width, height; // size of dispose area + gCoord x, y; // position relative to full image + gCoord width, height; // size of dispose area } gifimgdispose; typedef struct gdispImagePrivate_GIF { @@ -601,7 +601,7 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) { gifimgdecode * decode; uint8_t * p; uint8_t * q; - coord_t mx, my; + gCoord mx, my; uint16_t cnt; /* If we are already cached - just return OK */ @@ -766,11 +766,11 @@ baddatacleanup: return GDISP_IMAGE_ERR_BADDATA; } -gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) { +gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImagePrivate_GIF * priv; gifimgdecode * decode; uint8_t * q = 0; - coord_t mx, my, fx, fy; + gCoord mx, my, fx, fy; uint16_t cnt, gcnt; uint8_t col; diff --git a/src/gdisp/gdisp_image_jpg.c b/src/gdisp/gdisp_image_jpg.c index 974d7142..b188f0f0 100644 --- a/src/gdisp/gdisp_image_jpg.c +++ b/src/gdisp/gdisp_image_jpg.c @@ -28,7 +28,7 @@ #define JD_WORKSZ (JD_SZBUF+2580+8) /* The extra 8 bytes just for safety */ typedef struct { - coord_t left, right, top, bottom; + gCoord left, right, top, bottom; } JRECT; /* Decompressor object structure */ typedef struct JDEC { @@ -134,7 +134,7 @@ static unsigned gdispImage_JPG_WriteToCache(gdispImage *img, void *bitmap, JRECT gdispImagePrivate_JPG *priv; uint8_t *in; pixel_t *out; - coord_t x, y; + gCoord x, y; priv = (gdispImagePrivate_JPG *)img->priv; in = (unsigned char *)bitmap; @@ -176,7 +176,7 @@ gdispImageError gdispImageCache_JPG(gdispImage *img) { return r; } -gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy){ +gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy){ gdispImagePrivate_JPG * priv; priv = (gdispImagePrivate_JPG *)img->priv; diff --git a/src/gdisp/gdisp_image_native.c b/src/gdisp/gdisp_image_native.c index 28706564..2043401c 100644 --- a/src/gdisp/gdisp_image_native.c +++ b/src/gdisp/gdisp_image_native.c @@ -93,8 +93,8 @@ gdispImageError gdispImageCache_NATIVE(gdispImage *img) { return GDISP_IMAGE_ERR_OK; } -gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) { - coord_t mx, mcx; +gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { + gCoord mx, mcx; size_t pos, len; gdispImagePrivate_NATIVE * priv; diff --git a/src/gdisp/gdisp_image_png.c b/src/gdisp/gdisp_image_png.c index 8032ffe6..9cb34cd5 100644 --- a/src/gdisp/gdisp_image_png.c +++ b/src/gdisp/gdisp_image_png.c @@ -65,10 +65,10 @@ typedef struct PNG_input { // Handle the display output and windowing typedef struct PNG_output { GDisplay *g; - coord_t x, y; - coord_t cx, cy; - coord_t sx, sy; - coord_t ix, iy; + gCoord x, y; + gCoord cx, cy; + gCoord sx, sy; + gCoord ix, iy; unsigned cnt; pixel_t buf[GDISP_IMAGE_PNG_BLIT_BUFFER_SIZE]; } PNG_output; @@ -198,7 +198,7 @@ static uint8_t PNG_iGetByte(PNG_decode *d) { *---------------------------------------------------------------*/ // Initialize the display output window -static void PNG_oInit(PNG_output *o, GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) { +static void PNG_oInit(PNG_output *o, GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { o->g = g; o->x = x; o->y = y; @@ -222,7 +222,7 @@ static void PNG_oFlush(PNG_output *o) { } // Start a new image line -static gBool PNG_oStartY(PNG_output *o, coord_t y) { +static gBool PNG_oStartY(PNG_output *o, gCoord y) { if (y < o->sy || y >= o->sy+o->cy) return gFalse; o->ix = 0; @@ -233,7 +233,7 @@ static gBool PNG_oStartY(PNG_output *o, coord_t y) { // Feed a pixel color to the display buffer static void PNG_oColor(PNG_output *o, color_t c) { // Is it in the window - if (o->ix+(coord_t)o->cnt < o->sx || o->ix+(coord_t)o->cnt >= o->sx+o->cx) { + if (o->ix+(gCoord)o->cnt < o->sx || o->ix+(gCoord)o->cnt >= o->sx+o->cx) { // No - just skip the pixel PNG_oFlush(o); o->ix++; @@ -1497,7 +1497,7 @@ exit_nonmem: return GDISP_IMAGE_ERR_NOMEMORY; } -gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) { +gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { PNG_info *pinfo; PNG_decode *d; diff --git a/src/gdisp/gdisp_pixmap.c b/src/gdisp/gdisp_pixmap.c index 88bd57a3..081db8d3 100644 --- a/src/gdisp/gdisp_pixmap.c +++ b/src/gdisp/gdisp_pixmap.c @@ -49,15 +49,15 @@ typedef struct pixmap { color_t pixels[1]; // We really want pixels[0] but some compilers don't allow that even though it is C standard. } pixmap; -GDisplay *gdispPixmapCreate(coord_t width, coord_t height) { +GDisplay *gdispPixmapCreate(gCoord width, gCoord height) { GDisplay *g; pixmap *p; unsigned i; // Calculate the size of the display surface in bytes i = width*height*sizeof(color_t); - if (i < 2*sizeof(coord_t)) - i = 2*sizeof(coord_t); + if (i < 2*sizeof(gCoord)) + i = 2*sizeof(gCoord); // Allocate the pixmap if (!(p = gfxAlloc(i+sizeof(pixmap)-sizeof(p->pixels)))) @@ -76,8 +76,8 @@ GDisplay *gdispPixmapCreate(coord_t width, coord_t height) { #endif // Save the width and height so the driver can retrieve it. - ((coord_t *)p->pixels)[0] = width; - ((coord_t *)p->pixels)[1] = height; + ((gCoord *)p->pixels)[0] = width; + ((gCoord *)p->pixels)[1] = height; // Register the driver g = (GDisplay *)gdriverRegister(&GDISPVMT_pixmap->d, p); @@ -118,8 +118,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Initialize the GDISP structure // Width and height were saved into the start of the framebuffer. - g->g.Width = ((coord_t *)((pixmap *)g->priv)->pixels)[0]; - g->g.Height = ((coord_t *)((pixmap *)g->priv)->pixels)[1]; + g->g.Width = ((gCoord *)((pixmap *)g->priv)->pixels)[0]; + g->g.Height = ((gCoord *)((pixmap *)g->priv)->pixels)[1]; g->g.Backlight = 100; g->g.Contrast = 50; g->g.Orientation = GDISP_ROTATE_0; @@ -195,7 +195,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { case GDISP_ROTATE_0: case GDISP_ROTATE_180: if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { - coord_t tmp; + gCoord tmp; tmp = g->g.Width; g->g.Width = g->g.Height; @@ -205,7 +205,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { case GDISP_ROTATE_90: case GDISP_ROTATE_270: if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { - coord_t tmp; + gCoord tmp; tmp = g->g.Width; g->g.Width = g->g.Height; diff --git a/src/gdisp/gdisp_pixmap.h b/src/gdisp/gdisp_pixmap.h index 4d5e8004..5e139796 100644 --- a/src/gdisp/gdisp_pixmap.h +++ b/src/gdisp/gdisp_pixmap.h @@ -37,7 +37,7 @@ * @note Because the RAM for the display area is allocated, on small micros only very small pixmaps should be considered. * For example a 100x100 at 16 bits per pixel would be 20K of RAM (plus some overheads). */ -GDisplay *gdispPixmapCreate(coord_t width, coord_t height); +GDisplay *gdispPixmapCreate(gCoord width, gCoord height); /** * @brief Destroy an off-screen pixmap |