mirror of
https://github.com/jfdelnero/rf-tools.git
synced 2024-11-21 19:31:54 -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;
|
ysize=bitmap_info_header.biHeight;
|
||||||
bitperpixel=bitmap_info_header.biBitCount;
|
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
|
// read palette
|
||||||
switch(bitperpixel)
|
switch(bitperpixel)
|
||||||
@ -85,6 +86,7 @@ int bmp_load(char * file,bitmap_data * bdata)
|
|||||||
palettesize=0;
|
palettesize=0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
//printf("bmp_load : bitperpixel not supported : %d\n",bitperpixel);
|
||||||
palettesize=0;
|
palettesize=0;
|
||||||
//non supported
|
//non supported
|
||||||
break;
|
break;
|
||||||
@ -271,6 +273,7 @@ int bmp_load(char * file,bitmap_data * bdata)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// non supported
|
// non supported
|
||||||
|
//printf("bmp_load : Packed bmp not supported : %d\n",bitmap_info_header.biCompression);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
|
#ifndef BI_BITFIELDS
|
||||||
|
#define BI_BITFIELDS 3
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct bitmap_data_
|
typedef struct bitmap_data_
|
||||||
{
|
{
|
||||||
int16_t xsize;
|
int16_t xsize;
|
||||||
|
Loading…
Reference in New Issue
Block a user