DirectXTex: Added WIC_FLAGS_IGNORE_SRGB to ignore the presense of sRGB metadata in WIC files

This commit is contained in:
walbourn_cp 2013-07-31 00:39:59 -07:00
parent 5f3b34beb5
commit 8bfc1b7de3
2 changed files with 34 additions and 28 deletions

View File

@ -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

View File

@ -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;
}