mirror of
https://github.com/jfdelnero/rf-tools.git
synced 2024-11-21 11:21:47 -05:00
WIP : BI_BITFIELDS support.
This commit is contained in:
parent
c4acbc9a86
commit
6cce053cc7
@ -63,8 +63,9 @@ int bmp_load(char * file,bitmap_data * bdata)
|
||||
ysize=bitmap_info_header.biHeight;
|
||||
bitperpixel=bitmap_info_header.biBitCount;
|
||||
|
||||
if(!bitmap_info_header.biCompression)
|
||||
if(!bitmap_info_header.biCompression || (bitmap_info_header.biCompression == BI_BITFIELDS) )
|
||||
{
|
||||
// TODO : Read and use the BI_BITFIELDS RGB masks.
|
||||
|
||||
// read palette
|
||||
switch(bitperpixel)
|
||||
@ -85,6 +86,7 @@ int bmp_load(char * file,bitmap_data * bdata)
|
||||
palettesize=0;
|
||||
break;
|
||||
default:
|
||||
//printf("bmp_load : bitperpixel not supported : %d\n",bitperpixel);
|
||||
palettesize=0;
|
||||
//non supported
|
||||
break;
|
||||
@ -271,6 +273,7 @@ int bmp_load(char * file,bitmap_data * bdata)
|
||||
else
|
||||
{
|
||||
// non supported
|
||||
//printf("bmp_load : Packed bmp not supported : %d\n",bitmap_info_header.biCompression);
|
||||
fclose(f);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
#pragma pack(1)
|
||||
|
||||
#ifndef BI_BITFIELDS
|
||||
#define BI_BITFIELDS 3
|
||||
#endif
|
||||
|
||||
typedef struct bitmap_data_
|
||||
{
|
||||
int16_t xsize;
|
||||
|
Loading…
Reference in New Issue
Block a user