aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gdisp/images
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-02-07 18:44:32 +1000
committerinmarket <andrewh@inmarket.com.au>2014-02-07 18:44:32 +1000
commit4d3a08f5cfd244f82d1283cab702450e1dad14cd (patch)
tree817f58f61455ef4d0c296a7a44f4b56d0999b29e /demos/modules/gdisp/images
parentf7d6b9b58e4e8d979004026b41c1bfd275218fb9 (diff)
downloaduGFX-4d3a08f5cfd244f82d1283cab702450e1dad14cd.tar.gz
uGFX-4d3a08f5cfd244f82d1283cab702450e1dad14cd.tar.bz2
uGFX-4d3a08f5cfd244f82d1283cab702450e1dad14cd.zip
Update image demo's to use GFILE ROMFS.
Diffstat (limited to 'demos/modules/gdisp/images')
-rw-r--r--demos/modules/gdisp/images/gfxconf.h3
-rw-r--r--demos/modules/gdisp/images/main.c20
-rw-r--r--demos/modules/gdisp/images/romfs_files.h7
-rw-r--r--demos/modules/gdisp/images/romfs_testpal8.h (renamed from demos/modules/gdisp/images/test-pal8.h)28
4 files changed, 41 insertions, 17 deletions
diff --git a/demos/modules/gdisp/images/gfxconf.h b/demos/modules/gdisp/images/gfxconf.h
index 09dbe30c..4ef9ab9e 100644
--- a/demos/modules/gdisp/images/gfxconf.h
+++ b/demos/modules/gdisp/images/gfxconf.h
@@ -52,7 +52,8 @@
#define GDISP_NEED_IMAGE_PNG FALSE
#define GFX_USE_GFILE TRUE
-#define GFILE_NEED_MEMFS TRUE
+#define GFILE_NEED_ROMFS TRUE
+//#define GFILE_NEED_NATIVEFS TRUE
#endif /* _GFXCONF_H */
diff --git a/demos/modules/gdisp/images/main.c b/demos/modules/gdisp/images/main.c
index 021bf9f5..6a2e4418 100644
--- a/demos/modules/gdisp/images/main.c
+++ b/demos/modules/gdisp/images/main.c
@@ -29,15 +29,12 @@
#include "gfx.h"
-#ifdef WIN32
- #define USE_MEMORY_FILE TRUE // Can be true or false for Win32
-#else
- #define USE_MEMORY_FILE TRUE // Non-Win32 - use the compiled in image
-#endif
-
-#if USE_MEMORY_FILE
- #include "test-pal8.h"
-#endif
+/**
+ * The image file must be stored on a GFILE file-system.
+ * Use either GFILE_NEED_NATIVEFS or GFILE_NEED_ROMFS (or both).
+ *
+ * The ROMFS uses the file "romfs_files.h" to describe the set of files in the ROMFS.
+ */
static gdispImage myImage;
@@ -52,12 +49,7 @@ int main(void) {
sheight = gdispGetHeight();
// Set up IO for our image
-#if USE_MEMORY_FILE
- gdispImageOpenMemory(&myImage, test_pal8);
-#else
gdispImageOpenFile(&myImage, "test-pal8.bmp");
-#endif
-
gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0);
gdispImageClose(&myImage);
diff --git a/demos/modules/gdisp/images/romfs_files.h b/demos/modules/gdisp/images/romfs_files.h
new file mode 100644
index 00000000..a31dc7bf
--- /dev/null
+++ b/demos/modules/gdisp/images/romfs_files.h
@@ -0,0 +1,7 @@
+/**
+ * This file contains the list of files for the ROMFS.
+ *
+ * The files have been converted using...
+ * file2c -dbcs infile outfile
+ */
+#include "romfs_testpal8.h"
diff --git a/demos/modules/gdisp/images/test-pal8.h b/demos/modules/gdisp/images/romfs_testpal8.h
index 9d1d7e0f..a7844b0d 100644
--- a/demos/modules/gdisp/images/test-pal8.h
+++ b/demos/modules/gdisp/images/romfs_testpal8.h
@@ -1,10 +1,10 @@
/**
* This file was generated from "test-pal8.bmp" using...
*
- * file2c -cs test-pal8.bmp test-pal8.h
+ * file2c -bbcs test-pal8.bmp romfs_testpal8.h
*
*/
-static const unsigned char test_pal8[] = {
+static const char test_pal8[] = {
0x42, 0x4D, 0x26, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x04, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x13, 0x0B, 0x00, 0x00, 0x13, 0x0B, 0x00, 0x00, 0xFC, 0x00,
@@ -69,6 +69,8 @@ static const unsigned char test_pal8[] = {
0x66, 0x00, 0xFF, 0x80, 0x99, 0x00, 0xFF, 0x80, 0xCC, 0x00, 0xFF, 0x80, 0xFF, 0x00, 0xFF, 0xAA,
0x00, 0x00, 0xFF, 0xAA, 0x33, 0x00, 0xFF, 0xAA, 0x66, 0x00, 0xFF, 0xAA, 0x99, 0x00, 0xFF, 0xAA,
0xCC, 0x00, 0xFF, 0xAA, 0xFF, 0x00, 0xFF, 0xD5, 0x00, 0x00, 0xFF, 0xD5, 0x33, 0x00, 0xFF, 0xD5,
+};
+static const char test_pal8_p2[] = {
0x66, 0x00, 0xFF, 0xD5, 0x99, 0x00, 0xFF, 0xD5, 0xCC, 0x00, 0xFF, 0xD5, 0xFF, 0x00, 0xFF, 0xFF,
0x00, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x66, 0x00, 0xFF, 0xFF, 0x99, 0x00, 0xFF, 0xFF,
0xCC, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x30, 0x30, 0x30, 0x30, 0x36,
@@ -133,6 +135,8 @@ static const unsigned char test_pal8[] = {
0x5C, 0x2B, 0x5C, 0x56, 0x5C, 0x56, 0x87, 0x56, 0x87, 0x81, 0xB2, 0x81, 0xB2, 0x81, 0xB2, 0xAC,
0xB2, 0xAC, 0xDD, 0xAC, 0xDD, 0xD7, 0x2A, 0x00, 0x30, 0x00, 0x31, 0x06, 0x31, 0x07, 0x38, 0x07,
0x38, 0x0D, 0x3E, 0x0E, 0x3E, 0x0E, 0x45, 0x14, 0x45, 0x15, 0x46, 0x1B, 0x46, 0x1B, 0x4C, 0x22,
+};
+static const char test_pal8_p3[] = {
0x4C, 0x22, 0x53, 0x22, 0x53, 0x29, 0x93, 0x62, 0x68, 0x62, 0x92, 0x62, 0x68, 0x62, 0x93, 0x62,
0x68, 0x62, 0x92, 0x62, 0x92, 0x62, 0x93, 0x62, 0x92, 0x62, 0x92, 0x62, 0x92, 0x62, 0x93, 0x62,
0x92, 0x62, 0x92, 0x62, 0x92, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00, 0x31, 0x30, 0x31, 0x30, 0x37,
@@ -197,6 +201,8 @@ static const unsigned char test_pal8[] = {
0x62, 0x31, 0x62, 0x5C, 0x62, 0x5C, 0x8D, 0x5C, 0x8D, 0x87, 0xB8, 0x87, 0xB8, 0x87, 0xB8, 0xB2,
0xB8, 0xB2, 0xE3, 0xB2, 0xE3, 0xDD, 0x54, 0x2A, 0x30, 0x2A, 0x5B, 0x30, 0x31, 0x31, 0x62, 0x31,
0x38, 0x37, 0x68, 0x38, 0x3E, 0x38, 0x6F, 0x3E, 0x45, 0x3F, 0x70, 0x45, 0x46, 0x45, 0x76, 0x4C,
+};
+static const char test_pal8_p4[] = {
0x4C, 0x4C, 0x7D, 0x4C, 0x53, 0x53, 0x93, 0x62, 0x68, 0x62, 0x93, 0x62, 0x92, 0x62, 0x93, 0x62,
0x92, 0x62, 0x93, 0x62, 0x92, 0x62, 0x93, 0x62, 0x92, 0x62, 0x93, 0x62, 0x92, 0x62, 0x93, 0x62,
0x92, 0x62, 0x93, 0x62, 0x92, 0x00, 0x01, 0x01, 0x01, 0x07, 0x01, 0x31, 0x31, 0x31, 0x31, 0x37,
@@ -261,6 +267,8 @@ static const unsigned char test_pal8[] = {
0x00, 0x00, 0xFB, 0xFB, 0xFB, 0x00, 0x00, 0x62, 0x8D, 0x8D, 0x00, 0x00, 0xFB, 0xFB, 0x00, 0x00,
0xB8, 0xB8, 0xE9, 0xB8, 0xE3, 0xE3, 0x54, 0x54, 0x5A, 0x2A, 0x5B, 0x30, 0x00, 0x00, 0xFB, 0xFB,
0x00, 0x00, 0x68, 0x38, 0x68, 0x00, 0x00, 0xFB, 0xFB, 0x00, 0x00, 0x45, 0x70, 0x45, 0x76, 0x76,
+};
+static const char test_pal8_p5[] = {
0x76, 0x4C, 0x7D, 0x4C, 0x7D, 0x53, 0x93, 0x68, 0x93, 0x62, 0x93, 0x62, 0x93, 0x62, 0x93, 0x68,
0x93, 0x62, 0x93, 0x62, 0x93, 0x62, 0x93, 0x68, 0x93, 0x62, 0x93, 0x62, 0x93, 0x62, 0x93, 0x92,
0x93, 0x62, 0x93, 0x8C, 0x93, 0x00, 0x02, 0x02, 0x02, 0x08, 0x02, 0x32, 0x32, 0x32, 0x32, 0x38,
@@ -325,6 +333,8 @@ static const unsigned char test_pal8[] = {
0xFB, 0xFB, 0x00, 0x00, 0x68, 0x62, 0x93, 0x68, 0x93, 0x8D, 0x00, 0x00, 0xFB, 0xFB, 0x00, 0x00,
0xBE, 0xB8, 0xE9, 0x00, 0x00, 0xFB, 0xFB, 0x00, 0x00, 0x54, 0x85, 0x5A, 0x00, 0x00, 0xFB, 0xFB,
0x00, 0x00, 0x92, 0x62, 0x92, 0x00, 0x00, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB,
+};
+static const char test_pal8_p6[] = {
0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x00, 0x00, 0x00, 0x93, 0x62, 0x93, 0x68,
0x93, 0x68, 0x93, 0x68, 0x93, 0x62, 0x93, 0x92, 0x93, 0x68, 0x93, 0x92, 0x93, 0x62, 0x93, 0x92,
0x93, 0x92, 0x93, 0x92, 0x93, 0x00, 0x02, 0x03, 0x02, 0x09, 0x02, 0x33, 0x32, 0x33, 0x32, 0x39,
@@ -389,6 +399,8 @@ static const unsigned char test_pal8[] = {
0x00, 0x00, 0x00, 0xFB, 0xFB, 0x00, 0x00, 0x68, 0x99, 0x93, 0x00, 0x00, 0xFB, 0xFB, 0xFB, 0x00,
0x00, 0xBE, 0xEF, 0xBE, 0xEF, 0xE9, 0xA8, 0x7E, 0x84, 0x7E, 0xAF, 0x00, 0x00, 0xFB, 0xFB, 0xFB,
0x00, 0x00, 0xBC, 0x8C, 0x92, 0x00, 0x00, 0xFB, 0xFB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+static const char test_pal8_p7[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xFB, 0x00, 0x00, 0x68, 0x99, 0x92,
0x93, 0x68, 0x99, 0x92, 0x93, 0x68, 0x99, 0x92, 0x93, 0x92, 0x99, 0x92, 0x93, 0x92, 0xC3, 0x92,
0x93, 0x92, 0xC3, 0x92, 0x93, 0x00, 0x03, 0x03, 0x03, 0x09, 0x03, 0x33, 0x33, 0x33, 0x33, 0x39,
@@ -453,6 +465,8 @@ static const unsigned char test_pal8[] = {
0x74, 0x43, 0x74, 0x6E, 0x74, 0x6E, 0x9F, 0x6E, 0x9F, 0x99, 0xCA, 0x99, 0xCA, 0x99, 0xCA, 0xC4,
0xCA, 0xC4, 0xF5, 0xC4, 0xF5, 0xEF, 0xA8, 0x7E, 0xAE, 0x7E, 0xAF, 0x84, 0xAF, 0x85, 0xB6, 0x85,
0xB6, 0x8B, 0xBC, 0x8C, 0xBC, 0x8C, 0xC3, 0x92, 0xC3, 0x93, 0xC4, 0x99, 0xC4, 0x99, 0xCA, 0xA0,
+};
+static const char test_pal8_p8[] = {
0xCA, 0xA0, 0xD1, 0xA0, 0xD1, 0xA7, 0x99, 0x93, 0x99, 0x68, 0x99, 0x92, 0x99, 0x68, 0x99, 0x93,
0x99, 0x92, 0x99, 0x92, 0x99, 0x92, 0xC3, 0x93, 0x99, 0x92, 0xC3, 0x92, 0x99, 0x92, 0xC3, 0x93,
0xC3, 0x92, 0xC3, 0x92, 0xC3, 0x00, 0x04, 0x04, 0x04, 0x0A, 0x04, 0x34, 0x34, 0x34, 0x34, 0x3A,
@@ -517,6 +531,8 @@ static const unsigned char test_pal8[] = {
0x7A, 0x49, 0x7A, 0x74, 0x74, 0x74, 0xA5, 0x74, 0xA5, 0x9F, 0xD0, 0x9F, 0xCA, 0x9F, 0xD0, 0xCA,
0xD0, 0xCA, 0xFB, 0xCA, 0xF5, 0xF5, 0xD2, 0xA8, 0xD8, 0xA8, 0xD9, 0xAE, 0xD9, 0xAF, 0xE0, 0xAF,
0xE0, 0xB5, 0xE6, 0xB6, 0xE6, 0xB6, 0xED, 0xBC, 0xED, 0xBD, 0xEE, 0xC3, 0xEE, 0xC3, 0xF4, 0xCA,
+};
+static const char test_pal8_p9[] = {
0xF4, 0xCA, 0xFB, 0xCA, 0xFB, 0xD1, 0x99, 0x93, 0x99, 0x93, 0x99, 0x93, 0x99, 0x92, 0xC3, 0x93,
0x99, 0x93, 0xC3, 0x93, 0x99, 0x92, 0xC3, 0x93, 0xC3, 0x93, 0xC3, 0x93, 0xC3, 0x92, 0xC3, 0x93,
0xC3, 0x93, 0xC3, 0x93, 0xC3, 0x00, 0x04, 0x04, 0x04, 0x0B, 0x04, 0x35, 0x34, 0x35, 0x34, 0x3A,
@@ -581,7 +597,15 @@ static const unsigned char test_pal8[] = {
0x7A, 0x4F, 0x7A, 0x7A, 0x7A, 0x7A, 0xA5, 0x7A, 0xA5, 0xA5, 0xD0, 0xA5, 0xD0, 0xA5, 0xD0, 0xD0,
0xD0, 0xD0, 0xFB, 0xD0, 0xFB, 0xFB, 0xD2, 0xD2, 0xD8, 0xD2, 0xD9, 0xD8, 0xD9, 0xD9, 0xE0, 0xD9,
0xE0, 0xDF, 0xE6, 0xE0, 0xE6, 0xE0, 0xED, 0xE6, 0xED, 0xE7, 0xEE, 0xED, 0xEE, 0xED, 0xF4, 0xF4,
+};
+static const char test_pal8_p10[] = {
0xF4, 0xF4, 0xFB, 0xF4, 0xFB, 0xFB, 0xC4, 0x93, 0x99, 0x93, 0xC4, 0x93, 0x99, 0x93, 0xC4, 0x93,
0xC3, 0x93, 0xC4, 0x93, 0xC3, 0x93, 0xC4, 0x93, 0xC3, 0x93, 0xC4, 0x93, 0xC3, 0x93, 0xC4, 0x93,
0xC3, 0x93, 0xC4, 0x93, 0xC3, 0x00,
};
+
+#ifdef ROMFS_DIRENTRY_HEAD
+ static const ROMFS_DIRENTRY test_pal8_dir = { 0, 0, ROMFS_DIRENTRY_HEAD, "test-pal8.bmp", 9254, test_pal8 };
+ #undef ROMFS_DIRENTRY_HEAD
+ #define ROMFS_DIRENTRY_HEAD &test_pal8_dir
+#endif