mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 04:16:12 +01:00
Added WIC_FLAGS_DEFAULT_SRGB flag (#178)
This commit is contained in:
@@ -518,23 +518,26 @@ namespace
|
||||
GUID containerFormat;
|
||||
if (SUCCEEDED(metareader->GetContainerFormat(&containerFormat)))
|
||||
{
|
||||
// Check for sRGB colorspace metadata
|
||||
bool sRGB = false;
|
||||
|
||||
PROPVARIANT value;
|
||||
PropVariantInit(&value);
|
||||
|
||||
// Check for colorspace chunks
|
||||
if (memcmp(&containerFormat, &GUID_ContainerFormatPng, sizeof(GUID)) == 0)
|
||||
{
|
||||
// Check for sRGB chunk
|
||||
if (SUCCEEDED(metareader->GetMetadataByName(L"/sRGB/RenderingIntent", &value)) && value.vt == VT_UI1)
|
||||
{
|
||||
sRGB = true;
|
||||
}
|
||||
else if (SUCCEEDED(metareader->GetMetadataByName(L"/gAMA/ImageGamma", &value)) && value.vt == VT_UI4)
|
||||
{
|
||||
sRGB = (value.uintVal == 45455);
|
||||
}
|
||||
}
|
||||
else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2 && value.uiVal == 1)
|
||||
else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2)
|
||||
{
|
||||
sRGB = true;
|
||||
sRGB = (value.uiVal == 1);
|
||||
}
|
||||
|
||||
(void)PropVariantClear(&value);
|
||||
|
||||
@@ -429,23 +429,26 @@ namespace
|
||||
GUID containerFormat;
|
||||
if (SUCCEEDED(metareader->GetContainerFormat(&containerFormat)))
|
||||
{
|
||||
// Check for sRGB colorspace metadata
|
||||
bool sRGB = false;
|
||||
|
||||
PROPVARIANT value;
|
||||
PropVariantInit(&value);
|
||||
|
||||
// Check for colorspace chunks
|
||||
if (memcmp(&containerFormat, &GUID_ContainerFormatPng, sizeof(GUID)) == 0)
|
||||
{
|
||||
// Check for sRGB chunk
|
||||
if (SUCCEEDED(metareader->GetMetadataByName(L"/sRGB/RenderingIntent", &value)) && value.vt == VT_UI1)
|
||||
{
|
||||
sRGB = true;
|
||||
}
|
||||
else if (SUCCEEDED(metareader->GetMetadataByName(L"/gAMA/ImageGamma", &value)) && value.vt == VT_UI4)
|
||||
{
|
||||
sRGB = (value.uintVal == 45455);
|
||||
}
|
||||
}
|
||||
else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2 && value.uiVal == 1)
|
||||
else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2)
|
||||
{
|
||||
sRGB = true;
|
||||
sRGB = (value.uiVal == 1);
|
||||
}
|
||||
|
||||
(void)PropVariantClear(&value);
|
||||
|
||||
Reference in New Issue
Block a user