src/bmp.h
changeset 5726 8f399788f6c9
parent 4300 687a17c9c557
child 6268 4b5241e5dd10
equal deleted inserted replaced
5725:8ad0e96437e0 5726:8f399788f6c9
       
     1 /* $Id$ */
       
     2 
       
     3 #ifndef BMP_H
       
     4 #define BMP_H
       
     5 
       
     6 typedef struct {
       
     7 	uint32 offset;       ///< offset of bitmap data from .bmp file begining
       
     8 	uint32 width;        ///< bitmap width
       
     9 	uint32 height;       ///< bitmap height
       
    10 	bool os2_bmp;        ///< true if OS/2 1.x or windows 2.x bitmap
       
    11 	uint16 bpp;          ///< bits per pixel
       
    12 	uint32 compression;  ///< compression method (0 = none, 1 = 8-bit RLE, 2 = 4-bit RLE)
       
    13 	uint32 palette_size; ///< number of colors in palette
       
    14 } BmpInfo;
       
    15 
       
    16 typedef struct {
       
    17 	Colour *palette;
       
    18 	byte   *bitmap;
       
    19 } BmpData;
       
    20 
       
    21 #define BMP_BUFFER_SIZE 1024
       
    22 
       
    23 typedef struct {
       
    24 	byte data[BMP_BUFFER_SIZE];
       
    25 	int pos;
       
    26 	int read;
       
    27 	FILE *file;
       
    28 	uint real_pos;
       
    29 } BmpBuffer;
       
    30 
       
    31 void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file);
       
    32 bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data);
       
    33 bool BmpReadBitmap(BmpBuffer *buffer, BmpInfo *info, BmpData *data);
       
    34 void BmpDestroyData(BmpData *data);
       
    35 
       
    36 #endif /* BMP_H */