summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/ppm/ppm_decoder.h
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2011-01-09 13:22:54 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2011-01-09 13:22:54 +0000
commit6e3da841be4f0c7eda5d0daec19fc4919bd56d9f (patch)
tree05c2b3628720bcf2fd6f181b25771a874628cb38 /apps/plugins/imageviewer/ppm/ppm_decoder.h
parent6d05e27d68ff6a65580e771bccb20e6139ef5d68 (diff)
downloadrockbox-6e3da841be4f0c7eda5d0daec19fc4919bd56d9f.zip
rockbox-6e3da841be4f0c7eda5d0daec19fc4919bd56d9f.tar.gz
rockbox-6e3da841be4f0c7eda5d0daec19fc4919bd56d9f.tar.bz2
rockbox-6e3da841be4f0c7eda5d0daec19fc4919bd56d9f.tar.xz
Rework ppmviewer to fit our shiny new imageviewer framework. FS#11818 by me.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29012 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/imageviewer/ppm/ppm_decoder.h')
-rw-r--r--apps/plugins/imageviewer/ppm/ppm_decoder.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/plugins/imageviewer/ppm/ppm_decoder.h b/apps/plugins/imageviewer/ppm/ppm_decoder.h
new file mode 100644
index 0000000..edd1bcb
--- /dev/null
+++ b/apps/plugins/imageviewer/ppm/ppm_decoder.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2010 Marcin Bukat
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+/* Magic constants. */
+#define PPM_MAGIC1 'P'
+#define PPM_MAGIC2 '3'
+#define RPPM_MAGIC2 '6'
+#define PPM_FORMAT (PPM_MAGIC1 * 256 + PPM_MAGIC2)
+#define RPPM_FORMAT (PPM_MAGIC1 * 256 + RPPM_MAGIC2)
+
+#define PPM_OVERALLMAXVAL 65535
+
+#define ppm_error(...) rb->splashf(HZ*2, __VA_ARGS__ )
+
+struct ppm_info {
+ int x;
+ int y;
+ int maxval;
+ int format;
+ unsigned char *buf;
+ size_t buf_size;
+ unsigned int native_img_size;
+};
+
+/* public prototype */
+int read_ppm(int fd, struct ppm_info *ppm);