When decompressing to a 4-byte RGB buffer, set the unused byte to 0xFF so it can be interpreted as an opaque alpha channel.

This commit is contained in:
DRC
2011-09-08 23:54:40 +00:00
parent edf4d637e1
commit d345306ecc
7 changed files with 136 additions and 20 deletions

View File

@@ -387,6 +387,9 @@ public class TJDecompressor {
switch(dstImage.getType()) {
case BufferedImage.TYPE_3BYTE_BGR:
pixelFormat = TJ.PF_BGR; break;
case BufferedImage.TYPE_4BYTE_ABGR:
case BufferedImage.TYPE_4BYTE_ABGR_PRE:
pixelFormat = TJ.PF_XBGR; break;
case BufferedImage.TYPE_BYTE_GRAY:
pixelFormat = TJ.PF_GRAY; break;
case BufferedImage.TYPE_INT_BGR:
@@ -396,6 +399,8 @@ public class TJDecompressor {
pixelFormat = TJ.PF_RGBX;
intPixels = true; break;
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if(byteOrder == ByteOrder.BIG_ENDIAN)
pixelFormat = TJ.PF_XRGB;
else