Very simple library for controlling small graphic LCDs

Dependents:   LCD

Files at this revision

API Documentation at this revision

Comitter:
HBP
Date:
Thu Mar 03 00:48:53 2011 +0000
Parent:
1:9ae4e5352e19
Commit message:
Unused color depth detection removed. (it didn\t even work correctly)

Changed in this revision

bitmap.cpp Show annotated file Show diff for this revision Revisions of this file
bitmap.h Show annotated file Show diff for this revision Revisions of this file
--- a/bitmap.cpp	Thu Mar 03 00:35:24 2011 +0000
+++ b/bitmap.cpp	Thu Mar 03 00:48:53 2011 +0000
@@ -19,11 +19,11 @@
     }
     
     // check to see if it is a valid bitmap file
-	if(fgetc(fp)!='B' || fgetc(fp)!='M')
-	{
+    if(fgetc(fp)!='B' || fgetc(fp)!='M')
+    {
         fclose(fp);
         error("");
-	}
+    }
     
     //fseek(fp, 0L, SEEK_END);
 
@@ -31,9 +31,6 @@
     fileInfo.cols = readImageInfo(0x12, 4);
     fileInfo.rows = readImageInfo(0x16, 4);
     fileSize = readImageInfo(2, 4);
-    fileInfo.nColors = readImageInfo(0x2E, 4);
-    // Assume we are working with a 8-bit file
-    if (fileInfo.nColors == 0) fileInfo.nColors = 256;
     fileInfo.offset = readImageInfo(0x0A, 4);
     fileInfo.bitsPP = (uint16_t)readImageInfo(0x1C, 2);
 
@@ -42,7 +39,6 @@
     pc.printf("Width: %d\n\r", fileInfo.cols);
     pc.printf("Height: %d\n\r", fileInfo.rows);
     pc.printf("File size: %ld\n\r", fileSize);
-    pc.printf("# Colors: %d\n\r", fileInfo.nColors);
     pc.printf("Offset: %d\n\r", fileInfo.offset);
     pc.printf("Bits per pixel: %d\n\r", fileInfo.bitsPP);
     //pc.printf("Vector size: %d\n\r", vectorSize);
--- a/bitmap.h	Thu Mar 03 00:35:24 2011 +0000
+++ b/bitmap.h	Thu Mar 03 00:48:53 2011 +0000
@@ -10,7 +10,6 @@
 struct sBitmapInfo {
     uint32_t rows;    /**< Number if rows in bitmap. */
     uint32_t cols;    /**< Number of colums in bitmap. */
-    uint32_t nColors; /**< BMP number of colors. */
     uint32_t offset;
     uint16_t bitsPP;
 };