bmp-internal.h

Go to the documentation of this file.
00001 ///
00002 /// \file       bmp-internal.h
00003 ///             BMP structures
00004 ///
00005 
00006 /*
00007     Copyright (C) 2008-2009, Nicolas VIVIEN
00008     See also:
00009                 http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html
00010 
00011     This program is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     This program is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00019 
00020     See the GNU General Public License in the COPYING file at the
00021     root directory of this project for more details.
00022 */
00023 
00024 
00025 #ifndef __BARRY_BMP_INTERNAL_H__
00026 #define __BARRY_BMP_INTERNAL_H__
00027 
00028 #include "dll.h"
00029 #include <stdint.h>
00030 #include <sys/types.h>
00031 #include "platform.h"           // safe to include platform.h here, since
00032                                 // bmp-internal.h is not installed either
00033 
00034 #if USE_PACK_PRAGMA
00035 #pragma pack(push, 1)
00036 #endif
00037 
00038 typedef struct BXLOCAL {
00039         char bfType[2];                         // Contains always 'BM'
00040         uint32_t bfSize;                        // Size of file
00041         uint16_t bfReserved1;                   // 0x00
00042         uint16_t bfReserved2;                   // 0x00
00043         uint32_t bfOffBits;                     // Offset to find the raw data
00044 } ATTRIBUTE_PACKED bmp_file_header_t;
00045 
00046 typedef struct BXLOCAL {
00047         uint32_t biSize;                        // Size of struct itself
00048         uint32_t biWidth;                       // Width of image
00049         uint32_t biHeight;                      // Height of image
00050         uint16_t biPlanes;                      //
00051         uint16_t biBitCount;                    //
00052         uint32_t biCompression;                 //
00053         uint32_t biSizeImage;                   // Size of raw data
00054         uint32_t biXPelsPerMeter;               //
00055         uint32_t biYPelsPerMeter;               //
00056         uint32_t biClrUsed;                     //
00057         uint32_t biClrImportant;                //
00058 } ATTRIBUTE_PACKED bmp_info_header_t;
00059 
00060 #if USE_PACK_PRAGMA
00061 #pragma pack(pop)
00062 #endif
00063 
00064 #endif
00065