windowscodecs: Add support for 96bppRGBFloat and 128bppPRGBAFloat formats to TIFF decoder.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-04-22 17:40:57 +08:00 committed by Alexandre Julliard
parent 2e7056b4ac
commit a0b1f229c7
2 changed files with 45 additions and 6 deletions

View File

@ -1238,7 +1238,9 @@ static GUID const * const tiff_decode_formats[] = {
&GUID_WICPixelFormat64bppPRGBA, &GUID_WICPixelFormat64bppPRGBA,
&GUID_WICPixelFormat32bppCMYK, &GUID_WICPixelFormat32bppCMYK,
&GUID_WICPixelFormat64bppCMYK, &GUID_WICPixelFormat64bppCMYK,
&GUID_WICPixelFormat96bppRGBFloat,
&GUID_WICPixelFormat128bppRGBAFloat, &GUID_WICPixelFormat128bppRGBAFloat,
&GUID_WICPixelFormat128bppPRGBAFloat,
NULL NULL
}; };
@ -1769,6 +1771,10 @@ static BYTE const channel_mask_16bit4[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
static BYTE const channel_mask_32bit[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }; static BYTE const channel_mask_32bit[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 };
static BYTE const channel_mask_96bit1[] = { 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
static BYTE const channel_mask_96bit2[] = { 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00 };
static BYTE const channel_mask_96bit3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff };
static BYTE const channel_mask_128bit1[] = { 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; static BYTE const channel_mask_128bit1[] = { 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
static BYTE const channel_mask_128bit2[] = { 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; static BYTE const channel_mask_128bit2[] = { 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
static BYTE const channel_mask_128bit3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00 }; static BYTE const channel_mask_128bit3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00 };
@ -1791,6 +1797,7 @@ static BYTE const * const channel_masks_16bit[] = { channel_mask_16bit,
channel_mask_16bit2, channel_mask_16bit3, channel_mask_16bit4}; channel_mask_16bit2, channel_mask_16bit3, channel_mask_16bit4};
static BYTE const * const channel_masks_32bit[] = { channel_mask_32bit }; static BYTE const * const channel_masks_32bit[] = { channel_mask_32bit };
static BYTE const * const channel_masks_96bit[] = { channel_mask_96bit1, channel_mask_96bit2, channel_mask_96bit3 };
static BYTE const * const channel_masks_128bit[] = { channel_mask_128bit1, channel_mask_128bit2, channel_mask_128bit3, channel_mask_128bit4 }; static BYTE const * const channel_masks_128bit[] = { channel_mask_128bit1, channel_mask_128bit2, channel_mask_128bit3, channel_mask_128bit4 };
static BYTE const * const channel_masks_BGRA5551[] = { channel_mask_5bit, static BYTE const * const channel_masks_BGRA5551[] = { channel_mask_5bit,
@ -2086,6 +2093,17 @@ static struct regsvr_pixelformat const pixelformat_list[] = {
WICPixelFormatNumericRepresentationUnsignedInteger, WICPixelFormatNumericRepresentationUnsignedInteger,
0 0
}, },
{ &GUID_WICPixelFormat96bppRGBFloat,
"The Wine Project",
"96bpp RGBFloat",
NULL, /* no version */
&GUID_VendorMicrosoft,
96, /* bitsperpixel */
3, /* channel count */
channel_masks_96bit,
WICPixelFormatNumericRepresentationFloat,
0
},
{ &GUID_WICPixelFormat128bppRGBAFloat, { &GUID_WICPixelFormat128bppRGBAFloat,
"The Wine Project", "The Wine Project",
"128bpp RGBAFloat", "128bpp RGBAFloat",
@ -2097,6 +2115,17 @@ static struct regsvr_pixelformat const pixelformat_list[] = {
WICPixelFormatNumericRepresentationFloat, WICPixelFormatNumericRepresentationFloat,
1 1
}, },
{ &GUID_WICPixelFormat128bppPRGBAFloat,
"The Wine Project",
"128bpp PRGBAFloat",
NULL, /* no version */
&GUID_VendorMicrosoft,
128, /* bitsperpixel */
4, /* channel count */
channel_masks_128bit,
WICPixelFormatNumericRepresentationFloat,
1
},
{ NULL } /* list terminator */ { NULL } /* list terminator */
}; };

View File

@ -467,12 +467,22 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
} }
break; break;
case 32: case 32:
if (samples != 4) if (samples == 3)
{ decode_info->format = &GUID_WICPixelFormat96bppRGBFloat;
FIXME("unhandled 32bpp RGB sample count %u\n", samples); else
return WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT; switch(extra_samples[0])
} {
decode_info->format = &GUID_WICPixelFormat128bppRGBAFloat; case 1: /* Associated (pre-multiplied) alpha data */
decode_info->format = &GUID_WICPixelFormat128bppPRGBAFloat;
break;
case 0: /* Unspecified data */
case 2: /* Unassociated alpha data */
decode_info->format = &GUID_WICPixelFormat128bppRGBAFloat;
break;
default:
FIXME("unhandled extra sample type %i\n", extra_samples[0]);
return E_FAIL;
}
break; break;
default: default:
WARN("unhandled RGB bit count %u\n", bps); WARN("unhandled RGB bit count %u\n", bps);