Niotso  git revision 558726a9f13d7c3423a683dd2f4323589b66c310
The New Implementation of The Sims Online
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
read_bmp.h
Go to the documentation of this file.
1 /*
2  FileHandler - General-purpose file handling library for Niotso
3  read_bmp.h - Copyright (c) 2011-2012 Niotso Project <http://niotso.org/>
4  Author(s): Fatbag <X-Fi6@phppoll.org>
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 
19 typedef struct
20 {
21  /* BITMAPFILEHEADER */
22  uint16_t bfType;
23  uint32_t bfSize;
24  uint16_t bfReserved1;
25  uint16_t bfReserved2;
26  uint32_t bfOffBits;
27  /* BITMAPINFOHEADER */
28  uint32_t biSize;
29  uint32_t biWidth;
30  uint32_t biHeight;
31  uint16_t biPlanes;
32  uint16_t biBitCount;
33  uint32_t biCompression;
34  uint32_t biSizeImage;
35  uint32_t biXPelsPerMeter;
36  uint32_t biYPelsPerMeter;
37  uint32_t biClrUsed;
38  uint32_t biClrImportant;
39 
42 } bmpheader_t;
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 int bmp_read_header(bmpheader_t * BMPHeader, const uint8_t * Buffer, size_t FileSize);
49 int bmp_read_data(bmpheader_t * BMPHeader, const uint8_t * InData, uint8_t * OutData);
50 
51 #ifdef __cplusplus
52 }
53 #endif