Packed 12bit Raw image file load to display to Nokia LCD. Add function "blit12" to Nokia LCD for native 12bit color buffer.

Dependencies:   mbed

Revision:
2:7cf441bf092d
Parent:
1:ea521c134e8a
Child:
3:8739f7e5148a
--- a/main.cpp	Thu Feb 10 07:30:11 2011 +0000
+++ b/main.cpp	Thu Feb 10 13:44:58 2011 +0000
@@ -13,6 +13,21 @@
     lcd.background(0x000000);
     lcd.cls();
     FILE *fp = NULL;
+#if 1
+    fp = fopen("/sd/128x128.r12", "r");
+    if (fp != NULL) {
+        printf("Start!\r\n");
+        unsigned char bufLine[64 * 3];
+        for (int y = 0; y < 128; y++) {
+            fread(bufLine, sizeof(unsigned char), (64 * 3), fp);
+            lcd.blit12(0, y, 128, 1, bufLine);
+        }
+        fclose(fp);
+        printf("Finish!\r\n");
+    } else {
+        printf("Can't open file.\r\n");
+    }
+#else
     fp = fopen("/sd/128x128.raw", "r");
     if (fp != NULL) {
         printf("Start!\r\n");
@@ -39,4 +54,5 @@
     } else {
         printf("Can't open file.\r\n");
     }
+#endif
 }