Bitmap  0.2
 All Data Structures Files Functions Variables Groups
bitmap.h
Go to the documentation of this file.
1 
7 
8 #ifndef _BITMAP_H_
9 #define _BITMAP_H_
10 
11 
17 
19 #define DISPLAY_BMP24
20 #define LOADBMP_TO16BITS
22 #define LOADBMP_TO8BITS
24 
26 
27 
31 
33 #define ERR_NOERROR -1
34 #define ERR_FILE 0
36 #define ERR_MB 1
38 #define ERR_NO24BIT 2
40 #define ERR_MALLOC 3
42 
44 
45 # define BF_MB 0x4D42
46 
50 
55 
56 void LoadBmp24_to16bits(char *bmp_filename, BITMAP* bmpPicture);
62 
63 void LoadBmp24_to8bits(char *bmp_filename, BITMAP* bmpPicture);
69 
70 
71 int Display_Bmp24(int x, int y,char *bmp_filename);
78 
79 void Delete_BITMAP(BITMAP* bmp);
83 
85 
86 
90 
93 typedef struct
94 {
95  unsigned short type;
96  unsigned int size_o;
97  unsigned short reserved1;
98  unsigned short reserved2;
99  unsigned int offBits;
101 
102 
105 typedef struct
106 {
107  unsigned int biSize;
108  unsigned short biPlanes;
109  unsigned short biBitCount;
110  unsigned int biCompression;
111  unsigned int biSizeImage;
112  int biXPelsPerMeter;
113  int biYPelsPerMeter;
114  unsigned int biClrUsed;
115  unsigned int biClrImportant;
117 
120 typedef struct
121 {
122  BITMAPFILEHEADER bmFileHeader;
123  BITMAPINFOHEADER bmiHeader; /* Image header */
124  int width;
125  int height;
126  unsigned short* sprite16Bit;
127  unsigned char* sprite8Bit;
128  unsigned short sprite8Bit_palette[256];
130  int error8bit;
132 } BITMAP;
133 
135 
136 #endif
137 
Contient tous les informations d'une image bmp.
Definition: bitmap.h:120
void Delete_BITMAP(BITMAP *bmp)
Supprime l'image, très important car la variable BITMAP contient des éléments alloués dynamiquements...
void LoadBmp24_to8bits(char *bmp_filename, BITMAP *bmpPicture)
Permet de convertir une image 24bits en un sprite 8bits.
int Display_Bmp24(int x, int y, char *bmp_filename)
Permet d'afficher l'image bmp_filename au coordonnée (x,y), aucun sprite ne sera créer, donc cette méthode est plus économique au niveau de la mémoire.
BITMAP Init_BITMAP()
Permet d'initialiser une variable de type BITMAP.
int error16bit
Definition: bitmap.h:129
unsigned short type
Definition: bitmap.h:95
int height
Definition: bitmap.h:125
int width
Definition: bitmap.h:124
unsigned short biBitCount
Definition: bitmap.h:109
int error8bit
Definition: bitmap.h:130
void LoadBmp24_to16bits(char *bmp_filename, BITMAP *bmpPicture)
Permet de convertir une image 24-bits en un sprite 16-bits.
l'entête du fichier bmp
Definition: bitmap.h:93
l'entête de l'image bmp
Definition: bitmap.h:105
unsigned int size_o
Definition: bitmap.h:96
unsigned short * sprite16Bit
Definition: bitmap.h:126
unsigned char * sprite8Bit
Definition: bitmap.h:127