diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2012-11-02 13:03:58 +0100 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2012-11-13 18:13:10 +0100 |
commit | 0ceaff2b65c50b75ad8cc5b2d12e7b3f864092e5 (patch) | |
tree | 49d8d297cbba93902bc612a9aa4ded1b6e2d46e5 /apps/plugins/imageviewer/gif/rb_glue.h | |
parent | b35f82c91ff050b4405b19a3e56e9d031bf940e2 (diff) | |
download | rockbox-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/rb_glue.h')
-rw-r--r-- | apps/plugins/imageviewer/gif/rb_glue.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/plugins/imageviewer/gif/rb_glue.h b/apps/plugins/imageviewer/gif/rb_glue.h new file mode 100644 index 0000000000..6cd46b0e56 --- /dev/null +++ b/apps/plugins/imageviewer/gif/rb_glue.h | |||
@@ -0,0 +1,44 @@ | |||
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 | #include "plugin.h" | ||
22 | #include <tlsf.h> | ||
23 | |||
24 | #undef memset | ||
25 | #define memset(a,b,c) rb->memset((a),(b),(c)) | ||
26 | #undef memmove | ||
27 | #define memmove(a,b,c) rb->memmove((a),(b),(c)) | ||
28 | #undef memcmp | ||
29 | #define memcmp(a,b,c) rb->memcmp((a),(b),(c)) | ||
30 | #undef strncmp | ||
31 | #define strncmp(a,b,c) rb->strncmp((a),(b),(c)) | ||
32 | |||
33 | #define fread(ptr, size, nmemb, stream) rb->read(stream, ptr, size*nmemb) | ||
34 | #define fclose(stream) rb->close(stream) | ||
35 | #define fdopen(a,b) ((a)) | ||
36 | |||
37 | #define malloc(a) tlsf_malloc((a)) | ||
38 | #define free(a) tlsf_free((a)) | ||
39 | #define realloc(a, b) tlsf_realloc((a),(b)) | ||
40 | #define calloc(a,b) tlsf_calloc((a),(b)) | ||
41 | |||
42 | #ifndef SIZE_MAX | ||
43 | #define SIZE_MAX INT_MAX | ||
44 | #endif | ||