ScreenGrab updated to use non-sRGB metadataa for PNG

This commit is contained in:
Chuck Walbourn 2017-09-19 11:39:39 -07:00
parent 3a4748ddeb
commit 8ae822241a
3 changed files with 25 additions and 6 deletions

View File

@ -599,7 +599,6 @@ namespace
value.bVal = 0; value.bVal = 0;
(void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value); (void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value);
} }
// linear space.
else else
{ {
// add gAMA chunk with gamma 1.0 // add gAMA chunk with gamma 1.0

View File

@ -1108,6 +1108,16 @@ HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
value.bVal = 0; value.bVal = 0;
(void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value); (void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value);
} }
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");
}
} }
else else
{ {

View File

@ -1208,6 +1208,16 @@ HRESULT DirectX::SaveWICTextureToFile( ID3D12CommandQueue* pCommandQ,
value.bVal = 0; value.bVal = 0;
(void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value); (void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value);
} }
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");
}
} }
else else
{ {