• Main Page
  • Classes
  • Files
  • File List

Common/BMPFile.h

00001 /*
00002  * BMPFile.h
00003  *
00004  *  Created on: 02-12-2010
00005  *      Author: marcin
00006  */
00007 
00008 #ifndef BMPFILE_H_
00009 #define BMPFILE_H_
00010 
00011 #include <iostream>
00012 #include <fstream>
00013 #include <string>
00014 #include <cstdio>
00015 
00016 using namespace std;
00017 
00018 typedef unsigned int uint;
00019 typedef unsigned short ushort;
00020 typedef unsigned char uchar;
00021 
00022 struct BMPHeader
00023 {
00024   uchar magic[2]; //should always be BM
00025   uint fileSize;        // file size in bits
00026   uint reserved;
00027   uint   pixMapOffset; //where pixel starts
00028 };
00029 
00030 struct BMPInfo {
00031   uint headerSize;
00032   int width;
00033   int height;
00034   ushort nPlanes;
00035   ushort bitCount;
00036   uint compression;
00037   uint pixMapSize;
00038   int hRes;
00039   int vRes;
00040   uint nColors;
00041   uint nImpColors;
00042 };
00043 /*
00044 struct BMPFile {
00045     unsigned long sizeX;
00046     unsigned long sizeY;
00047     char *data;
00048 };
00049 */
00050 
00051 class BMPFile
00052 {
00053 public:
00054         BMPHeader header;
00055         BMPInfo info;
00056         char *data;
00057 
00058         BMPFile(){ data=NULL;
00059                            };
00060         ~BMPFile(){ if (data!=NULL) delete(data); };
00061 };
00062 
00063 
00064 BMPFile* loadBMPFile(std::string fileName);
00065 #endif /* BMPFILE_H_ */

Generated on Sun Dec 5 2010 19:03:32 for Snook3d by  doxygen 1.7.2