mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 11:40:14 +02:00
ScreenGrab updated to use non-sRGB metadataa for PNG
This commit is contained in:
parent
3a4748ddeb
commit
8ae822241a
@ -599,7 +599,6 @@ namespace
|
||||
value.bVal = 0;
|
||||
(void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value);
|
||||
}
|
||||
// linear space.
|
||||
else
|
||||
{
|
||||
// add gAMA chunk with gamma 1.0
|
||||
|
@ -1108,6 +1108,16 @@ HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
|
||||
value.bVal = 0;
|
||||
(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
|
||||
{
|
||||
|
@ -1208,6 +1208,16 @@ HRESULT DirectX::SaveWICTextureToFile( ID3D12CommandQueue* pCommandQ,
|
||||
value.bVal = 0;
|
||||
(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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user