Added WIC_LOADER_SRGB_DEFAULT flag to WICTextureLoader
This commit is contained in:
parent
17aeb40917
commit
2873a800d0
@ -39,9 +39,9 @@ namespace DirectX
|
|||||||
|
|
||||||
enum DDS_LOADER_FLAGS
|
enum DDS_LOADER_FLAGS
|
||||||
{
|
{
|
||||||
DDS_LOADER_DEFAULT = 0,
|
DDS_LOADER_DEFAULT = 0,
|
||||||
DDS_LOADER_FORCE_SRGB = 0x1,
|
DDS_LOADER_FORCE_SRGB = 0x1,
|
||||||
DDS_LOADER_MIP_RESERVE = 0x8,
|
DDS_LOADER_MIP_RESERVE = 0x8,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Standard version
|
// Standard version
|
||||||
|
@ -534,11 +534,19 @@ namespace
|
|||||||
{
|
{
|
||||||
sRGB = (value.uintVal == 45455);
|
sRGB = (value.uintVal == 45455);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sRGB = (loadFlags & WIC_LOADER_SRGB_DEFAULT) != 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2)
|
else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2)
|
||||||
{
|
{
|
||||||
sRGB = (value.uiVal == 1);
|
sRGB = (value.uiVal == 1);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sRGB = (loadFlags & WIC_LOADER_SRGB_DEFAULT) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
(void)PropVariantClear(&value);
|
(void)PropVariantClear(&value);
|
||||||
|
|
||||||
|
@ -36,9 +36,10 @@ namespace DirectX
|
|||||||
WIC_LOADER_DEFAULT = 0,
|
WIC_LOADER_DEFAULT = 0,
|
||||||
WIC_LOADER_FORCE_SRGB = 0x1,
|
WIC_LOADER_FORCE_SRGB = 0x1,
|
||||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||||
WIC_LOADER_FORCE_RGBA32 = 0x10,
|
WIC_LOADER_SRGB_DEFAULT = 0x4,
|
||||||
WIC_LOADER_FIT_POW2 = 0x20,
|
WIC_LOADER_FIT_POW2 = 0x20,
|
||||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||||
|
WIC_LOADER_FORCE_RGBA32 = 0x80,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -445,11 +445,19 @@ namespace
|
|||||||
{
|
{
|
||||||
sRGB = (value.uintVal == 45455);
|
sRGB = (value.uintVal == 45455);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sRGB = (loadFlags & WIC_LOADER_SRGB_DEFAULT) != 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2)
|
else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2)
|
||||||
{
|
{
|
||||||
sRGB = (value.uiVal == 1);
|
sRGB = (value.uiVal == 1);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sRGB = (loadFlags & WIC_LOADER_SRGB_DEFAULT) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
(void)PropVariantClear(&value);
|
(void)PropVariantClear(&value);
|
||||||
|
|
||||||
|
@ -35,11 +35,12 @@ namespace DirectX
|
|||||||
WIC_LOADER_DEFAULT = 0,
|
WIC_LOADER_DEFAULT = 0,
|
||||||
WIC_LOADER_FORCE_SRGB = 0x1,
|
WIC_LOADER_FORCE_SRGB = 0x1,
|
||||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||||
WIC_LOADER_MIP_AUTOGEN = 0x4,
|
WIC_LOADER_SRGB_DEFAULT = 0x4,
|
||||||
WIC_LOADER_MIP_RESERVE = 0x8,
|
WIC_LOADER_MIP_AUTOGEN = 0x8,
|
||||||
WIC_LOADER_FORCE_RGBA32 = 0x10,
|
WIC_LOADER_MIP_RESERVE = 0x10,
|
||||||
WIC_LOADER_FIT_POW2 = 0x20,
|
WIC_LOADER_FIT_POW2 = 0x20,
|
||||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||||
|
WIC_LOADER_FORCE_RGBA32 = 0x80,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -33,10 +33,10 @@ namespace DirectX
|
|||||||
enum WIC_LOADER_FLAGS : uint32_t
|
enum WIC_LOADER_FLAGS : uint32_t
|
||||||
{
|
{
|
||||||
WIC_LOADER_DEFAULT = 0,
|
WIC_LOADER_DEFAULT = 0,
|
||||||
WIC_LOADER_MIP_AUTOGEN = 0x4,
|
WIC_LOADER_MIP_AUTOGEN = 0x8,
|
||||||
WIC_LOADER_FORCE_RGBA32 = 0x10,
|
|
||||||
WIC_LOADER_FIT_POW2 = 0x20,
|
WIC_LOADER_FIT_POW2 = 0x20,
|
||||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||||
|
WIC_LOADER_FORCE_RGBA32 = 0x80,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user