Introduce type gImage to replace v2.x gdispImage

This commit is contained in:
Joel Bodenmann 2019-04-10 17:33:15 +02:00
parent 509fc7501e
commit 785047b0aa
32 changed files with 138 additions and 136 deletions

View File

@ -22,6 +22,7 @@ CHANGE: Added type gThread to replace V2.x gfxThreadHandle and macros G
CHANGE: Added type gThreadreturn to replace V2.x threadreturn_t and pseudo function gfxThreadReturn() to replace THREAD_RETURN() CHANGE: Added type gThreadreturn to replace V2.x threadreturn_t and pseudo function gfxThreadReturn() to replace THREAD_RETURN()
CHANGE: Added type gThreadpriority to replace V2.x threadpriority_t and values gThreadpriorityLow/Normal/High to replace LOW_/NORMAL_/HIGH_PRIORITY CHANGE: Added type gThreadpriority to replace V2.x threadpriority_t and values gThreadpriorityLow/Normal/High to replace LOW_/NORMAL_/HIGH_PRIORITY
CHANGE: Added type gPoint to replace V2.x point and point_t CHANGE: Added type gPoint to replace V2.x point and point_t
CHANGE: Added type gImage to replace V2.x gdispImage
CHANGE: Added type gCoord to replace V2.x coord_t CHANGE: Added type gCoord to replace V2.x coord_t
CHANGE: Added type gPixel to replace V2.x pixel_t CHANGE: Added type gPixel to replace V2.x pixel_t
CHANGE: Added type gColor to replace V2.x color_t CHANGE: Added type gColor to replace V2.x color_t

View File

@ -61,7 +61,7 @@ static GButtonObject btnClose;
/* static GButtonObject btnYes, btnNo; // Reserved for future use */ /* static GButtonObject btnYes, btnNo; // Reserved for future use */
// Image object // Image object
static gdispImage toolbarImageFilmstrip; static gImage toolbarImageFilmstrip;
static gColor 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 };

View File

@ -86,7 +86,7 @@ static GHandle ghRadioBlack, ghRadioWhite, ghRadioYellow;
static GHandle ghList1, ghList2, ghList3, ghList4; static GHandle ghList1, ghList2, ghList3, ghList4;
static GHandle ghImage1; static GHandle ghImage1;
static GHandle ghProgressbar1; static GHandle ghProgressbar1;
static gdispImage imgYesNo; static gImage imgYesNo;
/* Some useful macros */ /* Some useful macros */
#define ScrWidth gdispGetWidth() #define ScrWidth gdispGetWidth()

View File

