Change color_t to gColor
This commit is contained in:
parent
cfb1b2a488
commit
f9c848e985
@ -153,7 +153,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
|
||||
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
|
||||
@ -164,7 +164,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
}
|
||||
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
|
||||
|
@ -145,7 +145,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
|
||||
#if defined(GDISP_USE_DMA)
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
|
||||
@ -156,7 +156,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
}
|
||||
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
|
||||
|
@ -169,7 +169,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
|
||||
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | \
|
||||
@ -182,7 +182,7 @@ static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
|
||||
}
|
||||
}
|
||||
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | \
|
||||
|
@ -22,6 +22,7 @@ FEATURE: Fixed headers to ensure size_t, NULL are always defined. size_t is not
|
||||
CHANGE: Added type gPoint to replace V2.x point and point_t
|
||||
CHANGE: Added type gCoord to replace V2.x coord_t
|
||||
CHANGE: Added type gPixel to replace V2.x pixel_t
|
||||
CHANGE: Added type gColor to replace V2.x color_t
|
||||
FIX: Added gfxRealloc() to Qt port
|
||||
FIX: Fixed UC1610 driver private area initialisation
|
||||
FIX: Fixed ST7735 driver and added kapacuk changes
|
||||
|
6
demos/3rdparty/bubbles/main.c
vendored
6
demos/3rdparty/bubbles/main.c
vendored
@ -44,7 +44,7 @@ void initialize (void)
|
||||
}
|
||||
|
||||
|
||||
void matrix (int16_t xyz[3][N], color_t col[N])
|
||||
void matrix (int16_t xyz[3][N], gColor col[N])
|
||||
{
|
||||
static uint32_t t = 0;
|
||||
int16_t x = -SCALE, y = -SCALE;
|
||||
@ -106,7 +106,7 @@ void rotate (int16_t xyz[3][N], uint16_t angleX, uint16_t angleY, uint16_t angle
|
||||
}
|
||||
|
||||
|
||||
void draw(int16_t xyz[3][N], color_t col[N])
|
||||
void draw(int16_t xyz[3][N], gColor col[N])
|
||||
{
|
||||
static uint16_t oldProjX[N] = {0};
|
||||
static uint16_t oldProjY[N] = {0};
|
||||
@ -142,7 +142,7 @@ int16_t angleX = 0, angleY = 0, angleZ = 0;
|
||||
int16_t speedX = 0, speedY = 0, speedZ = 0;
|
||||
|
||||
int16_t xyz[3][N];
|
||||
color_t col[N];
|
||||
gColor col[N];
|
||||
|
||||
|
||||
int main (void)
|
||||
|
8
demos/3rdparty/notepad-2/notepadApp.c
vendored
8
demos/3rdparty/notepad-2/notepadApp.c
vendored
@ -63,9 +63,9 @@ static GButtonObject btnClose;
|
||||
// Image object
|
||||
static gdispImage toolbarImageFilmstrip;
|
||||
|
||||
static color_t myColors[] = { GFX_BLACK, GFX_RED, GFX_GREEN, GFX_BLUE, GFX_CYAN, GFX_MAGENTA, GFX_YELLOW, GFX_WHITE };
|
||||
static gColor myColors[] = { GFX_BLACK, GFX_RED, GFX_GREEN, GFX_BLUE, GFX_CYAN, GFX_MAGENTA, GFX_YELLOW, GFX_WHITE };
|
||||
|
||||
static color_t selColor = GFX_BLACK;
|
||||
static gColor selColor = GFX_BLACK;
|
||||
static int selColorIndex = 0, selPenWidth = 1, tbMode = 1;
|
||||
|
||||
static NColorScheme nCurColorScheme;
|
||||
@ -156,7 +156,7 @@ static void nbtnColorBarSelDraw(GHandle gh, gBool enabled, gBool isdown, const c
|
||||
#define ccs nCurColorScheme
|
||||
|
||||
int i, j = 0, k;
|
||||
color_t ca, cb;
|
||||
gColor ca, cb;
|
||||
GEventMouse ptr;
|
||||
|
||||
(void)txt;
|
||||
@ -218,7 +218,7 @@ static void nbtnColorBarSelDraw(GHandle gh, gBool enabled, gBool isdown, const c
|
||||
static void nToolbarImageButtonDraw(GHandle gh, gBool isenabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
|
||||
(void)txt; (void)pstyle; (void)isenabled;
|
||||
|
||||
color_t cl = isdown ? nCurColorScheme.toolbarBgActive : nCurColorScheme.toolbarBgUnsel;
|
||||
gColor cl = isdown ? nCurColorScheme.toolbarBgActive : nCurColorScheme.toolbarBgUnsel;
|
||||
|
||||
gdispImageSetBgColor(&toolbarImageFilmstrip, cl);
|
||||
gdispFillArea(gh->x, gh->y, gh->width, gh->height, cl);
|
||||
|
6
demos/3rdparty/notepad-2/notepadCore.c
vendored
6
demos/3rdparty/notepad-2/notepadCore.c
vendored
@ -56,7 +56,7 @@ static GHandle nStatusConsole = NULL;
|
||||
static volatile gBool doExit;
|
||||
|
||||
static void draw_point(gCoord x, gCoord y) {
|
||||
color_t c = ncoreDrawingArea->color;
|
||||
gColor c = ncoreDrawingArea->color;
|
||||
|
||||
if (nMode == NCORE_MODE_DRAW)
|
||||
c = ncoreDrawingArea->color;
|
||||
@ -227,8 +227,8 @@ void ncoreSetPenWidth(uint8_t penWidth) { nPenWidth = penWidth; }
|
||||
uint8_t ncoreGetPenWidth(void) { return nPenWidth; }
|
||||
|
||||
/* Get and set the drawing color */
|
||||
void ncoreSetPenColor(color_t penColor) { gwinSetColor(ncoreDrawingArea, penColor); }
|
||||
color_t ncoreGetPenColor(void) { return ncoreDrawingArea->color; }
|
||||
void ncoreSetPenColor(gColor penColor) { gwinSetColor(ncoreDrawingArea, penColor); }
|
||||
gColor ncoreGetPenColor(void) { return ncoreDrawingArea->color; }
|
||||
|
||||
/* Set mode */
|
||||
void ncoreSetMode(uint8_t mode) { nMode = mode; }
|
||||
|
4
demos/3rdparty/notepad-2/notepadCore.h
vendored
4
demos/3rdparty/notepad-2/notepadCore.h
vendored
@ -58,8 +58,8 @@ void ncoreSetPenWidth(uint8_t penWidth);
|
||||
uint8_t ncoreGetPenWidth(void);
|
||||
|
||||
/* Get and set the drawing color */
|
||||
void ncoreSetPenColor(color_t penColor);
|
||||
color_t ncoreGetPenColor(void);
|
||||
void ncoreSetPenColor(gColor penColor);
|
||||
gColor ncoreGetPenColor(void);
|
||||
|
||||
/* Get and set the pen mode */
|
||||
void ncoreSetMode(uint8_t mode);
|
||||
|
18
demos/3rdparty/notepad-2/notepadUIDefines.h
vendored
18
demos/3rdparty/notepad-2/notepadUIDefines.h
vendored
@ -97,18 +97,18 @@
|
||||
|
||||
/* Color scheme definition */
|
||||
typedef struct colScheme {
|
||||
color_t titleBarColor;
|
||||
color_t titleTextColor;
|
||||
gColor titleBarColor;
|
||||
gColor titleTextColor;
|
||||
|
||||
color_t winBgColor;
|
||||
color_t drawingWinBorder;
|
||||
gColor winBgColor;
|
||||
gColor drawingWinBorder;
|
||||
|
||||
color_t toolbarSeparator;
|
||||
color_t toolbarBgUnsel;
|
||||
color_t toolbarBgActive;
|
||||
color_t toolbarBgSel;
|
||||
gColor toolbarSeparator;
|
||||
gColor toolbarBgUnsel;
|
||||
gColor toolbarBgActive;
|
||||
gColor toolbarBgSel;
|
||||
|
||||
color_t statusBarText;
|
||||
gColor statusBarText;
|
||||
} NColorScheme;
|
||||
|
||||
|
||||
|
@ -66,7 +66,7 @@ static DECLARE_THREAD_FUNCTION(task, param) {
|
||||
gCoord width, height, x, y, radius, ballx, bally, dx, floor;
|
||||
gCoord minx, miny, maxx, maxy, winx, winy;
|
||||
gCoord ballcx, ballcy;
|
||||
color_t colour;
|
||||
gColor colour;
|
||||
float ii, spin, dy, spinspeed, h, f, g;
|
||||
(void) param;
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
void mandelbrot(float x1, float y1, float x2, float y2) {
|
||||
unsigned int i,j, width, height;
|
||||
uint16_t iter;
|
||||
color_t color;
|
||||
gColor color;
|
||||
float fwidth, fheight;
|
||||
|
||||
float sy = y2 - y1;
|
||||
|
@ -74,7 +74,7 @@ void drawScreen(void) {
|
||||
GEventMouse ev;
|
||||
|
||||
int main(void) {
|
||||
color_t color = GFX_BLACK;
|
||||
gColor color = GFX_BLACK;
|
||||
uint16_t pen = 0;
|
||||
|
||||
gfxInit();
|
||||
|
@ -89,7 +89,7 @@ void benchmark(void) {
|
||||
uint32_t i, pixels, ms, pps;
|
||||
char pps_str[25];
|
||||
gCoord height, width, rx, ry, rcx, rcy;
|
||||
color_t random_color;
|
||||
gColor random_color;
|
||||
font_t font;
|
||||
|
||||
gdispSetOrientation(GDISP_ROTATE_90);
|
||||
|
@ -155,7 +155,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
|
||||
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
|
||||
@ -166,7 +166,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
}
|
||||
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
|
||||
|
@ -153,7 +153,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
|
||||
#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
|
||||
@ -164,7 +164,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
}
|
||||
}
|
||||
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer);
|
||||
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
|
||||
|
@ -63,7 +63,7 @@ E C
|
||||
D
|
||||
*/
|
||||
const uint8_t sevenSegNumbers[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; // 0,1,2,3,4,5,6,7,8,9
|
||||
const color_t tetrisShapeColors[9] = {GFX_BLACK, HTML2COLOR(0x009000), GFX_RED, GFX_BLUE, GFX_MAGENTA, GFX_SKYBLUE, GFX_ORANGE, HTML2COLOR(0xBBBB00), GFX_WHITE}; // shape colors
|
||||
const gColor tetrisShapeColors[9] = {GFX_BLACK, HTML2COLOR(0x009000), GFX_RED, GFX_BLUE, GFX_MAGENTA, GFX_SKYBLUE, GFX_ORANGE, HTML2COLOR(0xBBBB00), GFX_WHITE}; // shape colors
|
||||
// default tetris shapes
|
||||
const int tetrisShapes[TETRIS_SHAPE_COUNT][4][2] = {
|
||||
{{4, 17},{4, 16},{5, 16},{4, 15}},
|
||||
@ -143,7 +143,7 @@ static int uitoa(unsigned int value, char * buf, int max) {
|
||||
return n;
|
||||
}
|
||||
|
||||
static void sevenSegDraw(int x, int y, uint8_t number, color_t color) {
|
||||
static void sevenSegDraw(int x, int y, uint8_t number, gColor color) {
|
||||
if (number & 0x01) gdispFillArea(x+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, y, SEVEN_SEG_WIDTH, SEVEN_SEG_HEIGHT, color); // A
|
||||
if (number & 0x02) gdispFillArea(x+SEVEN_SEG_HEIGHT+(SEVEN_SEG_SIZE*2)+SEVEN_SEG_WIDTH, y+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, SEVEN_SEG_HEIGHT, SEVEN_SEG_WIDTH, color); // B
|
||||
if (number & 0x04) gdispFillArea(x+SEVEN_SEG_HEIGHT+(SEVEN_SEG_SIZE*2)+SEVEN_SEG_WIDTH, y+(SEVEN_SEG_HEIGHT*2)+SEVEN_SEG_WIDTH+(SEVEN_SEG_SIZE*3), SEVEN_SEG_HEIGHT, SEVEN_SEG_WIDTH, color); // C
|
||||
|
@ -60,7 +60,7 @@ int main(void) {
|
||||
gCoord width, height, x, y, radius, ballx, bally, dx, floor;
|
||||
gCoord minx, miny, maxx, maxy;
|
||||
gCoord ballcx, ballcy;
|
||||
color_t colour;
|
||||
gColor colour;
|
||||
float ii, spin, dy, spinspeed, h, f, g;
|
||||
|
||||
gfxInit();
|
||||
|
@ -124,7 +124,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g)
|
||||
PIXEL_ADDR(g, pos)[0] = gdispColor2Native(g->p.color);
|
||||
}
|
||||
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g)
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g)
|
||||
{
|
||||
unsigned pos;
|
||||
LLDCOLOR_TYPE color;
|
||||
@ -255,7 +255,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g)
|
||||
|
||||
// Fill the line buffer with the solid color
|
||||
for (i = 0; i < bytes_per_pixel * g->p.cx; i += 4) {
|
||||
*((color_t*)(line + i)) = g->p.color;
|
||||
*((gColor*)(line + i)) = g->p.color;
|
||||
}
|
||||
|
||||
// Calculate the address of the first pixel of the rectangle (top left corner)
|
||||
|
@ -581,7 +581,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
* =============================== */
|
||||
|
||||
#if GDISP_HARDWARE_CLEARS
|
||||
static void subclear(GDisplay *g, color_t color) {
|
||||
static void subclear(GDisplay *g, gColor color) {
|
||||
unsigned x, y;
|
||||
uint8_t byte;
|
||||
|
||||
|
@ -99,7 +99,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
#endif
|
||||
}
|
||||
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
unsigned pos;
|
||||
uint8_t *p;
|
||||
|
||||
|
@ -222,7 +222,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -216,7 +216,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -256,7 +256,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -260,7 +260,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -289,7 +289,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -220,7 +220,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -220,7 +220,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
dummy_read(g);
|
||||
}
|
||||
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -188,7 +188,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
dummy_read(g);
|
||||
}
|
||||
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -210,7 +210,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -436,8 +436,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
while (tuples--) {
|
||||
/* Get a pixel */
|
||||
switch(pnum++ & 1) {
|
||||
case 0: c1 = (((color_t)p[0]) << 4)|(((color_t)p[1])>>4); break;
|
||||
case 1: c1 = (((color_t)p[1]&0x0F) << 8)|((color_t)p[1]); p += 3; break;
|
||||
case 0: c1 = (((gColor)p[0]) << 4)|(((gColor)p[1])>>4); break;
|
||||
case 1: c1 = (((gColor)p[1]&0x0F) << 8)|((gColor)p[1]); p += 3; break;
|
||||
}
|
||||
|
||||
/* Check for line or buffer wrapping */
|
||||
@ -454,8 +454,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
/* Get the next pixel */
|
||||
switch(pnum++ & 1) {
|
||||
case 0: c2 = (((color_t)p[0]) << 4)|(((color_t)p[1])>>4); break;
|
||||
case 1: c2 = (((color_t)p[1]&0x0F) << 8)|((color_t)p[1]); p += 3; break;
|
||||
case 0: c2 = (((gColor)p[0]) << 4)|(((gColor)p[1])>>4); break;
|
||||
case 1: c2 = (((gColor)p[1]&0x0F) << 8)|((gColor)p[1]); p += 3; break;
|
||||
}
|
||||
|
||||
/* Check for line or buffer wrapping */
|
||||
|
@ -155,7 +155,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
|
@ -165,7 +165,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
|
@ -55,7 +55,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g)
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
color_t gdisp_lld_get_pixel_color(GDisplay *g)
|
||||
gColor gdisp_lld_get_pixel_color(GDisplay *g)
|
||||
{
|
||||
return qimage_getPixel(g);
|
||||
}
|
||||
|
@ -27,12 +27,12 @@ void qimage_setPixel(GDisplay* g)
|
||||
qimage->setPixel(g->p.x, g->p.y, rgbVal);
|
||||
}
|
||||
|
||||
color_t qimage_getPixel(GDisplay* g)
|
||||
gColor qimage_getPixel(GDisplay* g)
|
||||
{
|
||||
const QImage* qimage = static_cast<const QImage*>(g->priv);
|
||||
if (!qimage) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return static_cast<color_t>(qimage->pixel(g->p.x, g->p.y));
|
||||
return static_cast<gColor>(qimage->pixel(g->p.x, g->p.y));
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
|
||||
gBool qimage_init(GDisplay* g, gCoord width, gCoord height);
|
||||
void qimage_setPixel(GDisplay* g);
|
||||
color_t qimage_getPixel(GDisplay* g);
|
||||
gColor qimage_getPixel(GDisplay* g);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -274,7 +274,7 @@ LLDSPEC void gdisp_lld_read_start(GDisplay *g) {
|
||||
dummy_read(g);
|
||||
}
|
||||
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -234,7 +234,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -65,13 +65,13 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
|
||||
#if defined(GDISP_USE_DMA) && GDISP_USE_DMA
|
||||
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
(void) buffer;
|
||||
(void) area;
|
||||
}
|
||||
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
(void) buffer;
|
||||
(void) area;
|
||||
|
@ -223,7 +223,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -266,7 +266,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
|
@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
gCoord x, y;
|
||||
LLDCOLOR_TYPE c;
|
||||
|
||||
|
@ -170,7 +170,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
setreadmode(g);
|
||||
//dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -434,7 +434,7 @@ LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color (GDisplay *g)
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color (GDisplay *g)
|
||||
{
|
||||
gCoord x, y;
|
||||
|
||||
|
@ -65,13 +65,13 @@ static GFXINLINE uint16_t read_data(GDisplay *g) {
|
||||
|
||||
#if defined(GDISP_USE_DMA) && GDISP_USE_DMA
|
||||
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
(void) buffer;
|
||||
(void) area;
|
||||
}
|
||||
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) {
|
||||
static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) {
|
||||
(void) g;
|
||||
(void) buffer;
|
||||
(void) area;
|
||||
|
@ -259,7 +259,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
|
||||
setreadmode(g);
|
||||
dummy_read(g);
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay* g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay* g) {
|
||||
uint16_t data;
|
||||
|
||||
data = read_data(g);
|
||||
|
@ -196,7 +196,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
|
@ -332,7 +332,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g) {
|
||||
#endif
|
||||
}
|
||||
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) {
|
||||
unsigned pos;
|
||||
LLDCOLOR_TYPE color;
|
||||
|
||||
|
@ -171,7 +171,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
|
@ -47,7 +47,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
(void) g;
|
||||
return 0;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
|
@ -84,7 +84,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
PIXEL_ADDR(g, pos)[0] = gdispColor2Native(g->p.color);
|
||||
}
|
||||
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
unsigned pos;
|
||||
LLDCOLOR_TYPE color;
|
||||
|
||||
|
@ -425,7 +425,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g)
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
if (context)
|
||||
return gdispNative2Color(context->framebuf[(g->p.y*GDISP_SCREEN_WIDTH)+g->p.x]);
|
||||
return 0;
|
||||
|
@ -1043,7 +1043,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
g->flags |= GDISP_FLG_WSTREAM;
|
||||
g->flags &= ~GDISP_FLG_WRAPPED;
|
||||
}
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) {
|
||||
winPriv * priv;
|
||||
COLORREF color;
|
||||
|
||||
@ -1372,7 +1372,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
winPriv * priv;
|
||||
COLORREF color;
|
||||
|
||||
|
@ -452,7 +452,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g)
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
xPriv * priv = (xPriv *)g->priv;
|
||||
XColor color;
|
||||
XImage *img;
|
||||
|
@ -574,10 +574,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
netPriv * priv;
|
||||
uint16_t buf[3];
|
||||
color_t data;
|
||||
gColor data;
|
||||
|
||||
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
|
||||
if (!(g->flags & GDISP_FLG_CONNECTED))
|
||||
|
@ -457,10 +457,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
netPriv * priv;
|
||||
uint16_t buf[3];
|
||||
color_t data;
|
||||
gColor data;
|
||||
|
||||
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
|
||||
if (!(g->flags & GDISP_FLG_CONNECTED))
|
||||
|
@ -792,7 +792,7 @@ void gdispGFlush(GDisplay *g) {
|
||||
// Don't release the mutex as gdispStreamEnd() will do that.
|
||||
}
|
||||
|
||||
void gdispGStreamColor(GDisplay *g, color_t color) {
|
||||
void gdispGStreamColor(GDisplay *g, gColor color) {
|
||||
#if !GDISP_HARDWARE_STREAM_WRITE && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
|
||||
gCoord sx1, sy1;
|
||||
#endif
|
||||
@ -978,7 +978,7 @@ void gdispGFlush(GDisplay *g) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color) {
|
||||
void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, gColor color) {
|
||||
MUTEX_ENTER(g);
|
||||
g->p.x = x;
|
||||
g->p.y = y;
|
||||
@ -988,7 +988,7 @@ void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color) {
|
||||
MUTEX_EXIT(g);
|
||||
}
|
||||
|
||||
void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color) {
|
||||
void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color) {
|
||||
MUTEX_ENTER(g);
|
||||
g->p.x = x0;
|
||||
g->p.y = y0;
|
||||
@ -1000,7 +1000,7 @@ void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, col
|
||||
MUTEX_EXIT(g);
|
||||
}
|
||||
|
||||
void gdispGClear(GDisplay *g, color_t color) {
|
||||
void gdispGClear(GDisplay *g, gColor color) {
|
||||
// Note - clear() ignores the clipping area. It clears the screen.
|
||||
MUTEX_ENTER(g);
|
||||
|
||||
@ -1083,7 +1083,7 @@ void gdispGClear(GDisplay *g, color_t color) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) {
|
||||
void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color) {
|
||||
MUTEX_ENTER(g);
|
||||
g->p.x = x;
|
||||
g->p.y = y;
|
||||
@ -1271,7 +1271,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_CIRCLE
|
||||
void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) {
|
||||
void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color) {
|
||||
gCoord a, b, P;
|
||||
|
||||
MUTEX_ENTER(g);
|
||||
@ -1313,7 +1313,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_CIRCLE
|
||||
void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) {
|
||||
void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color) {
|
||||
gCoord a, b, P;
|
||||
|
||||
MUTEX_ENTER(g);
|
||||
@ -1357,7 +1357,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
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, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2) {
|
||||
void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, gColor color1, gCoord radius2, gColor color2) {
|
||||
gCoord a, b1, b2, p1, p2;
|
||||
|
||||
MUTEX_ENTER(g);
|
||||
@ -1426,7 +1426,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ELLIPSE
|
||||
void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) {
|
||||
void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) {
|
||||
gCoord dx, dy;
|
||||
int32_t a2, b2;
|
||||
int32_t err, e2;
|
||||
@ -1465,7 +1465,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ELLIPSE
|
||||
void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) {
|
||||
void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) {
|
||||
gCoord dx, dy;
|
||||
int32_t a2, b2;
|
||||
int32_t err, e2;
|
||||
@ -1502,7 +1502,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ARCSECTORS
|
||||
void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) {
|
||||
void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color) {
|
||||
gCoord a, b, P;
|
||||
|
||||
MUTEX_ENTER(g);
|
||||
@ -1546,7 +1546,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ARCSECTORS
|
||||
void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) {
|
||||
void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color) {
|
||||
gCoord a, b, P;
|
||||
|
||||
MUTEX_ENTER(g);
|
||||
@ -1731,7 +1731,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
|
||||
void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, gColor color) {
|
||||
gCoord a, b, P, sedge, eedge;
|
||||
uint8_t full, sbit, ebit, tbit;
|
||||
|
||||
@ -1917,7 +1917,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, color_t color) {
|
||||
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, gColor color) {
|
||||
gCoord x, y, d, r;
|
||||
gCoord startTan, endTan, curangle;
|
||||
gCoord precision = 512;
|
||||
@ -2032,7 +2032,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ARC
|
||||
void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
|
||||
void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, gColor color) {
|
||||
gCoord a, b, P;
|
||||
gCoord sy, ey;
|
||||
fixed sxa, sxb, sxd, exa, exb, exd;
|
||||
@ -2534,7 +2534,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
|
||||
void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
|
||||
void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color) {
|
||||
if (2*radius > cx || 2*radius > cy) {
|
||||
gdispGDrawBox(g, x, y, cx, cy, color);
|
||||
return;
|
||||
@ -2559,7 +2559,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
|
||||
void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
|
||||
void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color) {
|
||||
gCoord radius2;
|
||||
|
||||
radius2 = radius*2;
|
||||
@ -2585,8 +2585,8 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_PIXELREAD
|
||||
color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y) {
|
||||
color_t c;
|
||||
gColor gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y) {
|
||||
gColor c;
|
||||
|
||||
/* Always synchronous as it must return a value */
|
||||
MUTEX_ENTER(g);
|
||||
@ -2632,7 +2632,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_SCROLL
|
||||
void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor) {
|
||||
void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, gColor bgcolor) {
|
||||
gCoord abslines;
|
||||
#if GDISP_HARDWARE_SCROLL != GFXON
|
||||
gCoord fy, dy, ix, fx, i, j;
|
||||
@ -2955,7 +2955,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
/* High Level Driver Routines. */
|
||||
/*===========================================================================*/
|
||||
|
||||
void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) {
|
||||
void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
}
|
||||
|
||||
#if GDISP_NEED_CONVEX_POLYGON
|
||||
void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) {
|
||||
void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color) {
|
||||
const gPoint *epnt, *p;
|
||||
|
||||
epnt = &pntarray[cnt-1];
|
||||
@ -3001,7 +3001,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
MUTEX_EXIT(g);
|
||||
}
|
||||
|
||||
void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) {
|
||||
void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color) {
|
||||
const gPoint *lpnt, *rpnt, *epnts;
|
||||
fixed lx, rx, lk, rk;
|
||||
gCoord y, ymax, lxc, rxc;
|
||||
@ -3150,7 +3150,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
return;
|
||||
}
|
||||
|
||||
void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round) {
|
||||
void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color, gCoord width, gBool round) {
|
||||
gCoord dx, dy, nx = 0, ny = 0;
|
||||
|
||||
/* Compute the direction vector for the line */
|
||||
@ -3363,7 +3363,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
}
|
||||
#endif
|
||||
|
||||
void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color) {
|
||||
void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, gColor color) {
|
||||
if (!font)
|
||||
return;
|
||||
MUTEX_ENTER(g);
|
||||
@ -3378,7 +3378,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
MUTEX_EXIT(g);
|
||||
}
|
||||
|
||||
void gdispGFillChar(GDisplay *g, gCoord x, gCoord 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, gColor color, gColor bgcolor) {
|
||||
if (!font)
|
||||
return;
|
||||
MUTEX_ENTER(g);
|
||||
@ -3400,7 +3400,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
MUTEX_EXIT(g);
|
||||
}
|
||||
|
||||
void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color) {
|
||||
void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, gColor color) {
|
||||
if (!font)
|
||||
return;
|
||||
MUTEX_ENTER(g);
|
||||
@ -3416,7 +3416,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
MUTEX_EXIT(g);
|
||||
}
|
||||
|
||||
void gdispGFillString(GDisplay *g, gCoord x, gCoord 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, gColor color, gColor bgcolor) {
|
||||
if (!font)
|
||||
return;
|
||||
MUTEX_ENTER(g);
|
||||
@ -3439,7 +3439,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
MUTEX_EXIT(g);
|
||||
}
|
||||
|
||||
void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord 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, gColor color, justify_t justify) {
|
||||
gCoord totalHeight;
|
||||
|
||||
if (!font)
|
||||
@ -3517,7 +3517,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
MUTEX_EXIT(g);
|
||||
}
|
||||
|
||||
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) {
|
||||
void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, gColor color, gColor bgcolor, justify_t justify) {
|
||||
gCoord totalHeight;
|
||||
|
||||
if (!font)
|
||||
@ -3652,7 +3652,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
#if GDISP_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888
|
||||
// Special alpha hacked version.
|
||||
// Note: this will still work with real RGB888
|
||||
color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha)
|
||||
gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha)
|
||||
{
|
||||
uint32_t ratio;
|
||||
uint32_t a1, r1, g1, b1;
|
||||
@ -3699,7 +3699,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
return ARGB2COLOR(a1, r1, g1, b1);
|
||||
}
|
||||
#else
|
||||
color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha)
|
||||
gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha)
|
||||
{
|
||||
uint16_t fg_ratio = alpha + 1;
|
||||
uint16_t bg_ratio = 256 - alpha;
|
||||
@ -3721,7 +3721,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
}
|
||||
#endif
|
||||
|
||||
color_t gdispContrastColor(color_t color) {
|
||||
gColor gdispContrastColor(gColor color) {
|
||||
uint16_t r, g, b;
|
||||
|
||||
r = RED_OF(color) > 128 ? 0 : 255;
|
||||
@ -3732,7 +3732,7 @@ color_t gdispContrastColor(color_t color) {
|
||||
}
|
||||
|
||||
#if (!defined(gdispPackPixels) && !defined(GDISP_PIXELFORMAT_CUSTOM))
|
||||
void gdispPackPixels(gPixel *buf, gCoord cx, gCoord x, gCoord y, color_t color) {
|
||||
void gdispPackPixels(gPixel *buf, gCoord cx, gCoord x, gCoord y, gColor color) {
|
||||
/* No mutex required as we only read static data */
|
||||
#if defined(GDISP_PIXELFORMAT_RGB888)
|
||||
#error "GDISP: Packed pixels not supported yet"
|
||||
|
@ -223,7 +223,7 @@ extern GDisplay *GDISP;
|
||||
/**
|
||||
* @brief The type of a pixel.
|
||||
*/
|
||||
typedef color_t gPixel;
|
||||
typedef gColor gPixel;
|
||||
|
||||
/* Color Utility Functions */
|
||||
|
||||
@ -237,7 +237,7 @@ typedef color_t gPixel;
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha);
|
||||
gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha);
|
||||
|
||||
/**
|
||||
* @brief Find a contrasting color
|
||||
@ -247,7 +247,7 @@ color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha);
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
color_t gdispContrastColor(color_t color);
|
||||
gColor gdispContrastColor(gColor color);
|
||||
|
||||
/* Base Functions */
|
||||
|
||||
@ -392,7 +392,7 @@ void gdispGFlush(GDisplay *g);
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGClear(GDisplay *g, color_t color);
|
||||
void gdispGClear(GDisplay *g, gColor color);
|
||||
#define gdispClear(c) gdispGClear(GDISP, c)
|
||||
|
||||
/**
|
||||
@ -404,7 +404,7 @@ void gdispGClear(GDisplay *g, color_t color);
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color);
|
||||
void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, gColor color);
|
||||
#define gdispDrawPixel(x,y,c) gdispGDrawPixel(GDISP,x,y,c)
|
||||
|
||||
/**
|
||||
@ -417,7 +417,7 @@ void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color);
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color);
|
||||
void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color);
|
||||
#define gdispDrawLine(x0,y0,x1,y1,c) gdispGDrawLine(GDISP,x0,y0,x1,y1,c)
|
||||
|
||||
/**
|
||||
@ -430,7 +430,7 @@ void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, col
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color);
|
||||
void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color);
|
||||
#define gdispFillArea(x,y,cx,cy,c) gdispGFillArea(GDISP,x,y,cx,cy,c)
|
||||
|
||||
/**
|
||||
@ -465,7 +465,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color);
|
||||
void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color);
|
||||
#define gdispDrawBox(x,y,cx,cy,c) gdispGDrawBox(GDISP,x,y,cx,cy,c)
|
||||
|
||||
/* Streaming Functions */
|
||||
@ -511,7 +511,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGStreamColor(GDisplay *g, color_t color);
|
||||
void gdispGStreamColor(GDisplay *g, gColor color);
|
||||
#define gdispStreamColor(c) gdispGStreamColor(GDISP,c)
|
||||
|
||||
/**
|
||||
@ -561,7 +561,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color);
|
||||
void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color);
|
||||
#define gdispDrawCircle(x,y,r,c) gdispGDrawCircle(GDISP,x,y,r,c)
|
||||
|
||||
/**
|
||||
@ -575,7 +575,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color);
|
||||
void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color);
|
||||
#define gdispFillCircle(x,y,r,c) gdispGFillCircle(GDISP,x,y,r,c)
|
||||
#endif
|
||||
|
||||
@ -593,7 +593,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2);
|
||||
void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, gColor color1, gCoord radius2, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color);
|
||||
void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color);
|
||||
#define gdispDrawEllipse(x,y,a,b,c) gdispGDrawEllipse(GDISP,x,y,a,b,c)
|
||||
|
||||
/**
|
||||
@ -625,7 +625,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color);
|
||||
void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color);
|
||||
#define gdispFillEllipse(x,y,a,b,c) gdispGFillEllipse(GDISP,x,y,a,b,c)
|
||||
#endif
|
||||
|
||||
@ -657,7 +657,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color);
|
||||
void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color);
|
||||
#define gdispDrawArcSectors(x,y,r,s,c) gdispGDrawArcSectors(GDISP,x,y,r,s,c)
|
||||
|
||||
/**
|
||||
@ -686,7 +686,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color);
|
||||
void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color);
|
||||
#define gdispFillArcSectors(x,y,r,s,c) gdispGFillArcSectors(GDISP,x,y,r,s,c)
|
||||
#endif
|
||||
|
||||
@ -713,7 +713,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, color_t color);
|
||||
void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, color_t color);
|
||||
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, color_t color);
|
||||
void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y);
|
||||
gColor gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y);
|
||||
#define gdispGetPixelColor(x,y) gdispGGetPixelColor(GDISP,x,y)
|
||||
#endif
|
||||
|
||||
@ -801,7 +801,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor);
|
||||
void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color);
|
||||
void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color);
|
||||
#define gdispDrawPoly(x,y,p,i,c) gdispGDrawPoly(GDISP,x,y,p,i,c)
|
||||
|
||||
/**
|
||||
@ -879,7 +879,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color);
|
||||
void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color);
|
||||
#define gdispFillConvexPoly(x,y,p,i,c) gdispGFillConvexPoly(GDISP,x,y,p,i,c)
|
||||
|
||||
/**
|
||||
@ -898,7 +898,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round);
|
||||
void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color);
|
||||
void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, gColor color);
|
||||
#define gdispDrawChar(x,y,s,f,c) gdispGDrawChar(GDISP,x,y,s,f,c)
|
||||
|
||||
/**
|
||||
@ -933,7 +933,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillChar(GDisplay *g, gCoord x, gCoord 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, gColor color, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color);
|
||||
void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, gColor color);
|
||||
#define gdispDrawString(x,y,s,f,c) gdispGDrawString(GDISP,x,y,s,f,c)
|
||||
|
||||
/**
|
||||
@ -964,7 +964,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillString(GDisplay *g, gCoord x, gCoord 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, gColor color, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord 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, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
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);
|
||||
void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, gColor color, gColor 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)
|
||||
|
||||
/**
|
||||
@ -1130,7 +1130,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color);
|
||||
void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color);
|
||||
void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor 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, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
|
||||
|
||||
/* V2 compatibility */
|
||||
#if GFX_COMPAT_V2
|
||||
typedef gColor color_t;
|
||||
typedef gPixel pixel_t;
|
||||
typedef gCoord coord_t;
|
||||
typedef gPoint point, point_t;
|
||||
|
@ -188,17 +188,17 @@ typedef uint16_t colorformat;
|
||||
* tv luminance (0.26126R + 0.7152G + 0.0722B), digital tv luminance of (0.299R + 0.587G + 0.114B), or
|
||||
* @p LUMA_OF() which uses (0.25R + 0.5G + 0.25B).
|
||||
*/
|
||||
#define LUMA2COLOR(l) ((color_t)((((l) & 0xF8)<<8) | (((l) & 0xFC)<<3) | (((l) & 0xF8)>>3)))
|
||||
#define LUMA2COLOR(l) ((gColor)((((l) & 0xF8)<<8) | (((l) & 0xFC)<<3) | (((l) & 0xF8)>>3)))
|
||||
|
||||
/**
|
||||
* @brief Convert red, green, blue (each 0 to 255) into a color value.
|
||||
*/
|
||||
#define RGB2COLOR(r,g,b) ((color_t)((((r) & 0xF8)<<8) | (((g) & 0xFC)<<3) | (((b) & 0xF8)>>3)))
|
||||
#define RGB2COLOR(r,g,b) ((gColor)((((r) & 0xF8)<<8) | (((g) & 0xFC)<<3) | (((b) & 0xF8)>>3)))
|
||||
|
||||
/**
|
||||
* @brief Convert a 6 digit HTML code (hex) into a color value.
|
||||
*/
|
||||
#define HTML2COLOR(h) ((color_t)((((h) & 0xF80000)>>8) | (((h) & 0x00FC00)>>5) | (((h) & 0x0000F8)>>3)))
|
||||
#define HTML2COLOR(h) ((gColor)((((h) & 0xF80000)>>8) | (((h) & 0x00FC00)>>5) | (((h) & 0x0000F8)>>3)))
|
||||
|
||||
/**
|
||||
* @name Extraction macros (quick)
|
||||
@ -434,7 +434,7 @@ typedef uint16_t colorformat;
|
||||
/**
|
||||
* @brief The color type definition
|
||||
*/
|
||||
typedef COLOR_TYPE color_t;
|
||||
typedef COLOR_TYPE gColor;
|
||||
|
||||
#endif /* GFX_USE_GDISP */
|
||||
|
||||
|
@ -284,7 +284,7 @@
|
||||
|
||||
/* Verify information for packed pixels and define a non-packed pixel macro */
|
||||
#if !GDISP_PACKED_PIXELS
|
||||
#define gdispPackPixels(buf,cx,x,y,c) { ((color_t *)(buf))[(y)*(cx)+(x)] = (c); }
|
||||
#define gdispPackPixels(buf,cx,x,y,c) { ((gColor *)(buf))[(y)*(cx)+(x)] = (c); }
|
||||
#elif !GDISP_HARDWARE_BITFILLS
|
||||
#error "GDISP: packed pixel formats are only supported for hardware accelerated drivers."
|
||||
#elif GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB888 \
|
||||
@ -308,7 +308,7 @@
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gdispPackPixels(const gPixel *buf, gCoord cx, gCoord x, gCoord y, color_t color);
|
||||
void gdispPackPixels(const gPixel *buf, gCoord cx, gCoord x, gCoord y, gColor color);
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
@ -353,7 +353,7 @@ struct GDisplay {
|
||||
gCoord cx, cy;
|
||||
gCoord x1, y1;
|
||||
gCoord x2, y2;
|
||||
color_t color;
|
||||
gColor color;
|
||||
void *ptr;
|
||||
} p;
|
||||
|
||||
@ -363,8 +363,8 @@ struct GDisplay {
|
||||
// Text rendering parameters
|
||||
struct {
|
||||
font_t font;
|
||||
color_t color;
|
||||
color_t bgcolor;
|
||||
gColor color;
|
||||
gColor bgcolor;
|
||||
gCoord clipx0, clipy0;
|
||||
gCoord clipx1, clipy1;
|
||||
#if GDISP_NEED_TEXT_WORDWRAP
|
||||
@ -375,7 +375,7 @@ struct GDisplay {
|
||||
#endif
|
||||
#if GDISP_LINEBUF_SIZE != 0 && ((GDISP_NEED_SCROLL && !GDISP_HARDWARE_SCROLL) || (!GDISP_HARDWARE_STREAM_WRITE && GDISP_HARDWARE_BITFILLS))
|
||||
// A pixel line buffer
|
||||
color_t linebuf[GDISP_LINEBUF_SIZE];
|
||||
gColor linebuf[GDISP_LINEBUF_SIZE];
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -390,13 +390,13 @@ typedef struct GDISPVMT {
|
||||
void (*writecolor)(GDisplay *g); // Uses p.color
|
||||
void (*writestop)(GDisplay *g); // Uses no parameters
|
||||
void (*readstart)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy
|
||||
color_t (*readcolor)(GDisplay *g); // Uses no parameters
|
||||
gColor (*readcolor)(GDisplay *g); // Uses no parameters
|
||||
void (*readstop)(GDisplay *g); // Uses no parameters
|
||||
void (*pixel)(GDisplay *g); // Uses p.x,p.y p.color
|
||||
void (*clear)(GDisplay *g); // Uses p.color
|
||||
void (*fill)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy p.color
|
||||
void (*blit)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy p.x1,p.y1 (=srcx,srcy) p.x2 (=srccx), p.ptr (=buffer)
|
||||
color_t (*get)(GDisplay *g); // Uses p.x,p.y
|
||||
gColor (*get)(GDisplay *g); // Uses p.x,p.y
|
||||
void (*vscroll)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy, p.y1 (=lines) p.color
|
||||
void (*control)(GDisplay *g); // Uses p.x (=what) p.ptr (=value)
|
||||
void *(*query)(GDisplay *g); // Uses p.x (=what);
|
||||
@ -526,7 +526,7 @@ typedef struct GDISPVMT {
|
||||
*
|
||||
* @note The parameter variables must not be altered by the driver.
|
||||
*/
|
||||
LLDSPEC color_t gdisp_lld_read_color(GDisplay *g);
|
||||
LLDSPEC gColor gdisp_lld_read_color(GDisplay *g);
|
||||
|
||||
/**
|
||||
* @brief End the current streaming operation
|
||||
@ -609,7 +609,7 @@ typedef struct GDISPVMT {
|
||||
*
|
||||
* @note The parameter variables must not be altered by the driver.
|
||||
*/
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g);
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g);
|
||||
#endif
|
||||
|
||||
#if (GDISP_HARDWARE_SCROLL && GDISP_NEED_SCROLL) || defined(__DOXYGEN__)
|
||||
|
@ -34,8 +34,8 @@
|
||||
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);
|
||||
extern gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, color_t newColor);
|
||||
extern gColor gdispImageGetPalette_BMP(gdispImage *img, uint16_t index);
|
||||
extern gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, gColor newColor);
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_IMAGE_JPG
|
||||
@ -66,8 +66,8 @@ typedef struct gdispImageHandlers {
|
||||
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 */
|
||||
gBool (*adjustPalette)(gdispImage *img, uint16_t index, color_t newColor); /* Replace a color value in the palette */
|
||||
gColor (*getPalette)(gdispImage *img, uint16_t index); /* Retrieve a specific color value of the palette */
|
||||
gBool (*adjustPalette)(gdispImage *img, uint16_t index, gColor newColor); /* Replace a color value in the palette */
|
||||
} gdispImageHandlers;
|
||||
|
||||
static gdispImageHandlers ImageHandlers[] = {
|
||||
@ -158,7 +158,7 @@ gBool gdispImageIsOpen(gdispImage *img) {
|
||||
return img && img->type != GDISP_IMAGE_TYPE_UNKNOWN && img->fns != 0;
|
||||
}
|
||||
|
||||
void gdispImageSetBgColor(gdispImage *img, color_t bgcolor) {
|
||||
void gdispImageSetBgColor(gdispImage *img, gColor bgcolor) {
|
||||
if (!img)
|
||||
return;
|
||||
img->bgcolor = bgcolor;
|
||||
@ -198,13 +198,13 @@ uint16_t gdispImageGetPaletteSize(gdispImage *img) {
|
||||
return img->fns->getPaletteSize(img);
|
||||
}
|
||||
|
||||
color_t gdispImageGetPalette(gdispImage *img, uint16_t index) {
|
||||
gColor gdispImageGetPalette(gdispImage *img, uint16_t index) {
|
||||
if (!img || !img->fns) return 0;
|
||||
if (!img->fns->getPalette) return 0;
|
||||
return img->fns->getPalette(img, index);
|
||||
}
|
||||
|
||||
gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, color_t newColor) {
|
||||
gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, gColor newColor) {
|
||||
if (!img || !img->fns) return gFalse;
|
||||
if (!img->fns->adjustPalette) return gFalse;
|
||||
return img->fns->adjustPalette(img, index, newColor);
|
||||
|
@ -59,7 +59,7 @@ typedef uint16_t gdispImageFlags;
|
||||
typedef struct gdispImage {
|
||||
gdispImageType type; /* @< The image type */
|
||||
gdispImageFlags flags; /* @< The image flags */
|
||||
color_t bgcolor; /* @< The default background color */
|
||||
gColor bgcolor; /* @< The default background color */
|
||||
gCoord width, height; /* @< The image dimensions */
|
||||
GFILE * f; /* @< The underlying GFILE */
|
||||
#if GDISP_NEED_IMAGE_ACCOUNTING
|
||||
@ -182,7 +182,7 @@ gBool gdispImageIsOpen(gdispImage *img);
|
||||
* @note This color is only used when an image has to restore part of the background before
|
||||
* continuing with drawing that includes transparency eg some GIF animations.
|
||||
*/
|
||||
void gdispImageSetBgColor(gdispImage *img, color_t bgcolor);
|
||||
void gdispImageSetBgColor(gdispImage *img, gColor bgcolor);
|
||||
|
||||
/**
|
||||
* @brief Cache the image
|
||||
@ -266,7 +266,7 @@ uint16_t gdispImageGetPaletteSize(gdispImage *img);
|
||||
*
|
||||
* @note This function will return 0 if the index is out of bounds or if the image doesn't use a color palette.
|
||||
*/
|
||||
color_t gdispImageGetPalette(gdispImage *img, uint16_t index);
|
||||
gColor gdispImageGetPalette(gdispImage *img, uint16_t index);
|
||||
|
||||
/**
|
||||
* @brief Modify an entry in the color palette.
|
||||
@ -279,7 +279,7 @@ color_t gdispImageGetPalette(gdispImage *img, uint16_t index);
|
||||
* @pre gdispImageOpen() must have returned successfully.
|
||||
* @note This function will return @p gFalse if the index is out of bounds or if the image doesn't use a color palette.
|
||||
*/
|
||||
gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, color_t newColor);
|
||||
gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, gColor newColor);
|
||||
|
||||
#endif /* GFX_USE_GDISP && GDISP_NEED_IMAGE */
|
||||
#endif /* _GDISP_IMAGE_H */
|
||||
|
@ -52,7 +52,7 @@ void gdispImageClose_BMP(gdispImage *img) {
|
||||
if (priv) {
|
||||
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_4_RLE || GDISP_NEED_IMAGE_BMP_8 || GDISP_NEED_IMAGE_BMP_8_RLE
|
||||
if (priv->palette)
|
||||
gdispImageFree(img, (void *)priv->palette, priv->palsize*sizeof(color_t));
|
||||
gdispImageFree(img, (void *)priv->palette, priv->palsize*sizeof(gColor));
|
||||
#endif
|
||||
if (priv->frame0cache)
|
||||
gdispImageFree(img, (void *)priv->frame0cache, img->width*img->height*sizeof(gPixel));
|
||||
@ -262,7 +262,7 @@ gdispImageError gdispImageOpen_BMP(gdispImage *img) {
|
||||
if (priv->bmpflags & BMP_PALETTE) {
|
||||
gfileSetPos(img->f, offsetColorTable);
|
||||
|
||||
if (!(priv->palette = (color_t *)gdispImageAlloc(img, priv->palsize*sizeof(color_t))))
|
||||
if (!(priv->palette = (gColor *)gdispImageAlloc(img, priv->palsize*sizeof(gColor))))
|
||||
return GDISP_IMAGE_ERR_NOMEMORY;
|
||||
if (priv->bmpflags & BMP_V2) {
|
||||
for(aword = 0; aword < priv->palsize; aword++) {
|
||||
@ -354,7 +354,7 @@ unsupportedcleanup:
|
||||
|
||||
static gCoord getPixels(gdispImage *img, gCoord x) {
|
||||
gdispImagePrivate_BMP * priv;
|
||||
color_t * pc;
|
||||
gColor * pc;
|
||||
gCoord len;
|
||||
|
||||
priv = (gdispImagePrivate_BMP *)img->priv;
|
||||
@ -591,7 +591,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
|
||||
case 16:
|
||||
{
|
||||
uint16_t w[2];
|
||||
color_t r, g, b;
|
||||
gColor r, g, b;
|
||||
|
||||
while(x < img->width && len <= GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE-2) {
|
||||
if (gfileRead(img->f, &w, 4) != 4)
|
||||
@ -599,29 +599,29 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
|
||||
gdispImageMakeLE16(w[0]);
|
||||
gdispImageMakeLE16(w[1]);
|
||||
if (priv->shiftred < 0)
|
||||
r = (color_t)((w[0] & priv->maskred) << -priv->shiftred);
|
||||
r = (gColor)((w[0] & priv->maskred) << -priv->shiftred);
|
||||
else
|
||||
r = (color_t)((w[0] & priv->maskred) >> priv->shiftred);
|
||||
r = (gColor)((w[0] & priv->maskred) >> priv->shiftred);
|
||||
if (priv->shiftgreen < 0)
|
||||
g = (color_t)((w[0] & priv->maskgreen) << -priv->shiftgreen);
|
||||
g = (gColor)((w[0] & priv->maskgreen) << -priv->shiftgreen);
|
||||
else
|
||||
g = (color_t)((w[0] & priv->maskgreen) >> priv->shiftgreen);
|
||||
g = (gColor)((w[0] & priv->maskgreen) >> priv->shiftgreen);
|
||||
if (priv->shiftblue < 0)
|
||||
b = (color_t)((w[0] & priv->maskblue) << -priv->shiftblue);
|
||||
b = (gColor)((w[0] & priv->maskblue) << -priv->shiftblue);
|
||||
else
|
||||
b = (color_t)((w[0] & priv->maskblue) >> priv->shiftblue);
|
||||
b = (gColor)((w[0] & priv->maskblue) >> priv->shiftblue);
|
||||
/* We don't support alpha yet */
|
||||
*pc++ = RGB2COLOR(r, g, b);
|
||||
if (priv->shiftred < 0)
|
||||
r = (color_t)((w[1] & priv->maskred) << -priv->shiftred);
|
||||
r = (gColor)((w[1] & priv->maskred) << -priv->shiftred);
|
||||
else
|
||||
r = (color_t)((w[1] & priv->maskred) >> priv->shiftred);
|
||||
r = (gColor)((w[1] & priv->maskred) >> priv->shiftred);
|
||||
if (priv->shiftgreen < 0)
|
||||
g = (color_t)((w[1] & priv->maskgreen) << -priv->shiftgreen);
|
||||
g = (gColor)((w[1] & priv->maskgreen) << -priv->shiftgreen);
|
||||
else
|
||||
g = (color_t)((w[1] & priv->maskgreen) >> priv->shiftgreen);
|
||||
g = (gColor)((w[1] & priv->maskgreen) >> priv->shiftgreen);
|
||||
if (priv->shiftblue < 0)
|
||||
b = (color_t)((w[1] & priv->maskblue) << -priv->shiftblue);
|
||||
b = (gColor)((w[1] & priv->maskblue) << -priv->shiftblue);
|
||||
else
|
||||
b = (uint8_t)((w[1] & priv->maskblue) >> priv->shiftblue);
|
||||
/* We don't support alpha yet */
|
||||
@ -659,24 +659,24 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
|
||||
case 32:
|
||||
{
|
||||
uint32_t dw;
|
||||
color_t r, g, b;
|
||||
gColor r, g, b;
|
||||
|
||||
while(x < img->width && len < GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE) {
|
||||
if (gfileRead(img->f, &dw, 4) != 4)
|
||||
return 0;
|
||||
gdispImageMakeLE32(dw);
|
||||
if (priv->shiftred < 0)
|
||||
r = (color_t)((dw & priv->maskred) << -priv->shiftred);
|
||||
r = (gColor)((dw & priv->maskred) << -priv->shiftred);
|
||||
else
|
||||
r = (color_t)((dw & priv->maskred) >> priv->shiftred);
|
||||
r = (gColor)((dw & priv->maskred) >> priv->shiftred);
|
||||
if (priv->shiftgreen < 0)
|
||||
g = (color_t)((dw & priv->maskgreen) << -priv->shiftgreen);
|
||||
g = (gColor)((dw & priv->maskgreen) << -priv->shiftgreen);
|
||||
else
|
||||
g = (color_t)((dw & priv->maskgreen) >> priv->shiftgreen);
|
||||
g = (gColor)((dw & priv->maskgreen) >> priv->shiftgreen);
|
||||
if (priv->shiftblue < 0)
|
||||
b = (color_t)((dw & priv->maskblue) << -priv->shiftblue);
|
||||
b = (gColor)((dw & priv->maskblue) << -priv->shiftblue);
|
||||
else
|
||||
b = (color_t)((dw & priv->maskblue) >> priv->shiftblue);
|
||||
b = (gColor)((dw & priv->maskblue) >> priv->shiftblue);
|
||||
/* We don't support alpha yet */
|
||||
*pc++ = RGB2COLOR(r, g, b);
|
||||
x++;
|
||||
@ -693,8 +693,8 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
|
||||
|
||||
gdispImageError gdispImageCache_BMP(gdispImage *img) {
|
||||
gdispImagePrivate_BMP * priv;
|
||||
color_t * pcs;
|
||||
color_t * pcd;
|
||||
gColor * pcs;
|
||||
gColor * pcd;
|
||||
gCoord pos, x, y;
|
||||
size_t len;
|
||||
|
||||
@ -839,7 +839,7 @@ uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img) {
|
||||
#endif
|
||||
}
|
||||
|
||||
color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index) {
|
||||
gColor gdispImageGetPalette_BMP(gdispImage *img, uint16_t index) {
|
||||
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8
|
||||
gdispImagePrivate_BMP *priv;
|
||||
|
||||
@ -860,7 +860,7 @@ color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index) {
|
||||
#endif
|
||||
}
|
||||
|
||||
gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, color_t newColor) {
|
||||
gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, gColor newColor) {
|
||||
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8
|
||||
gdispImagePrivate_BMP *priv;
|
||||
|
||||
|
@ -43,7 +43,7 @@ typedef struct gifimgdecode {
|
||||
uint16_t code_max;
|
||||
uint16_t code_last;
|
||||
uint32_t shiftdata;
|
||||
color_t * palette;
|
||||
gColor * palette;
|
||||
uint8_t buf[GDISP_IMAGE_GIF_BLIT_BUFFER_SIZE]; // Buffer for decoded pixels
|
||||
uint16_t prefix[1<<GIF_MAX_CODE_BITS]; // The LZW table
|
||||
uint8_t suffix[1<<GIF_MAX_CODE_BITS]; // So we can trace the codes
|
||||
@ -71,7 +71,7 @@ typedef struct gifimgframe {
|
||||
// The data for a cache
|
||||
typedef struct gifimgcache {
|
||||
gifimgframe frame;
|
||||
color_t * palette; // Local palette
|
||||
gColor * palette; // Local palette
|
||||
uint8_t * imagebits; // Image bits - only saved when caching
|
||||
struct gifimgcache *next; // Next cached frame
|
||||
} gifimgcache;
|
||||
@ -114,7 +114,7 @@ static gdispImageError startDecodeGif(gdispImage *img) {
|
||||
priv = (gdispImagePrivate_GIF *)img->priv;
|
||||
|
||||
// We need the decode ram, and possibly a palette
|
||||
if (!(decode = (gifimgdecode *)gdispImageAlloc(img, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(color_t))))
|
||||
if (!(decode = (gifimgdecode *)gdispImageAlloc(img, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(gColor))))
|
||||
return GDISP_IMAGE_ERR_NOMEMORY;
|
||||
|
||||
// We currently have not read any image data block
|
||||
@ -124,7 +124,7 @@ static gdispImageError startDecodeGif(gdispImage *img) {
|
||||
if (priv->frame.palsize) {
|
||||
// Local palette
|
||||
decode->maxpixel = priv->frame.palsize-1;
|
||||
decode->palette = (color_t *)(decode+1);
|
||||
decode->palette = (gColor *)(decode+1);
|
||||
gfileSetPos(img->f, priv->frame.pospal);
|
||||
for(cnt = 0; cnt < priv->frame.palsize; cnt++) {
|
||||
if (gfileRead(img->f, &decode->buf, 3) != 3)
|
||||
@ -161,7 +161,7 @@ static gdispImageError startDecodeGif(gdispImage *img) {
|
||||
return GDISP_IMAGE_ERR_OK;
|
||||
|
||||
baddatacleanup:
|
||||
gdispImageFree(img, decode, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(color_t));
|
||||
gdispImageFree(img, decode, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(gColor));
|
||||
return GDISP_IMAGE_ERR_BADDATA;
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ static void stopDecodeGif(gdispImage *img) {
|
||||
|
||||
// Free the decode data
|
||||
if (priv->decode) {
|
||||
gdispImageFree(img, (void *)priv->decode, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(color_t));
|
||||
gdispImageFree(img, (void *)priv->decode, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(gColor));
|
||||
priv->decode = 0;
|
||||
}
|
||||
}
|
||||
@ -504,11 +504,11 @@ void gdispImageClose_GIF(gdispImage *img) {
|
||||
cache = priv->cache;
|
||||
while(cache) {
|
||||
ncache = cache->next;
|
||||
gdispImageFree(img, (void *)cache, sizeof(gifimgcache)+cache->frame.width*cache->frame.height+cache->frame.palsize*sizeof(color_t));
|
||||
gdispImageFree(img, (void *)cache, sizeof(gifimgcache)+cache->frame.width*cache->frame.height+cache->frame.palsize*sizeof(gColor));
|
||||
cache = ncache;
|
||||
}
|
||||
if (priv->palette)
|
||||
gdispImageFree(img, (void *)priv->palette, priv->palsize*sizeof(color_t));
|
||||
gdispImageFree(img, (void *)priv->palette, priv->palsize*sizeof(gColor));
|
||||
gdispImageFree(img, (void *)priv, sizeof(gdispImagePrivate_GIF));
|
||||
img->priv = 0;
|
||||
}
|
||||
@ -559,7 +559,7 @@ gdispImageError gdispImageOpen_GIF(gdispImage *img) {
|
||||
// Global color table
|
||||
priv->palsize = 2 << (((uint8_t *)priv->buf)[4] & 0x07);
|
||||
// Allocate the global palette
|
||||
if (!(priv->palette = (color_t *)gdispImageAlloc(img, priv->palsize*sizeof(color_t))))
|
||||
if (!(priv->palette = (gColor *)gdispImageAlloc(img, priv->palsize*sizeof(gColor))))
|
||||
goto nomemcleanup;
|
||||
// Read the global palette
|
||||
for(aword = 0; aword < priv->palsize; aword++) {
|
||||
@ -610,13 +610,13 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) {
|
||||
return GDISP_IMAGE_ERR_OK;
|
||||
|
||||
/* We need to allocate the frame, the palette and bits for the image */
|
||||
if (!(cache = (gifimgcache *)gdispImageAlloc(img, sizeof(gifimgcache) + priv->frame.palsize*sizeof(color_t) + priv->frame.width*priv->frame.height)))
|
||||
if (!(cache = (gifimgcache *)gdispImageAlloc(img, sizeof(gifimgcache) + priv->frame.palsize*sizeof(gColor) + priv->frame.width*priv->frame.height)))
|
||||
return GDISP_IMAGE_ERR_NOMEMORY;
|
||||
|
||||
/* Initialise the cache */
|
||||
decode = 0;
|
||||
cache->frame = priv->frame;
|
||||
cache->imagebits = (uint8_t *)(cache+1) + cache->frame.palsize*sizeof(color_t);
|
||||
cache->imagebits = (uint8_t *)(cache+1) + cache->frame.palsize*sizeof(gColor);
|
||||
cache->next = 0;
|
||||
|
||||
/* Start the decode */
|
||||
@ -630,7 +630,7 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) {
|
||||
|
||||
// Save the palette
|
||||
if (cache->frame.palsize) {
|
||||
cache->palette = (color_t *)(cache+1);
|
||||
cache->palette = (gColor *)(cache+1);
|
||||
|
||||
/* Copy the local palette into the cache */
|
||||
for(cnt = 0; cnt < cache->frame.palsize; cnt++)
|
||||
@ -757,12 +757,12 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) {
|
||||
|
||||
nomemcleanup:
|
||||
stopDecodeGif(img);
|
||||
gdispImageFree(img, cache, sizeof(gifimgcache) + priv->frame.palsize*sizeof(color_t) + priv->frame.width*priv->frame.height);
|
||||
gdispImageFree(img, cache, sizeof(gifimgcache) + priv->frame.palsize*sizeof(gColor) + priv->frame.width*priv->frame.height);
|
||||
return GDISP_IMAGE_ERR_NOMEMORY;
|
||||
|
||||
baddatacleanup:
|
||||
stopDecodeGif(img);
|
||||
gdispImageFree(img, cache, sizeof(gifimgcache) + priv->frame.palsize*sizeof(color_t) + priv->frame.width*priv->frame.height);
|
||||
gdispImageFree(img, cache, sizeof(gifimgcache) + priv->frame.palsize*sizeof(gColor) + priv->frame.width*priv->frame.height);
|
||||
return GDISP_IMAGE_ERR_BADDATA;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ typedef struct PNG_info {
|
||||
void (*out)(struct PNG_decode *); // The scan line output function
|
||||
|
||||
#if GDISP_NEED_IMAGE_PNG_BACKGROUND
|
||||
color_t bg; // The background color
|
||||
gColor bg; // The background color
|
||||
#endif
|
||||
#if GDISP_NEED_IMAGE_PNG_TRANSPARENCY
|
||||
uint16_t trans_r; // Red/grayscale component of the transparent color (PNG_COLORMODE_GRAY and PNG_COLORMODE_RGB only)
|
||||
@ -231,7 +231,7 @@ static gBool PNG_oStartY(PNG_output *o, gCoord y) {
|
||||
}
|
||||
|
||||
// Feed a pixel color to the display buffer
|
||||
static void PNG_oColor(PNG_output *o, color_t c) {
|
||||
static void PNG_oColor(PNG_output *o, gColor c) {
|
||||
// Is it in the window
|
||||
if (o->ix+(gCoord)o->cnt < o->sx || o->ix+(gCoord)o->cnt >= o->sx+o->cx) {
|
||||
// No - just skip the pixel
|
||||
|
@ -46,7 +46,7 @@ typedef struct pixmap {
|
||||
#if GDISP_NEED_PIXMAP_IMAGE
|
||||
uint8_t imghdr[8]; // This field must come just before the data member.
|
||||
#endif
|
||||
color_t pixels[1]; // We really want pixels[0] but some compilers don't allow that even though it is C standard.
|
||||
gColor pixels[1]; // We really want pixels[0] but some compilers don't allow that even though it is C standard.
|
||||
} pixmap;
|
||||
|
||||
GDisplay *gdispPixmapCreate(gCoord width, gCoord height) {
|
||||
@ -55,7 +55,7 @@ GDisplay *gdispPixmapCreate(gCoord width, gCoord height) {
|
||||
unsigned i;
|
||||
|
||||
// Calculate the size of the display surface in bytes
|
||||
i = width*height*sizeof(color_t);
|
||||
i = width*height*sizeof(gColor);
|
||||
if (i < 2*sizeof(gCoord))
|
||||
i = 2*sizeof(gCoord);
|
||||
|
||||
@ -159,7 +159,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
((pixmap *)(g)->priv)->pixels[pos] = g->p.color;
|
||||
}
|
||||
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
unsigned pos;
|
||||
|
||||
#if GDISP_NEED_CONTROL
|
||||
|
@ -30,8 +30,8 @@ static const gwinVMT basegwinVMT = {
|
||||
0, // The after-clear routine
|
||||
};
|
||||
|
||||
static color_t defaultFgColor = GFX_WHITE;
|
||||
static color_t defaultBgColor = GFX_BLACK;
|
||||
static gColor defaultFgColor = GFX_WHITE;
|
||||
static gColor defaultBgColor = GFX_BLACK;
|
||||
#if GDISP_NEED_TEXT
|
||||
static font_t defaultFont;
|
||||
#endif
|
||||
@ -161,19 +161,19 @@ void gwinClearInit(GWindowInit *pwi) {
|
||||
*p++ = 0;
|
||||
}
|
||||
|
||||
void gwinSetDefaultColor(color_t clr) {
|
||||
void gwinSetDefaultColor(gColor clr) {
|
||||
defaultFgColor = clr;
|
||||
}
|
||||
|
||||
color_t gwinGetDefaultColor(void) {
|
||||
gColor gwinGetDefaultColor(void) {
|
||||
return defaultFgColor;
|
||||
}
|
||||
|
||||
void gwinSetDefaultBgColor(color_t bgclr) {
|
||||
void gwinSetDefaultBgColor(gColor bgclr) {
|
||||
defaultBgColor = bgclr;
|
||||
}
|
||||
|
||||
color_t gwinGetDefaultBgColor(void) {
|
||||
gColor gwinGetDefaultBgColor(void) {
|
||||
return defaultBgColor;
|
||||
}
|
||||
|
||||
@ -338,8 +338,8 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_PIXELREAD
|
||||
color_t gwinGetPixelColor(GHandle gh, gCoord x, gCoord y) {
|
||||
if (!_gwinDrawStart(gh)) return (color_t)0;
|
||||
gColor gwinGetPixelColor(GHandle gh, gCoord x, gCoord y) {
|
||||
if (!_gwinDrawStart(gh)) return (gColor)0;
|
||||
return gdispGGetPixelColor(gh->display, gh->x+x, gh->y+y);
|
||||
_gwinDrawEnd(gh);
|
||||
}
|
||||
|
@ -48,8 +48,8 @@ typedef struct GWindowObject {
|
||||
gCoord y; /**< The position relative to the screen */
|
||||
gCoord width; /**< The width of this window */
|
||||
gCoord height; /**< The height of this window */
|
||||
color_t color; /**< The current foreground drawing color */
|
||||
color_t bgcolor; /**< The current background drawing color */
|
||||
gColor color; /**< The current foreground drawing color */
|
||||
gColor bgcolor; /**< The current background drawing color */
|
||||
uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */
|
||||
#if GDISP_NEED_TEXT
|
||||
font_t font; /**< The current font */
|
||||
@ -137,7 +137,7 @@ void gwinClearInit(GWindowInit *pwi);
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gwinSetDefaultColor(color_t clr);
|
||||
void gwinSetDefaultColor(gColor clr);
|
||||
|
||||
/**
|
||||
* @brief Get the default foreground color for all new GWIN windows
|
||||
@ -146,7 +146,7 @@ void gwinSetDefaultColor(color_t clr);
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
color_t gwinGetDefaultColor(void);
|
||||
gColor gwinGetDefaultColor(void);
|
||||
|
||||
/**
|
||||
* @brief Set the default background color for all new GWIN windows
|
||||
@ -155,7 +155,7 @@ color_t gwinGetDefaultColor(void);
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gwinSetDefaultBgColor(color_t bgclr);
|
||||
void gwinSetDefaultBgColor(gColor bgclr);
|
||||
|
||||
/**
|
||||
* @brief Get the default background color for all new GWIN windows
|
||||
@ -164,7 +164,7 @@ void gwinSetDefaultBgColor(color_t bgclr);
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
color_t gwinGetDefaultBgColor(void);
|
||||
gColor gwinGetDefaultBgColor(void);
|
||||
|
||||
#if GDISP_NEED_TEXT || defined(__DOXYGEN__)
|
||||
/**
|
||||
@ -871,7 +871,7 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
color_t gwinGetPixelColor(GHandle gh, gCoord x, gCoord y);
|
||||
gColor gwinGetPixelColor(GHandle gh, gCoord x, gCoord y);
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
@ -184,7 +184,7 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
|
||||
fixed alpha;
|
||||
fixed dalpha;
|
||||
gCoord i;
|
||||
color_t tcol, bcol;
|
||||
gColor tcol, bcol;
|
||||
|
||||
(void) param;
|
||||
|
||||
|
@ -255,7 +255,7 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
|
||||
fixed alpha;
|
||||
fixed dalpha;
|
||||
gCoord i;
|
||||
color_t tcol, bcol;
|
||||
gColor tcol, bcol;
|
||||
(void) param;
|
||||
|
||||
if (gw->g.vmt != (gwinVMT *)&checkboxVMT) return;
|
||||
|
@ -113,7 +113,7 @@
|
||||
return gTrue;
|
||||
}
|
||||
|
||||
static color_t ESCPrintColor(GConsoleObject *gcw) {
|
||||
static gColor ESCPrintColor(GConsoleObject *gcw) {
|
||||
switch(gcw->currattr & (ESC_REDBIT|ESC_GREENBIT|ESC_BLUEBIT|ESC_USECOLOR)) {
|
||||
case (ESC_USECOLOR):
|
||||
return GFX_BLACK;
|
||||
|
@ -230,8 +230,8 @@ GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint
|
||||
void gwinFrameDraw_Transparent(GWidgetObject *gw, void *param) {
|
||||
const GColorSet *pcol;
|
||||
gCoord pos;
|
||||
color_t contrast;
|
||||
color_t btn;
|
||||
gColor contrast;
|
||||
gColor btn;
|
||||
(void)param;
|
||||
|
||||
if (gw->g.vmt != (gwinVMT *)&frameVMT)
|
||||
|
@ -86,7 +86,7 @@ static void gl3dRedraw(GWindowObject *gh) {
|
||||
ZBuffer * zb;
|
||||
|
||||
zb = ((GGL3DObject *)gh)->glcxt->zb;
|
||||
gdispGBlitArea(gh->display, gh->x, gh->y, zb->xsize, zb->ysize, 0, 0, zb->linesize/sizeof(color_t), (const gPixel *)zb->pbuf);
|
||||
gdispGBlitArea(gh->display, gh->x, gh->y, zb->xsize, zb->ysize, 0, 0, zb->linesize/sizeof(gColor), (const gPixel *)zb->pbuf);
|
||||
}
|
||||
|
||||
static int gl3dResizeGLViewport(GLContext *c, int *xsize_ptr, int *ysize_ptr) {
|
||||
|
@ -34,7 +34,7 @@ typedef enum GGraphPointType_e {
|
||||
typedef struct GGraphPointStyle_t {
|
||||
GGraphPointType type;
|
||||
gCoord size;
|
||||
color_t color;
|
||||
gColor color;
|
||||
} GGraphPointStyle;
|
||||
|
||||
typedef enum GGraphLineType_e {
|
||||
@ -44,13 +44,13 @@ typedef enum GGraphLineType_e {
|
||||
typedef struct GGraphLineStyle_t {
|
||||
GGraphLineType type;
|
||||
gCoord size;
|
||||
color_t color;
|
||||
gColor color;
|
||||
} GGraphLineStyle;
|
||||
|
||||
typedef struct GGraphGridStyle_t {
|
||||
GGraphLineType type;
|
||||
gCoord size;
|
||||
color_t color;
|
||||
gColor color;
|
||||
gCoord spacing;
|
||||
} GGraphGridStyle;
|
||||
|
||||
|
@ -35,7 +35,7 @@ static void ImageDestroy(GWindowObject *gh) {
|
||||
|
||||
static void ImageRedraw(GHandle gh) {
|
||||
gCoord x, y, w, h, dx, dy;
|
||||
color_t bg;
|
||||
gColor bg;
|
||||
#if GWIN_NEED_IMAGE_ANIMATION
|
||||
delaytime_t delay;
|
||||
#endif
|
||||
|
@ -131,7 +131,7 @@ void gwinLabelSetBorder(GHandle gh, gBool border) {
|
||||
|
||||
static void gwinLabelDraw(GWidgetObject *gw, justify_t justify) {
|
||||
gCoord w, h;
|
||||
color_t c;
|
||||
gColor c;
|
||||
|
||||
// is it a valid handle?
|
||||
if (gw->g.vmt != (gwinVMT *)&labelVMT)
|
||||
|
@ -704,7 +704,7 @@ void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
|
||||
const gfxQueueASyncItem* qi;
|
||||
int i;
|
||||
gCoord x, y, iheight, iwidth;
|
||||
color_t fill;
|
||||
gColor fill;
|
||||
const GColorSet * ps;
|
||||
#if GWIN_NEED_LIST_IMAGES
|
||||
gCoord sy;
|
||||
|
@ -264,7 +264,7 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) {
|
||||
fixed alpha;
|
||||
fixed dalpha;
|
||||
gCoord i;
|
||||
color_t tcol, bcol;
|
||||
gColor tcol, bcol;
|
||||
(void) param;
|
||||
|
||||
if (gw->g.vmt != (gwinVMT *)&radioVMT) return;
|
||||
@ -289,7 +289,7 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) {
|
||||
fixed alpha;
|
||||
fixed dalpha;
|
||||
gCoord i;
|
||||
color_t tcol, bcol;
|
||||
gColor tcol, bcol;
|
||||
(void) param;
|
||||
|
||||
if (gw->g.vmt != (gwinVMT *)&radioVMT) return;
|
||||
|
@ -423,7 +423,7 @@ void gwinTabsetSetTab(GHandle gh) {
|
||||
#else
|
||||
static void fgarea(GWidgetObject *gw, const char *text, gCoord y, gCoord x, gCoord w) {
|
||||
const GColorSet * pcol;
|
||||
color_t tcol;
|
||||
gColor tcol;
|
||||
|
||||
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->pressed : &gw->pstyle->disabled;
|
||||
|
||||
@ -439,7 +439,7 @@ void gwinTabsetSetTab(GHandle gh) {
|
||||
const GColorSet * pcol;
|
||||
fixed alpha;
|
||||
gCoord i;
|
||||
color_t tcol, bcol;
|
||||
gColor tcol, bcol;
|
||||
|
||||
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->enabled : &gw->pstyle->disabled;
|
||||
|
||||
|
@ -35,10 +35,10 @@ struct GWidgetObject;
|
||||
* @{
|
||||
*/
|
||||
typedef struct GColorSet {
|
||||
color_t text; /**< The text color */
|
||||
color_t edge; /**< The edge color */
|
||||
color_t fill; /**< The fill color */
|
||||
color_t progress; /**< The color of progress bars */
|
||||
gColor text; /**< The text color */
|
||||
gColor edge; /**< The edge color */
|
||||
gColor fill; /**< The fill color */
|
||||
gColor progress; /**< The color of progress bars */
|
||||
} GColorSet;
|
||||
/** @} */
|
||||
|
||||
@ -50,8 +50,8 @@ typedef struct GColorSet {
|
||||
* @{
|
||||
*/
|
||||
typedef struct GWidgetStyle {
|
||||
color_t background; /**< The window background color */
|
||||
color_t focus; /**< The color when a widget is focused */
|
||||
gColor background; /**< The window background color */
|
||||
gColor focus; /**< The color when a widget is focused */
|
||||
GColorSet enabled; /**< The colors when enabled */
|
||||
GColorSet disabled; /**< The colors when disabled */
|
||||
GColorSet pressed; /**< The colors when pressed */
|
||||
|
Loading…
Reference in New Issue
Block a user