mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-05 20:56:13 +01:00
Added optional forceSRGB parameter to SaveWICTextureToFile (#148)
This commit is contained in:
@@ -1050,7 +1050,8 @@ HRESULT DirectX::SaveWICTextureToFile(
|
||||
D3D12_RESOURCE_STATES beforeState,
|
||||
D3D12_RESOURCE_STATES afterState,
|
||||
const GUID* targetFormat,
|
||||
std::function<void(IPropertyBag2*)> setCustomProps )
|
||||
std::function<void(IPropertyBag2*)> setCustomProps,
|
||||
bool forceSRGB)
|
||||
{
|
||||
if ( !fileName )
|
||||
return E_INVALIDARG;
|
||||
@@ -1091,7 +1092,7 @@ HRESULT DirectX::SaveWICTextureToFile(
|
||||
|
||||
// Determine source format's WIC equivalent
|
||||
WICPixelFormatGUID pfGuid;
|
||||
bool sRGB = false;
|
||||
bool sRGB = forceSRGB;
|
||||
switch ( desc.Format )
|
||||
{
|
||||
case DXGI_FORMAT_R32G32B32A32_FLOAT: pfGuid = GUID_WICPixelFormat128bppRGBAFloat; break;
|
||||
|
||||
Reference in New Issue
Block a user