Here’s a patch for SDL_Image improving support for ILBM files. I send a
previous version of this a couple months ago, but it seems it went
unnoticed… Time to try again!
The patch includes the following changes:
fixed reading of colorkeyed images (they were previously assumed to
have a stencil bitplane, but since the body didn’t have it, the decoding
fixed colormap for images with a stencil (mask) bitplane. Those images
can have say 7+1 bitplanes but only 128 colors defined. In that case,
the end of the SDL_Image colormap was uninitialized, resulting in
fixed colormap for EHB (“Extra Half Brite”) Amiga images (these have 6
bitplanes, but the colormap only contains 32 colors. The second half of
the colormap has to be a copy of the first one, with brightness divided
adds support for HAM (“Hold And Modify”) and HAM8 files. These special
formats were used frequently on Amiga machines. They have only 6 (or 8)
bitplanes, but really use 2^12 (or 2^24) colors. The patch convert
these images to 24bits surface.
for 24 bits (and HAM) images, create the surface in R,G,B byte order
whatever the machine endianness. Then the check for the host endianness
doesn’t have to be done for each pixel, which also speeds up decoding.
This patch cleanly apply to SDL_Image 1.2.3
Finally, I have a question: is it legal for a 8bits surface to have a
1-bit alpha channel? If it is, I could improve support for "stenciled"
images some more (the transparency information is currently lost).
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…