mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 03:15:21 +08:00
Added support for 32bit per pixel subformat, uncompressed, in BMP. Last 8 bit are used as Alpha channel.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4427 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -2,6 +2,7 @@ CHANGES IN FLTK 1.1.7
|
|||||||
|
|
||||||
- Documentation fixes (STR #648, STR #692, STR #730, STR
|
- Documentation fixes (STR #648, STR #692, STR #730, STR
|
||||||
#744, STR #745)
|
#744, STR #745)
|
||||||
|
- Added 32bit BMP Image file format support (STR #918)
|
||||||
- Value Sliders would not receive focus when clicked on (STR #911)
|
- Value Sliders would not receive focus when clicked on (STR #911)
|
||||||
- Added redraw of some widgets to show focus change (STR #910)
|
- Added redraw of some widgets to show focus change (STR #910)
|
||||||
- Fl::set_font would not clear 'pretty' name (STR #902)
|
- Fl::set_font would not clear 'pretty' name (STR #902)
|
||||||
|
|||||||
@@ -186,6 +186,10 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
|
|||||||
if (depth == 16)
|
if (depth == 16)
|
||||||
use_5_6_5 = (read_dword(fp) == 0xf800);
|
use_5_6_5 = (read_dword(fp) == 0xf800);
|
||||||
|
|
||||||
|
// Set byte depth for RGBA images
|
||||||
|
if (depth == 32)
|
||||||
|
bDepth=4;
|
||||||
|
|
||||||
// Setup image and buffers...
|
// Setup image and buffers...
|
||||||
d(bDepth);
|
d(bDepth);
|
||||||
if (offbits) fseek(fp, offbits, SEEK_SET);
|
if (offbits) fseek(fp, offbits, SEEK_SET);
|
||||||
@@ -398,6 +402,15 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
|
|||||||
getc(fp);
|
getc(fp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 32 : // 32-bit RGBA
|
||||||
|
for (x = w(); x > 0; x --, ptr += bDepth) {
|
||||||
|
ptr[2] = (uchar)getc(fp);
|
||||||
|
ptr[1] = (uchar)getc(fp);
|
||||||
|
ptr[0] = (uchar)getc(fp);
|
||||||
|
ptr[3] = (uchar)getc(fp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user