summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/gif/gif_decoder.h
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2012-11-02 13:03:58 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2012-11-13 18:13:10 +0100
commit0ceaff2b65c50b75ad8cc5b2d12e7b3f864092e5 (patch)
tree49d8d297cbba93902bc612a9aa4ded1b6e2d46e5 /apps/plugins/imageviewer/gif/gif_decoder.h
parentb35f82c91ff050b4405b19a3e56e9d031bf940e2 (diff)
downloadrockbox-0ceaff2b65c50b75ad8cc5b2d12e7b3f864092e5.tar.gz
rockbox-0ceaff2b65c50b75ad8cc5b2d12e7b3f864092e5.zip
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
Diffstat (limited to 'apps/plugins/imageviewer/gif/gif_decoder.h')
-rw-r--r--apps/plugins/imageviewer/gif/gif_decoder.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/apps/plugins/imageviewer/gif/gif_decoder.h b/apps/plugins/imageviewer/gif/gif_decoder.h
new file mode 100644
index 0000000000..444f54acf9
--- /dev/null
+++ b/apps/plugins/imageviewer/gif/gif_decoder.h
@@ -0,0 +1,37 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (c) 2012 Marcin Bukat
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20
21#define GIF_MAX_FRAMES 32
22
23struct gif_decoder {
24 unsigned char *mem;
25 size_t mem_size;
26 int width;
27 int height;
28 int frames_count;
29 int delay;
30 size_t native_img_size;
31 int error;
32};
33
34void gif_decoder_init(struct gif_decoder *decoder, void *mem, size_t size);
35void gif_open(char *filename, struct gif_decoder *d);
36void gif_decode(struct gif_decoder *d, void (*pf_progress)(int current, int total));
37