@ -24,17 +24,17 @@ typedef struct { // Node properties
nodeProps jg10Field[JG10_FIELD_WIDTH][JG10_FIELD_HEIGHT]; // jg10 field array nodeProps jg10Field[JG10_FIELD_WIDTH][JG10_FIELD_HEIGHT]; // jg10 field array
gBool jg10GameOver = gFalse; gBool jg10GameOver = gFalse;
const char *jg10Graph[] = {"background.bmp", "1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "9.bmp", "10.bmp", "11.bmp", "12.bmp", "13.bmp", "14.bmp", "15.bmp", "16.bmp", "17.bmp", "18.bmp", "19.bmp", "20.bmp"}; // 21 elements (0-20) const char *jg10Graph[] = {"background.bmp", "1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "9.bmp", "10.bmp", "11.bmp", "12.bmp", "13.bmp", "14.bmp", "15.bmp", "16.bmp", "17.bmp", "18.bmp", "19.bmp", "20.bmp"}; // 21 elements (0-20)
gdispImage jg10Image[JG10_MAX_COUNT]; gImage jg10Image[JG10_MAX_COUNT];
#define JG10_ANIM_IMAGES 5 #define JG10_ANIM_IMAGES 5
#define JG10_ANIM_DELAY 60 #define JG10_ANIM_DELAY 60
const char *jg10GraphAnim[] = {"a1.bmp","a2.bmp","a3.bmp","a4.bmp","background.bmp"}; // 5 elements (0-4) const char *jg10GraphAnim[] = {"a1.bmp","a2.bmp","a3.bmp","a4.bmp","background.bmp"}; // 5 elements (0-4)
gdispImage jg10ImageAnim[JG10_ANIM_IMAGES]; gImage jg10ImageAnim[JG10_ANIM_IMAGES];
gU8 jg10MaxVal=4; // Max value in field... gU8 jg10MaxVal=4; // Max value in field...
gFont font; gFont font;
#if JG10_SHOW_SPLASH #if JG10_SHOW_SPLASH
GTimer jg10SplashBlink; GTimer jg10SplashBlink;
gBool jg10SplashTxtVisible = gFalse; gBool jg10SplashTxtVisible = gFalse;
gdispImage jg10SplashImage; gImage jg10SplashImage;
#endif #endif

View File

@ -19,7 +19,7 @@ static gI16 minesFlags; // Flag counter
static gI16 minesTime; // Time counter static gI16 minesTime; // Time counter
static GTimer minesTimeCounterTimer; static GTimer minesTimeCounterTimer;
static const char* minesGraph[] = {"1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "closed.bmp", "empty.bmp", "explode.bmp", "flag.bmp", "mine.bmp", "wrong.bmp"}; // 14 elements (0-13) static const char* minesGraph[] = {"1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "closed.bmp", "empty.bmp", "explode.bmp", "flag.bmp", "mine.bmp", "wrong.bmp"}; // 14 elements (0-13)
static gdispImage minesImage; static gImage minesImage;
static gU8 minesStatusIconWidth = 0; static gU8 minesStatusIconWidth = 0;
static gU8 minesStatusIconHeight = 0; static gU8 minesStatusIconHeight = 0;
static gBool minesFirstGame = gTrue; // Just don't clear field for the first time, as we have black screen already... :/ static gBool minesFirstGame = gTrue; // Just don't clear field for the first time, as we have black screen already... :/

View File

@ -36,7 +36,7 @@
* The ROMFS uses the file "romfs_files.h" to describe the set of files in the ROMFS. * The ROMFS uses the file "romfs_files.h" to describe the set of files in the ROMFS.
*/ */
static gdispImage myImage; static gImage myImage;
int main(void) { int main(void) {
gCoord swidth, sheight; gCoord swidth, sheight;

View File

@ -39,7 +39,7 @@
#define USE_IMAGE_CACHE GFXOFF // Only if you want to get performance at the expense of RAM #define USE_IMAGE_CACHE GFXOFF // Only if you want to get performance at the expense of RAM
#define MY_BG_COLOR RGB2COLOR(220, 220, 255) // Pale blue so we can see the transparent parts #define MY_BG_COLOR RGB2COLOR(220, 220, 255) // Pale blue so we can see the transparent parts
static gdispImage myImage; static gImage myImage;
#define SHOW_ERROR(color) gdispFillArea(errx, erry, errcx, errcy, color) #define SHOW_ERROR(color) gdispFillArea(errx, erry, errcx, errcy, color)

View File

@ -40,7 +40,7 @@
#include "gfx.h" #include "gfx.h"
static gdispImage _imgHome; static gImage _imgHome;
int main(void) int main(void)
{ {

View File

@ -97,7 +97,7 @@ static GHandle ghRadioBlack, ghRadioWhite, ghRadioYellow;
static GHandle ghList1, ghList2, ghList3, ghList4; static GHandle ghList1, ghList2, ghList3, ghList4;
static GHandle ghImage1; static GHandle ghImage1;
static GHandle ghProgressbar1; static GHandle ghProgressbar1;
static gdispImage imgYesNo; static gImage imgYesNo;
/* Some useful macros */ /* Some useful macros */
#define ScrWidth gdispGetWidth() #define ScrWidth gdispGetWidth()

View File

@ -1235,6 +1235,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
typedef gPixel pixel_t; typedef gPixel pixel_t;
typedef gCoord coord_t; typedef gCoord coord_t;
typedef gPoint point, point_t; typedef gPoint point, point_t;
typedef gImage gdispImage;
typedef gFont font_t; typedef gFont font_t;
typedef gPowermode powermode_t; typedef gPowermode powermode_t;
#define powerOff gPowerOff #define powerOff gPowerOff

View File

@ -12,62 +12,62 @@
#include "gdisp_image_support.h" #include "gdisp_image_support.h"
#if GDISP_NEED_IMAGE_NATIVE #if GDISP_NEED_IMAGE_NATIVE
extern gdispImageError gdispImageOpen_NATIVE(gdispImage *img); extern gdispImageError gdispImageOpen_NATIVE(gImage *img);
extern void gdispImageClose_NATIVE(gdispImage *img); extern void gdispImageClose_NATIVE(gImage *img);
extern gdispImageError gdispImageCache_NATIVE(gdispImage *img); extern gdispImageError gdispImageCache_NATIVE(gImage *img);
extern gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern gDelay gdispImageNext_NATIVE(gdispImage *img); extern gDelay gdispImageNext_NATIVE(gImage *img);
#endif #endif
#if GDISP_NEED_IMAGE_GIF #if GDISP_NEED_IMAGE_GIF
extern gdispImageError gdispImageOpen_GIF(gdispImage *img); extern gdispImageError gdispImageOpen_GIF(gImage *img);
extern void gdispImageClose_GIF(gdispImage *img); extern void gdispImageClose_GIF(gImage *img);
extern gdispImageError gdispImageCache_GIF(gdispImage *img); extern gdispImageError gdispImageCache_GIF(gImage *img);
extern gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern gdispImageError gdispGImageDraw_GIF(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern gDelay gdispImageNext_GIF(gdispImage *img); extern gDelay gdispImageNext_GIF(gImage *img);
#endif #endif
#if GDISP_NEED_IMAGE_BMP #if GDISP_NEED_IMAGE_BMP
extern gdispImageError gdispImageOpen_BMP(gdispImage *img); extern gdispImageError gdispImageOpen_BMP(gImage *img);
extern void gdispImageClose_BMP(gdispImage *img); extern void gdispImageClose_BMP(gImage *img);
extern gdispImageError gdispImageCache_BMP(gdispImage *img); extern gdispImageError gdispImageCache_BMP(gImage *img);
extern gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern gdispImageError gdispGImageDraw_BMP(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern gDelay gdispImageNext_BMP(gdispImage *img); extern gDelay gdispImageNext_BMP(gImage *img);
extern gU16 gdispImageGetPaletteSize_BMP(gdispImage *img); extern gU16 gdispImageGetPaletteSize_BMP(gImage *img);
extern gColor gdispImageGetPalette_BMP(gdispImage *img, gU16 index); extern gColor gdispImageGetPalette_BMP(gImage *img, gU16 index);
extern gBool gdispImageAdjustPalette_BMP(gdispImage *img, gU16 index, gColor newColor); extern gBool gdispImageAdjustPalette_BMP(gImage *img, gU16 index, gColor newColor);
#endif #endif
#if GDISP_NEED_IMAGE_JPG #if GDISP_NEED_IMAGE_JPG
extern gdispImageError gdispImageOpen_JPG(gdispImage *img); extern gdispImageError gdispImageOpen_JPG(gImage *img);
extern void gdispImageClose_JPG(gdispImage *img); extern void gdispImageClose_JPG(gImage *img);
extern gdispImageError gdispImageCache_JPG(gdispImage *img); extern gdispImageError gdispImageCache_JPG(gImage *img);
extern gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern gdispImageError gdispGImageDraw_JPG(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern gDelay gdispImageNext_JPG(gdispImage *img); extern gDelay gdispImageNext_JPG(gImage *img);
#endif #endif
#if GDISP_NEED_IMAGE_PNG #if GDISP_NEED_IMAGE_PNG
extern gdispImageError gdispImageOpen_PNG(gdispImage *img); extern gdispImageError gdispImageOpen_PNG(gImage *img);
extern void gdispImageClose_PNG(gdispImage *img); extern void gdispImageClose_PNG(gImage *img);
extern gdispImageError gdispImageCache_PNG(gdispImage *img); extern gdispImageError gdispImageCache_PNG(gImage *img);
extern gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); extern gdispImageError gdispGImageDraw_PNG(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern gDelay gdispImageNext_PNG(gdispImage *img); extern gDelay gdispImageNext_PNG(gImage *img);
#endif #endif
/* The structure defining the routines for image drawing */ /* The structure defining the routines for image drawing */
typedef struct gdispImageHandlers { typedef struct gdispImageHandlers {
gdispImageError (*open)(gdispImage *img); /* The open function */ gdispImageError (*open)(gImage *img); /* The open function */
void (*close)(gdispImage *img); /* The close function */ void (*close)(gImage *img); /* The close function */
gdispImageError (*cache)(gdispImage *img); /* The cache function */ gdispImageError (*cache)(gImage *img); /* The cache function */
gdispImageError (*draw)(GDisplay *g, gdispImageError (*draw)(GDisplay *g,
gdispImage *img, gImage *img,
gCoord x, gCoord y, gCoord x, gCoord y,
gCoord cx, gCoord cy, gCoord cx, gCoord cy,
gCoord sx, gCoord sy); /* The draw function */ gCoord sx, gCoord sy); /* The draw function */
gDelay (*next)(gdispImage *img); /* The next frame function */ gDelay (*next)(gImage *img); /* The next frame function */
gU16 (*getPaletteSize)(gdispImage *img); /* Retrieve the size of the palette (number of entries) */ gU16 (*getPaletteSize)(gImage *img); /* Retrieve the size of the palette (number of entries) */
gColor (*getPalette)(gdispImage *img, gU16 index); /* Retrieve a specific color value of the palette */ gColor (*getPalette)(gImage *img, gU16 index); /* Retrieve a specific color value of the palette */
gBool (*adjustPalette)(gdispImage *img, gU16 index, gColor newColor); /* Replace a color value in the palette */ gBool (*adjustPalette)(gImage *img, gU16 index, gColor newColor); /* Replace a color value in the palette */
} gdispImageHandlers; } gdispImageHandlers;
static gdispImageHandlers ImageHandlers[] = { static gdispImageHandlers ImageHandlers[] = {
@ -103,11 +103,11 @@ static gdispImageHandlers ImageHandlers[] = {
#endif #endif
}; };
void gdispImageInit(gdispImage *img) { void gdispImageInit(gImage *img) {
img->type = GDISP_IMAGE_TYPE_UNKNOWN; img->type = GDISP_IMAGE_TYPE_UNKNOWN;
} }
gdispImageError gdispImageOpenGFile(gdispImage *img, GFILE *f) { gdispImageError gdispImageOpenGFile(gImage *img, GFILE *f) {
gdispImageError err; gdispImageError err;
if (!img) if (!img)
@ -142,7 +142,7 @@ unrecoverable:
return err; return err;
} }
void gdispImageClose(gdispImage *img) { void gdispImageClose(gImage *img) {
if (!img) if (!img)
return; return;
if (img->fns) if (img->fns)
@ -154,23 +154,23 @@ void gdispImageClose(gdispImage *img) {
img->priv = 0; img->priv = 0;
} }
gBool gdispImageIsOpen(gdispImage *img) { gBool gdispImageIsOpen(gImage *img) {
return img && img->type != GDISP_IMAGE_TYPE_UNKNOWN && img->fns != 0; return img && img->type != GDISP_IMAGE_TYPE_UNKNOWN && img->fns != 0;
} }
void gdispImageSetBgColor(gdispImage *img, gColor bgcolor) { void gdispImageSetBgColor(gImage *img, gColor bgcolor) {
if (!img) if (!img)
return; return;
img->bgcolor = bgcolor; img->bgcolor = bgcolor;
} }
gdispImageError gdispImageCache(gdispImage *img) { gdispImageError gdispImageCache(gImage *img) {
if (!img) return GDISP_IMAGE_ERR_NULLPOINTER; if (!img) return GDISP_IMAGE_ERR_NULLPOINTER;
if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT; if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT;
return img->fns->cache(img); return img->fns->cache(img);
} }
gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImageError gdispGImageDraw(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
if (!img) return GDISP_IMAGE_ERR_NULLPOINTER; if (!img) return GDISP_IMAGE_ERR_NULLPOINTER;
if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT; if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT;
@ -186,25 +186,25 @@ gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y
return img->fns->draw(g, img, x, y, cx, cy, sx, sy); return img->fns->draw(g, img, x, y, cx, cy, sx, sy);
} }
gDelay gdispImageNext(gdispImage *img) { gDelay gdispImageNext(gImage *img) {
if (!img) return GDISP_IMAGE_ERR_NULLPOINTER; if (!img) return GDISP_IMAGE_ERR_NULLPOINTER;
if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT; if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT;
return img->fns->next(img); return img->fns->next(img);
} }
gU16 gdispImageGetPaletteSize(gdispImage *img) { gU16 gdispImageGetPaletteSize(gImage *img) {
if (!img || !img->fns) return 0; if (!img || !img->fns) return 0;
if (!img->fns->getPaletteSize) return 0; if (!img->fns->getPaletteSize) return 0;
return img->fns->getPaletteSize(img); return img->fns->getPaletteSize(img);
} }
gColor gdispImageGetPalette(gdispImage *img, gU16 index) { gColor gdispImageGetPalette(gImage *img, gU16 index) {
if (!img || !img->fns) return 0; if (!img || !img->fns) return 0;
if (!img->fns->getPalette) return 0; if (!img->fns->getPalette) return 0;
return img->fns->getPalette(img, index); return img->fns->getPalette(img, index);
} }
gBool gdispImageAdjustPalette(gdispImage *img, gU16 index, gColor newColor) { gBool gdispImageAdjustPalette(gImage *img, gU16 index, gColor newColor) {
if (!img || !img->fns) return gFalse; if (!img || !img->fns) return gFalse;
if (!img->fns->adjustPalette) return gFalse; if (!img->fns->adjustPalette) return gFalse;
return img->fns->adjustPalette(img, index, newColor); return img->fns->adjustPalette(img, index, newColor);
@ -212,7 +212,7 @@ gBool gdispImageAdjustPalette(gdispImage *img, gU16 index, gColor newColor) {
// Helper Routines // Helper Routines
void *gdispImageAlloc(gdispImage *img, gMemSize sz) { void *gdispImageAlloc(gImage *img, gMemSize sz) {
#if GDISP_NEED_IMAGE_ACCOUNTING #if GDISP_NEED_IMAGE_ACCOUNTING
void *ptr; void *ptr;
@ -229,7 +229,7 @@ void *gdispImageAlloc(gdispImage *img, gMemSize sz) {
#endif #endif
} }
void gdispImageFree(gdispImage *img, void *ptr, gMemSize sz) { void gdispImageFree(gImage *img, void *ptr, gMemSize sz) {
#if GDISP_NEED_IMAGE_ACCOUNTING #if GDISP_NEED_IMAGE_ACCOUNTING
gfxFree(ptr); gfxFree(ptr);
img->memused -= sz; img->memused -= sz;

View File

@ -56,7 +56,7 @@ typedef gU16 gdispImageFlags;
/** /**
* @brief The structure for an image * @brief The structure for an image
*/ */
typedef struct gdispImage { typedef struct gImage {
gdispImageType type; /* @< The image type */ gdispImageType type; /* @< The image type */
gdispImageFlags flags; /* @< The image flags */ gdispImageFlags flags; /* @< The image flags */
gColor bgcolor; /* @< The default background color */ gColor bgcolor; /* @< The default background color */
@ -68,15 +68,15 @@ typedef struct gdispImage {
#endif #endif
const struct gdispImageHandlers * fns; /* @< Don't mess with this! */ const struct gdispImageHandlers * fns; /* @< Don't mess with this! */
void * priv; /* @< Don't mess with this! */ void * priv; /* @< Don't mess with this! */
} gdispImage; } gImage;
/** /**
* @brief Initialise a gdispImage object * @brief Initialise a gImage object
* *
* @param[in] img The image structure to initialise * @param[in] img The image structure to initialise
* *
*/ */
void gdispImageInit(gdispImage *img); void gdispImageInit(gImage *img);
/** /**
* @brief Open an image using an open GFILE and get it ready for drawing * @brief Open an image using an open GFILE and get it ready for drawing
@ -89,7 +89,7 @@ void gdispImageInit(gdispImage *img);
* @pre The GFILE must be open for reading. * @pre The GFILE must be open for reading.
* *
* @note This determines which decoder to use and then initialises all other fields * @note This determines which decoder to use and then initialises all other fields
* in the gdispImage structure. * in the gImage structure.
* @note The image background color is set to White. * @note The image background color is set to White.
* @note There are three types of return - everything OK, partial success and unrecoverable * @note There are three types of return - everything OK, partial success and unrecoverable
* failures. For everything OK it returns GDISP_IMAGE_ERR_OK. A partial success can * failures. For everything OK it returns GDISP_IMAGE_ERR_OK. A partial success can
@ -102,7 +102,7 @@ void gdispImageInit(gdispImage *img);
* (eg GDISP_IMAGE_ERR_UNSUPPORTED_OK) * (eg GDISP_IMAGE_ERR_UNSUPPORTED_OK)
* still need to be closed when you are finished with them. * still need to be closed when you are finished with them.
*/ */
gdispImageError gdispImageOpenGFile(gdispImage *img, GFILE *f); gdispImageError gdispImageOpenGFile(gImage *img, GFILE *f);
/** /**
* @brief Open an image in a file and get it ready for drawing * @brief Open an image in a file and get it ready for drawing
@ -156,7 +156,7 @@ gdispImageError gdispImageOpenGFile(gdispImage *img, GFILE *f);
* *
* @note Also calls the IO close function (if it hasn't already been called). * @note Also calls the IO close function (if it hasn't already been called).
*/ */
void gdispImageClose(gdispImage *img); void gdispImageClose(gImage *img);
/** /**
* @brief Is an image open. * @brief Is an image open.
@ -169,7 +169,7 @@ void gdispImageClose(gdispImage *img);
* is open. Clearing the Image structure to 0's will guarantee the image * is open. Clearing the Image structure to 0's will guarantee the image
* is seen as being closed. * is seen as being closed.
*/ */
gBool gdispImageIsOpen(gdispImage *img); gBool gdispImageIsOpen(gImage *img);
/** /**
* @brief Set the background color of the image. * @brief Set the background color of the image.
@ -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 * @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. * continuing with drawing that includes transparency eg some GIF animations.
*/ */
void gdispImageSetBgColor(gdispImage *img, gColor bgcolor); void gdispImageSetBgColor(gImage *img, gColor bgcolor);
/** /**
* @brief Cache the image * @brief Cache the image
@ -200,7 +200,7 @@ void gdispImageSetBgColor(gdispImage *img, gColor bgcolor);
* example, a GDISP_IMAGE_ERR_NOMEMORY error simply means there isn't enough RAM to * example, a GDISP_IMAGE_ERR_NOMEMORY error simply means there isn't enough RAM to
* cache the image. * cache the image.
*/ */
gdispImageError gdispImageCache(gdispImage *img); gdispImageError gdispImageCache(gImage *img);
/** /**
* @brief Draw the image * @brief Draw the image
@ -221,7 +221,7 @@ gdispImageError gdispImageCache(gdispImage *img);
* is drawing. This may be significantly slower than if the image has been cached (but * is drawing. This may be significantly slower than if the image has been cached (but
* uses a lot less RAM) * uses a lot less RAM)
*/ */
gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); gdispImageError gdispGImageDraw(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
#define gdispImageDraw(img,x,y,cx,cy,sx,sy) gdispGImageDraw(GDISP,img,x,y,cx,cy,sx,sy) #define gdispImageDraw(img,x,y,cx,cy,sx,sy) gdispGImageDraw(GDISP,img,x,y,cx,cy,sx,sy)
/** /**
@ -243,7 +243,7 @@ gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y
* @note Calling gdispImageDraw() after getting a gDelayForever will go back to drawing the first * @note Calling gdispImageDraw() after getting a gDelayForever will go back to drawing the first
* frame/page. * frame/page.
*/ */
gDelay gdispImageNext(gdispImage *img); gDelay gdispImageNext(gImage *img);
/** /**
* @brief Get the number of entries in the color palette. * @brief Get the number of entries in the color palette.
@ -253,7 +253,7 @@ gDelay gdispImageNext(gdispImage *img);
* *
* @pre gdispImageOpen() must have returned successfully. * @pre gdispImageOpen() must have returned successfully.
*/ */
gU16 gdispImageGetPaletteSize(gdispImage *img); gU16 gdispImageGetPaletteSize(gImage *img);
/** /**
* @brief Get an entry in the color palette. * @brief Get an entry in the color palette.
@ -266,7 +266,7 @@ gU16 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. * @note This function will return 0 if the index is out of bounds or if the image doesn't use a color palette.
*/ */
gColor gdispImageGetPalette(gdispImage *img, gU16 index); gColor gdispImageGetPalette(gImage *img, gU16 index);
/** /**
* @brief Modify an entry in the color palette. * @brief Modify an entry in the color palette.
@ -279,7 +279,7 @@ gColor gdispImageGetPalette(gdispImage *img, gU16 index);
* @pre gdispImageOpen() must have returned successfully. * @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. * @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, gU16 index, gColor newColor); gBool gdispImageAdjustPalette(gImage *img, gU16 index, gColor newColor);
#endif /* GFX_USE_GDISP && GDISP_NEED_IMAGE */ #endif /* GFX_USE_GDISP && GDISP_NEED_IMAGE */
#endif /* _GDISP_IMAGE_H */ #endif /* _GDISP_IMAGE_H */

View File

@ -45,7 +45,7 @@ typedef struct gdispImagePrivate_BMP {
gPixel buf[GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE]; gPixel buf[GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE];
} gdispImagePrivate_BMP; } gdispImagePrivate_BMP;
void gdispImageClose_BMP(gdispImage *img) { void gdispImageClose_BMP(gImage *img) {
gdispImagePrivate_BMP *priv; gdispImagePrivate_BMP *priv;
priv = (gdispImagePrivate_BMP *)img->priv; priv = (gdispImagePrivate_BMP *)img->priv;
@ -61,7 +61,7 @@ void gdispImageClose_BMP(gdispImage *img) {
} }
} }
gdispImageError gdispImageOpen_BMP(gdispImage *img) { gdispImageError gdispImageOpen_BMP(gImage *img) {
gdispImagePrivate_BMP *priv; gdispImagePrivate_BMP *priv;
gU8 hdr[2]; gU8 hdr[2];
gU16 aword; gU16 aword;
@ -352,7 +352,7 @@ unsupportedcleanup:
return GDISP_IMAGE_ERR_UNSUPPORTED; // Not supported return GDISP_IMAGE_ERR_UNSUPPORTED; // Not supported
} }
static gCoord getPixels(gdispImage *img, gCoord x) { static gCoord getPixels(gImage *img, gCoord x) {
gdispImagePrivate_BMP * priv; gdispImagePrivate_BMP * priv;
gColor * pc; gColor * pc;
gCoord len; gCoord len;
@ -691,7 +691,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
} }
} }
gdispImageError gdispImageCache_BMP(gdispImage *img) { gdispImageError gdispImageCache_BMP(gImage *img) {
gdispImagePrivate_BMP * priv; gdispImagePrivate_BMP * priv;
gColor * pcs; gColor * pcs;
gColor * pcd; gColor * pcd;
@ -749,7 +749,7 @@ gdispImageError gdispImageCache_BMP(gdispImage *img) {
return GDISP_IMAGE_ERR_OK; return GDISP_IMAGE_ERR_OK;
} }
gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImageError gdispGImageDraw_BMP(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
gdispImagePrivate_BMP * priv; gdispImagePrivate_BMP * priv;
gCoord mx, my; gCoord mx, my;
gCoord pos, len, st; gCoord pos, len, st;
@ -815,14 +815,14 @@ gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, gCoord x, gCoo
return GDISP_IMAGE_ERR_OK; return GDISP_IMAGE_ERR_OK;
} }
gDelay gdispImageNext_BMP(gdispImage *img) { gDelay gdispImageNext_BMP(gImage *img) {
(void) img; (void) img;
/* No more frames/pages */ /* No more frames/pages */
return gDelayForever; return gDelayForever;
} }
gU16 gdispImageGetPaletteSize_BMP(gdispImage *img) { gU16 gdispImageGetPaletteSize_BMP(gImage *img) {
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8 #if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8
gdispImagePrivate_BMP *priv; gdispImagePrivate_BMP *priv;
@ -839,7 +839,7 @@ gU16 gdispImageGetPaletteSize_BMP(gdispImage *img) {
#endif #endif
} }
gColor gdispImageGetPalette_BMP(gdispImage *img, gU16 index) { gColor gdispImageGetPalette_BMP(gImage *img, gU16 index) {
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8 #if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8
gdispImagePrivate_BMP *priv; gdispImagePrivate_BMP *priv;
@ -860,7 +860,7 @@ gColor gdispImageGetPalette_BMP(gdispImage *img, gU16 index) {
#endif #endif
} }
gBool gdispImageAdjustPalette_BMP(gdispImage *img, gU16 index, gColor newColor) { gBool gdispImageAdjustPalette_BMP(gImage *img, gU16 index, gColor newColor) {
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8 #if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8
gdispImagePrivate_BMP *priv; gdispImagePrivate_BMP *priv;

View File

@ -106,7 +106,7 @@ typedef struct gdispImagePrivate_GIF {
* *
* Pre: Frame info has been read. * Pre: Frame info has been read.
*/ */
static gdispImageError startDecodeGif(gdispImage *img) { static gdispImageError startDecodeGif(gImage *img) {
gdispImagePrivate_GIF * priv; gdispImagePrivate_GIF * priv;
gifimgdecode * decode; gifimgdecode * decode;
gU16 cnt; gU16 cnt;
@ -170,7 +170,7 @@ baddatacleanup:
* *
* Pre: Frame info has been read. * Pre: Frame info has been read.
*/ */
static void stopDecodeGif(gdispImage *img) { static void stopDecodeGif(gImage *img) {
gdispImagePrivate_GIF * priv; gdispImagePrivate_GIF * priv;
priv = (gdispImagePrivate_GIF *)img->priv; priv = (gdispImagePrivate_GIF *)img->priv;
@ -201,7 +201,7 @@ static gU16 getPrefixGif(gifimgdecode *decode, gU16 code) {
* *
* Note: The resulting pixels are stored in decode->buf * Note: The resulting pixels are stored in decode->buf
*/ */
static gU16 getBytesGif(gdispImage *img) { static gU16 getBytesGif(gImage *img) {
gdispImagePrivate_GIF * priv; gdispImagePrivate_GIF * priv;
gifimgdecode * decode; gifimgdecode * decode;
gU16 cnt; gU16 cnt;
@ -334,7 +334,7 @@ static gU16 getBytesGif(gdispImage *img) {
* *
* Pre: The file position is at the start of the frame. * Pre: The file position is at the start of the frame.
*/ */
static gdispImageError initFrameGif(gdispImage *img) { static gdispImageError initFrameGif(gImage *img) {
gdispImagePrivate_GIF * priv; gdispImagePrivate_GIF * priv;
gifimgcache * cache; gifimgcache * cache;
gU8 blocktype; gU8 blocktype;
@ -493,7 +493,7 @@ static gdispImageError initFrameGif(gdispImage *img) {
} }
} }
void gdispImageClose_GIF(gdispImage *img) { void gdispImageClose_GIF(gImage *img) {
gdispImagePrivate_GIF * priv; gdispImagePrivate_GIF * priv;
gifimgcache * cache; gifimgcache * cache;
gifimgcache * ncache; gifimgcache * ncache;
@ -514,7 +514,7 @@ void gdispImageClose_GIF(gdispImage *img) {
} }
} }
gdispImageError gdispImageOpen_GIF(gdispImage *img) { gdispImageError gdispImageOpen_GIF(gImage *img) {
gdispImagePrivate_GIF *priv; gdispImagePrivate_GIF *priv;
gU8 hdr[6]; gU8 hdr[6];
gU16 aword; gU16 aword;
@ -595,7 +595,7 @@ gdispImageError gdispImageOpen_GIF(gdispImage *img) {
} }
} }
gdispImageError gdispImageCache_GIF(gdispImage *img) { gdispImageError gdispImageCache_GIF(gImage *img) {
gdispImagePrivate_GIF * priv; gdispImagePrivate_GIF * priv;
gifimgcache * cache; gifimgcache * cache;
gifimgdecode * decode; gifimgdecode * decode;
@ -766,7 +766,7 @@ baddatacleanup:
return GDISP_IMAGE_ERR_BADDATA; return GDISP_IMAGE_ERR_BADDATA;
} }
gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImageError gdispGImageDraw_GIF(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
gdispImagePrivate_GIF * priv; gdispImagePrivate_GIF * priv;
gifimgdecode * decode; gifimgdecode * decode;
gU8 * q = 0; gU8 * q = 0;
@ -1106,7 +1106,7 @@ baddatacleanup:
return GDISP_IMAGE_ERR_BADDATA; return GDISP_IMAGE_ERR_BADDATA;
} }
gDelay gdispImageNext_GIF(gdispImage *img) { gDelay gdispImageNext_GIF(gImage *img) {
gdispImagePrivate_GIF * priv; gdispImagePrivate_GIF * priv;
gDelay delay; gDelay delay;
gU8 blocksz; gU8 blocksz;

View File

@ -50,19 +50,19 @@ typedef struct JDEC {
gU8* mcubuf; /* Working buffer for the MCU */ gU8* mcubuf; /* Working buffer for the MCU */
void* pool; /* Pointer to available memory pool */ void* pool; /* Pointer to available memory pool */
unsigned sz_pool; /* Size of momory pool (bytes available) */ unsigned sz_pool; /* Size of momory pool (bytes available) */
gdispImage* img; /* Pointer to I/O device identifiler for the session */ gImage* img; /* Pointer to I/O device identifiler for the session */
} JDEC; } JDEC;
/* TJpgDec API functions */ /* TJpgDec API functions */
gdispImageError jd_prepare(JDEC*, void*, gdispImage*); gdispImageError jd_prepare(JDEC*, void*, gImage*);
gdispImageError jd_decomp(JDEC*, unsigned(*)(gdispImage*,void*,JRECT*), gU8); gdispImageError jd_decomp(JDEC*, unsigned(*)(gImage*,void*,JRECT*), gU8);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
typedef struct gdispImagePrivate_JPG { typedef struct gdispImagePrivate_JPG {
gPixel *frame0cache; gPixel *frame0cache;
} gdispImagePrivate_JPG; } gdispImagePrivate_JPG;
gdispImageError gdispImageOpen_JPG(gdispImage *img){ gdispImageError gdispImageOpen_JPG(gImage *img){
gdispImagePrivate_JPG *priv; gdispImagePrivate_JPG *priv;
gU8 hdr[4]; gU8 hdr[4];
unsigned len; unsigned len;
@ -119,7 +119,7 @@ gdispImageError gdispImageOpen_JPG(gdispImage *img){
} }
} }
void gdispImageClose_JPG(gdispImage *img){ void gdispImageClose_JPG(gImage *img){
gdispImagePrivate_JPG *priv = (gdispImagePrivate_JPG *)img->priv; gdispImagePrivate_JPG *priv = (gdispImagePrivate_JPG *)img->priv;
if(priv){ if(priv){
if (priv->frame0cache){ if (priv->frame0cache){
@ -129,7 +129,7 @@ void gdispImageClose_JPG(gdispImage *img){
} }
} }
static unsigned gdispImage_JPG_WriteToCache(gdispImage *img, void *bitmap, JRECT *rect) static unsigned gdispImage_JPG_WriteToCache(gImage *img, void *bitmap, JRECT *rect)
{ {
gdispImagePrivate_JPG *priv; gdispImagePrivate_JPG *priv;
gU8 *in; gU8 *in;
@ -147,7 +147,7 @@ static unsigned gdispImage_JPG_WriteToCache(gdispImage *img, void *bitmap, JRECT
return 1; return 1;
} }
gdispImageError gdispImageCache_JPG(gdispImage *img) { gdispImageError gdispImageCache_JPG(gImage *img) {
gdispImagePrivate_JPG *priv; gdispImagePrivate_JPG *priv;
JDEC *jd; JDEC *jd;
gdispImageError r; gdispImageError r;
@ -176,7 +176,7 @@ gdispImageError gdispImageCache_JPG(gdispImage *img) {
return r; return r;
} }
gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy){ gdispImageError gdispGImageDraw_JPG(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy){
gdispImagePrivate_JPG * priv; gdispImagePrivate_JPG * priv;
priv = (gdispImagePrivate_JPG *)img->priv; priv = (gdispImagePrivate_JPG *)img->priv;
@ -198,7 +198,7 @@ gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, gCoord x, gCoo
return GDISP_IMAGE_ERR_OK; return GDISP_IMAGE_ERR_OK;
} }
gDelay gdispImageNext_JPG(gdispImage *img) { gDelay gdispImageNext_JPG(gImage *img) {
(void) img; (void) img;
/* No more frames/pages */ /* No more frames/pages */
@ -766,7 +766,7 @@ gdispImageError mcu_load (
static static
gdispImageError mcu_output ( gdispImageError mcu_output (
JDEC* jd, /* Pointer to the decompressor object */ JDEC* jd, /* Pointer to the decompressor object */
unsigned (*outfunc)(gdispImage*, void*, JRECT*), /* RGB output function */ unsigned (*outfunc)(gImage*, void*, JRECT*), /* RGB output function */
unsigned x, /* MCU position in the image (left of the MCU) */ unsigned x, /* MCU position in the image (left of the MCU) */
unsigned y /* MCU position in the image (top of the MCU) */ unsigned y /* MCU position in the image (top of the MCU) */
) )
@ -963,7 +963,7 @@ gdispImageError restart (
gdispImageError jd_prepare ( gdispImageError jd_prepare (
JDEC* jd, /* Blank decompressor object */ JDEC* jd, /* Blank decompressor object */
void* pool, /* Working buffer for the decompression session */ void* pool, /* Working buffer for the decompression session */
gdispImage* img /* I/O device identifier for the session */ gImage* img /* I/O device identifier for the session */
) )
{ {
gU8 *seg, b; gU8 *seg, b;
@ -1124,7 +1124,7 @@ gdispImageError jd_prepare (
gdispImageError jd_decomp ( gdispImageError jd_decomp (
JDEC* jd, /* Initialized decompression object */ JDEC* jd, /* Initialized decompression object */
unsigned (*outfunc)(gdispImage*, void*, JRECT*), /* RGB output function */ unsigned (*outfunc)(gImage*, void*, JRECT*), /* RGB output function */
gU8 scale /* Output de-scaling factor (0 to 3) */ gU8 scale /* Output de-scaling factor (0 to 3) */
) )
{ {

View File

@ -23,15 +23,15 @@
/** /**
* Helper Routines Needed * Helper Routines Needed
*/ */
void *gdispImageAlloc(gdispImage *img, gMemSize sz); void *gdispImageAlloc(gImage *img, gMemSize sz);
void gdispImageFree(gdispImage *img, void *ptr, gMemSize sz); void gdispImageFree(gImage *img, void *ptr, gMemSize sz);
typedef struct gdispImagePrivate_NATIVE { typedef struct gdispImagePrivate_NATIVE {
gPixel *frame0cache; gPixel *frame0cache;
gPixel buf[BLIT_BUFFER_SIZE_NATIVE]; gPixel buf[BLIT_BUFFER_SIZE_NATIVE];
} gdispImagePrivate_NATIVE; } gdispImagePrivate_NATIVE;
void gdispImageClose_NATIVE(gdispImage *img) { void gdispImageClose_NATIVE(gImage *img) {
gdispImagePrivate_NATIVE * priv; gdispImagePrivate_NATIVE * priv;
priv = (gdispImagePrivate_NATIVE *)img->priv; priv = (gdispImagePrivate_NATIVE *)img->priv;
@ -43,7 +43,7 @@ void gdispImageClose_NATIVE(gdispImage *img) {
} }
} }
gdispImageError gdispImageOpen_NATIVE(gdispImage *img) { gdispImageError gdispImageOpen_NATIVE(gImage *img) {
gU8 hdr[HEADER_SIZE_NATIVE]; gU8 hdr[HEADER_SIZE_NATIVE];
/* Read the 8 byte header */ /* Read the 8 byte header */
@ -70,7 +70,7 @@ gdispImageError gdispImageOpen_NATIVE(gdispImage *img) {
return GDISP_IMAGE_ERR_OK; return GDISP_IMAGE_ERR_OK;
} }
gdispImageError gdispImageCache_NATIVE(gdispImage *img) { gdispImageError gdispImageCache_NATIVE(gImage *img) {
gMemSize len; gMemSize len;
gdispImagePrivate_NATIVE * priv; gdispImagePrivate_NATIVE * priv;
@ -93,7 +93,7 @@ gdispImageError gdispImageCache_NATIVE(gdispImage *img) {
return GDISP_IMAGE_ERR_OK; return GDISP_IMAGE_ERR_OK;
} }
gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
gCoord mx, mcx; gCoord mx, mcx;
gFileSize pos; gFileSize pos;
gMemSize len; gMemSize len;
@ -141,7 +141,7 @@ gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, g
return GDISP_IMAGE_ERR_OK; return GDISP_IMAGE_ERR_OK;
} }
gDelay gdispImageNext_NATIVE(gdispImage *img) { gDelay gdispImageNext_NATIVE(gImage *img) {
(void) img; (void) img;
/* No more frames/pages */ /* No more frames/pages */

View File

@ -111,7 +111,7 @@ typedef struct PNG_zinflate {
// Put all the decoding structures together. // Put all the decoding structures together.
// Note this is immediately followed by 2 scan lines of uncompressed image data for filtering (dynamic size). // Note this is immediately followed by 2 scan lines of uncompressed image data for filtering (dynamic size).
typedef struct PNG_decode { typedef struct PNG_decode {
gdispImage *img; gImage *img;
PNG_info *pinfo; PNG_info *pinfo;
PNG_input i; PNG_input i;
PNG_output o; PNG_output o;
@ -1127,7 +1127,7 @@ static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0
* Public PNG functions * Public PNG functions
*---------------------------------------------------------------*/ *---------------------------------------------------------------*/
void gdispImageClose_PNG(gdispImage *img) { void gdispImageClose_PNG(gImage *img) {
PNG_info *pinfo; PNG_info *pinfo;
pinfo = (PNG_info *)img->priv; pinfo = (PNG_info *)img->priv;
@ -1141,7 +1141,7 @@ void gdispImageClose_PNG(gdispImage *img) {
} }
} }
gdispImageError gdispImageOpen_PNG(gdispImage *img) { gdispImageError gdispImageOpen_PNG(gImage *img) {
PNG_info *pinfo; PNG_info *pinfo;
gU32 pos; gU32 pos;
gU32 len; gU32 len;
@ -1497,7 +1497,7 @@ exit_nonmem:
return GDISP_IMAGE_ERR_NOMEMORY; return GDISP_IMAGE_ERR_NOMEMORY;
} }
gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImageError gdispGImageDraw_PNG(GDisplay *g, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
PNG_info *pinfo; PNG_info *pinfo;
PNG_decode *d; PNG_decode *d;
@ -1546,7 +1546,7 @@ exit_baddata:
return GDISP_IMAGE_ERR_BADDATA; return GDISP_IMAGE_ERR_BADDATA;
} }
gdispImageError gdispImageCache_PNG(gdispImage *img) { gdispImageError gdispImageCache_PNG(gImage *img) {
PNG_info *pinfo; PNG_info *pinfo;
unsigned chunknext; unsigned chunknext;
unsigned chunklen; unsigned chunklen;
@ -1621,7 +1621,7 @@ baddata:
return GDISP_IMAGE_ERR_BADDATA; return GDISP_IMAGE_ERR_BADDATA;
} }
gDelay gdispImageNext_PNG(gdispImage *img) { gDelay gdispImageNext_PNG(gImage *img) {
(void) img; (void) img;
/* No more frames/pages */ /* No more frames/pages */

View File

@ -120,8 +120,8 @@
#endif #endif
void *gdispImageAlloc(gdispImage *img, gMemSize sz); void *gdispImageAlloc(gImage *img, gMemSize sz);
void gdispImageFree(gdispImage *img, void *ptr, gMemSize sz); void gdispImageFree(gImage *img, void *ptr, gMemSize sz);
#if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_UNKNOWN #if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_UNKNOWN
extern const gU8 gdispImageEndianArray[4]; extern const gU8 gdispImageEndianArray[4];

View File

@ -63,13 +63,13 @@ gPixel *gdispPixmapGetBits(GDisplay *g);
#if GDISP_NEED_PIXMAP_IMAGE || defined(__DOXYGEN__) #if GDISP_NEED_PIXMAP_IMAGE || defined(__DOXYGEN__)
/** /**
* @brief Get a pointer to a native format gdispImage. * @brief Get a pointer to a native format gImage.
* @return A pointer to a NATIVE format gdispImage in memory or NULL if this display is not a pixmap. * @return A pointer to a NATIVE format gImage in memory or NULL if this display is not a pixmap.
* @pre GDISP_NEED_PIXAMP_IMAGE must be GFXON in your gfxconf.h * @pre GDISP_NEED_PIXAMP_IMAGE must be GFXON in your gfxconf.h
* *
* @param[in] g The pixmap virtual display * @param[in] g The pixmap virtual display
* *
* @return The pointer to the native gdispImage * @return The pointer to the native gImage
* *
* @note The pointer returned can be passed to @p gdispImageOpenMemory() or to @p gfileOpenMemory(). * @note The pointer returned can be passed to @p gdispImageOpenMemory() or to @p gfileOpenMemory().
* @note If you are just wanting to copy to a real display it is more efficient to use @p gdispGetPixmapBits() and @p gdispGBlitArea(). * @note If you are just wanting to copy to a real display it is more efficient to use @p gdispGetPixmapBits() and @p gdispGBlitArea().

View File

@ -403,7 +403,7 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s
#endif #endif
#if GDISP_NEED_IMAGE #if GDISP_NEED_IMAGE
gdispImageError gwinDrawImage(GHandle gh, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImageError gwinDrawImage(GHandle gh, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
gdispImageError ret; gdispImageError ret;
if (!_gwinDrawStart(gh)) return GDISP_IMAGE_ERR_OK; if (!_gwinDrawStart(gh)) return GDISP_IMAGE_ERR_OK;

View File

@ -1056,7 +1056,7 @@ typedef enum { GWIN_NORMAL, GWIN_MAXIMIZE, GWIN_MINIMIZE } GWindowMinMax;
* *
* @api * @api
*/ */
gdispImageError gwinDrawImage(GHandle gh, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy); gdispImageError gwinDrawImage(GHandle gh, gImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
#endif #endif
/*------------------------------------------------- /*-------------------------------------------------

View File

@ -466,7 +466,7 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
sy = 0; sy = 0;
} }
gdispGImageDraw(gw->g.display, (gdispImage *)param, gw->g.x, gw->g.y, gw->g.width, gw->g.height, 0, sy); gdispGImageDraw(gw->g.display, (gImage *)param, gw->g.x, gw->g.y, gw->g.width, gw->g.height, 0, sy);
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, gJustifyCenter); gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, gJustifyCenter);
} }
#endif #endif

View File

@ -101,7 +101,7 @@ gBool gwinButtonIsPressed(GHandle gh);
* @note In your custom button drawing function you may optionally call these * @note In your custom button drawing function you may optionally call these
* standard functions and then draw your extra details on top. * standard functions and then draw your extra details on top.
* @note The standard functions below ignore the param parameter except for @p gwinButtonDraw_Image(). * @note The standard functions below ignore the param parameter except for @p gwinButtonDraw_Image().
* @note The image custom draw function @p gwinButtonDraw_Image() uses param to pass in the gdispImage pointer. * @note The image custom draw function @p gwinButtonDraw_Image() uses param to pass in the gImage pointer.
* @note These custom drawing routines don't have to worry about setting clipping as the framework * @note These custom drawing routines don't have to worry about setting clipping as the framework
* sets clipping to the object window prior to calling these routines. * sets clipping to the object window prior to calling these routines.
* *

View File

@ -168,7 +168,7 @@ void gwinContainerDraw_Std(GWidgetObject *gw, void *param) {
#if GDISP_NEED_IMAGE #if GDISP_NEED_IMAGE
void gwinContainerDraw_Image(GWidgetObject *gw, void *param) { void gwinContainerDraw_Image(GWidgetObject *gw, void *param) {
#define gi ((gdispImage *)param) #define gi ((gImage *)param)
gCoord x, y, iw, ih, mx, my; gCoord x, y, iw, ih, mx, my;
if (gw->g.vmt != (gwinVMT *)&containerVMT) if (gw->g.vmt != (gwinVMT *)&containerVMT)

View File

@ -294,7 +294,7 @@ void gwinFrameDraw_Std(GWidgetObject *gw, void *param) {
#if GDISP_NEED_IMAGE #if GDISP_NEED_IMAGE
void gwinFrameDraw_Image(GWidgetObject *gw, void *param) { void gwinFrameDraw_Image(GWidgetObject *gw, void *param) {
#define gi ((gdispImage *)param) #define gi ((gImage *)param)
gCoord x, y, iw, ih, mx, my; gCoord x, y, iw, ih, mx, my;
if (gw->g.vmt != (gwinVMT *)&frameVMT) if (gw->g.vmt != (gwinVMT *)&frameVMT)

View File

@ -106,7 +106,7 @@ void gwinFrameDraw_Std(GWidgetObject *gw, void *param);
* @param[in] gw The widget object (must be a frame object). * @param[in] gw The widget object (must be a frame object).
* @param[in] param A parameter passed in from the user. Ignored by this function. * @param[in] param A parameter passed in from the user. Ignored by this function.
* *
* @note The image custom draw function @p gwinFrameDraw_Image() uses param to pass in the gdispImage pointer. * @note The image custom draw function @p gwinFrameDraw_Image() uses param to pass in the gImage pointer.
* The image must be already opened before calling @p gwinSetCustomDraw(). * The image must be already opened before calling @p gwinSetCustomDraw().
* *
* @api * @api

View File

@ -34,7 +34,7 @@
// An image window // An image window
typedef struct GImageObject { typedef struct GImageObject {
GWindowObject g; GWindowObject g;
gdispImage image; // The image itself gImage image; // The image itself
#if GWIN_NEED_IMAGE_ANIMATION #if GWIN_NEED_IMAGE_ANIMATION
GTimer timer; // Timer used for animated images GTimer timer; // Timer used for animated images
#endif #endif

View File

@ -677,7 +677,7 @@ void gwinListViewItem(GHandle gh, int item) {
} }
#if GWIN_NEED_LIST_IMAGES #if GWIN_NEED_LIST_IMAGES
void gwinListItemSetImage(GHandle gh, int item, gdispImage *pimg) { void gwinListItemSetImage(GHandle gh, int item, gImage *pimg) {
const gfxQueueASyncItem * qi; const gfxQueueASyncItem * qi;
int i; int i;

View File

@ -100,7 +100,7 @@ typedef struct ListItem {
gU16 param; // A parameter the user can specify himself gU16 param; // A parameter the user can specify himself
const char* text; const char* text;
#if GWIN_NEED_LIST_IMAGES #if GWIN_NEED_LIST_IMAGES
gdispImage* pimg; gImage* pimg;
#endif #endif
} ListItem; } ListItem;
@ -361,7 +361,7 @@ void gwinListViewItem(GHandle gh, int item);
* for this list is to call gwinListDeleteAll(). * for this list is to call gwinListDeleteAll().
* *
*/ */
void gwinListItemSetImage(GHandle gh, int item, gdispImage *pimg); void gwinListItemSetImage(GHandle gh, int item, gImage *pimg);
#endif #endif
/** /**

View File

@ -263,7 +263,7 @@ void gwinProgressbarDraw_Std(GWidgetObject *gw, void *param) {
#if GDISP_NEED_IMAGE #if GDISP_NEED_IMAGE
void gwinProgressbarDraw_Image(GWidgetObject *gw, void *param) { void gwinProgressbarDraw_Image(GWidgetObject *gw, void *param) {
#define gsw ((GProgressbarObject *)gw) #define gsw ((GProgressbarObject *)gw)
#define gi ((gdispImage *)param) #define gi ((gImage *)param)
const GColorSet * pcol; const GColorSet * pcol;
gCoord z, v; gCoord z, v;

View File

@ -389,7 +389,7 @@ void gwinSliderDraw_Std(GWidgetObject *gw, void *param) {
#if GDISP_NEED_IMAGE #if GDISP_NEED_IMAGE
void gwinSliderDraw_Image(GWidgetObject *gw, void *param) { void gwinSliderDraw_Image(GWidgetObject *gw, void *param) {
#define gsw ((GSliderObject *)gw) #define gsw ((GSliderObject *)gw)
#define gi ((gdispImage *)param) #define gi ((gImage *)param)
const GColorSet * pcol; const GColorSet * pcol;
gCoord z, v; gCoord z, v;

View File

@ -532,7 +532,7 @@ void gwinTabsetDraw_Std(GWidgetObject *gw, void *param) {
#if GDISP_NEED_IMAGE #if GDISP_NEED_IMAGE
void gwinTabsetDraw_Image(GWidgetObject *gw, void *param) { void gwinTabsetDraw_Image(GWidgetObject *gw, void *param) {
#define gi ((gdispImage *)param) #define gi ((gImage *)param)
gCoord x, y, iw, ih, mx, my; gCoord x, y, iw, ih, mx, my;
if (gw->g.vmt != (gwinVMT *)&tabsetVMT) if (gw->g.vmt != (gwinVMT *)&tabsetVMT)