From 0ceaff2b65c50b75ad8cc5b2d12e7b3f864092e5 Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Fri, 2 Nov 2012 13:03:58 +0100 Subject: imageviewer: gif viewer based on giflib-5.0.2 This adds ability to view gif images in rockbox. Works both on color and gray/monochrome targets (greylib). Aspect correction is supported as well. Limitations: - animated gifs are restricted to 32 frames - animated gifs loop always (loopcount is ignored) - plain text extension is not supported - animated gifs with interframe delay = 0 are treated as still images (web browsers usually treat delay 0 as 100ms to prevent exhaustive CPU load by such images) Change-Id: I61501f801ddcd403410e38d83e6bddc9883e7ede --- apps/plugins/imageviewer/imageviewer.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps/plugins/imageviewer/imageviewer.h') diff --git a/apps/plugins/imageviewer/imageviewer.h b/apps/plugins/imageviewer/imageviewer.h index 9cc1a91..19b5db1 100644 --- a/apps/plugins/imageviewer/imageviewer.h +++ b/apps/plugins/imageviewer/imageviewer.h @@ -58,6 +58,7 @@ enum { ZOOM_IN, ZOOM_OUT, + NEXT_FRAME, }; #if (CONFIG_PLATFORM & PLATFORM_NATIVE) && defined(HAVE_DISK_STORAGE) @@ -82,6 +83,8 @@ struct image_info { int x_size, y_size; /* set size of loaded image in load_image(). */ int width, height; /* set size of resized image in get_image(). */ int x, y; /* display position */ + int frames_count; /* number of subframes */ + int delay; /* delay expressed in ticks between frames */ void *data; /* use freely in decoder. not touched in ui. */ }; @@ -115,6 +118,7 @@ struct image_decoder { /* return needed size of buffer to store downscaled image by ds. * this is used to calculate min downscale. */ int (*img_mem)(int ds); + /* load image from filename. use the passed buffer to store loaded, decoded * or resized image later, so save it to local variables if needed. * set width and height of info properly. also, set buf_size to remaining @@ -125,7 +129,8 @@ struct image_decoder { /* downscale loaded image by ds. use the buffer passed to load_image to * reszie image and/or store resized image. * return PLUGIN_ERROR for error. ui will skip to next image. */ - int (*get_image)(struct image_info *info, int ds); + int (*get_image)(struct image_info *info, int frame, int ds); + /* draw part of image */ void (*draw_image_rect)(struct image_info *info, int x, int y, int width, int height); -- cgit v1.1