1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-11-21 20:10:05 +00:00

Added support for linear color space PNG writing (#48)

This commit is contained in:
Chris Oates 2017-09-19 09:57:36 -07:00 committed by Chuck Walbourn
parent 0eab1e7f83
commit 211d960034

View File

@ -599,6 +599,17 @@ namespace
value.bVal = 0;
(void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value);
}
// linear space.
else
{
// add gAMA chunk with gamma 1.0
value.vt = VT_UI4;
value.uintVal = 100000; // gama value * 100,000 -- i.e. gamma 1.0
(void)metawriter->SetMetadataByName( L"/gAMA/ImageGamma", &value );
// remove sRGB chunk which is added by default.
(void)metawriter->RemoveMetadataByName(L"/sRGB/RenderingIntent");
}
}
#if defined(_XBOX_ONE) && defined(_TITLE)
else if (memcmp(&containerFormat, &GUID_ContainerFormatJpeg, sizeof(GUID)) == 0)