diff options
Diffstat (limited to 'src/gdisp/gdisp_image_bmp.c')
-rw-r--r-- | src/gdisp/gdisp_image_bmp.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/gdisp/gdisp_image_bmp.c b/src/gdisp/gdisp_image_bmp.c index 7c26cc22..61b801ad 100644 --- a/src/gdisp/gdisp_image_bmp.c +++ b/src/gdisp/gdisp_image_bmp.c @@ -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; |