#ifndef READBMP_H
#define READBMP_H


/*
1	2	bfType	19778	must always be set to 'BM' to declare that this is a .bmp-file.	
3	4	bfSize	??	specifies the size of the file in bytes.	
7	2	bfReserved1	0	must always be set to zero.	
9	2	bfReserved2	0	must always be set to zero.	
11	4	bfOffBits	1078	specifies the offset from the beginning of the file to the bitmap data.
*/

struct bmps_s
{   
    char ID[2],dummy[4];
    long bmpsize,bfOffBits;
};

/*
15	4	biSize	40	specifies the size of the BITMAPINFOHEADER structure, in bytes.	
19	4	biWidth	100	specifies the width of the image, in pixels.	
23	4	biHeight	100	specifies the height of the image, in pixels.	
27	2	biPlanes	1	specifies the number of planes of the target device, must be set to zero.	
29	2	biBitCount	8	specifies the number of bits per pixel.	
31	4	biCompression	0	Specifies the type of compression, usually set to zero (no compression).	
35	4	biSizeImage	0	specifies the size of the image data, in bytes. If there is no compression, it is valid to set this member to zero.	
39	4	biXPelsPerMeter	0	specifies the the horizontal pixels per meter on the designated targer device, usually set to zero.	
43	4	biYPelsPerMeter	0	specifies the the vertical pixels per meter on the designated targer device, usually set to zero.	
47	4	biClrUsed	0	specifies the number of colors used in the bitmap, if set to zero the number of colors is calculated using the biBitCount member.	
51	4	biClrImportant*/

struct bmph_s
{
    long    biSize;
    long    biWidth;
    long    biHeight;
    short   biPlanes;
    short   biBitCount;
    long    biCompression;
    long    biSizeImage;
    long    biXPelsPerMeter;
    long    biYPelsPerMeter;
    long    biClrUsed;
    long    biClrImportant;
};

struct bmpdata_s
{
    unsigned short *data;
    unsigned long  *cmap;
    unsigned long  len;
    
    unsigned long width;
    unsigned long height;
    unsigned long depth;
};

#endif
