# bmp.h

Go to the documentation of this file.

    00001 /* $Id: bmp.h 15428 2009-02-09 02:57:15Z rubidium $ */
    00002
    00005 #ifndef BMP_H
    00006 #define BMP_H
    00007
    00008 #include "gfx_type.h"
    00009
    00010 struct BmpInfo {
    00011   uint32 offset;
    00012   uint32 width;
    00013   uint32 height;
    00014   bool os2_bmp;
    00015   uint16 bpp;
    00016   uint32 compression;
    00017   uint32 palette_size;
    00018 };
    00019
    00020 struct BmpData {
    00021   Colour *palette;
    00022   byte   *bitmap;
    00023 };
    00024
    00025 #define BMP_BUFFER_SIZE 1024
    00026
    00027 struct BmpBuffer {
    00028   byte data[BMP_BUFFER_SIZE];
    00029   int pos;
    00030   int read;
    00031   FILE *file;
    00032   uint real_pos;
    00033 };
    00034
    00035 void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file);
    00036 bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data);
    00037 bool BmpReadBitmap(BmpBuffer *buffer, BmpInfo *info, BmpData *data);
    00038 void BmpDestroyData(BmpData *data);
    00039
    00040 #endif /* BMP_H */