mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-21 12:00:06 +00:00
ScreenGrab updated to use non-sRGB metadataa for PNG
This commit is contained in:
parent
3a4748ddeb
commit
8ae822241a
@ -599,13 +599,12 @@ 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 );
|
||||
(void)metawriter->SetMetadataByName(L"/gAMA/ImageGamma", &value);
|
||||
|
||||
// remove sRGB chunk which is added by default.
|
||||
(void)metawriter->RemoveMetadataByName(L"/sRGB/RenderingIntent");
|
||||
|
@ -1102,11 +1102,21 @@ HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
|
||||
(void)metawriter->SetMetadataByName( L"/tEXt/{str=Software}", &value );
|
||||
|
||||
// Set sRGB chunk
|
||||
if ( sRGB )
|
||||
if (sRGB)
|
||||
{
|
||||
value.vt = VT_UI1;
|
||||
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
|
||||
|
@ -1202,11 +1202,21 @@ HRESULT DirectX::SaveWICTextureToFile( ID3D12CommandQueue* pCommandQ,
|
||||
(void)metawriter->SetMetadataByName( L"/tEXt/{str=Software}", &value );
|
||||
|
||||
// Set sRGB chunk
|
||||
if ( sRGB )
|
||||
if (sRGB)
|
||||
{
|
||||
value.vt = VT_UI1;
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user