mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 19:50:13 +02:00
DirectXTex: Added WIC_FLAGS_IGNORE_SRGB to ignore the presense of sRGB metadata in WIC files
This commit is contained in:
parent
5f3b34beb5
commit
8bfc1b7de3
@ -192,6 +192,9 @@ namespace DirectX
|
||||
WIC_FLAGS_ALL_FRAMES = 0x10,
|
||||
// Loads all images in a multi-frame file, converting/resizing to match the first frame as needed, defaults to 0th frame otherwise
|
||||
|
||||
WIC_FLAGS_IGNORE_SRGB = 0x20,
|
||||
// Ignores sRGB metadata if present in the file
|
||||
|
||||
WIC_FLAGS_DITHER = 0x10000,
|
||||
// Use ordered 4x4 dithering for any required conversions
|
||||
|
||||
|
@ -272,6 +272,8 @@ static HRESULT _DecodeMetadata( _In_ DWORD flags,
|
||||
if ( metadata.format == DXGI_FORMAT_UNKNOWN )
|
||||
return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
|
||||
|
||||
if ( !( flags & WIC_FLAGS_IGNORE_SRGB ) )
|
||||
{
|
||||
GUID containerFormat;
|
||||
hr = decoder->GetContainerFormat( &containerFormat );
|
||||
if ( FAILED(hr) )
|
||||
@ -310,6 +312,7 @@ static HRESULT _DecodeMetadata( _In_ DWORD flags,
|
||||
// Some formats just don't support metadata (BMP, ICO, etc.), so ignore this failure
|
||||
hr = S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user