-
Notifications
You must be signed in to change notification settings - Fork 467
ComputeMSE
| DirectXTex |
|---|
Computes the mean-squared error for each component based on two input images.
HRESULT ComputeMSE(
const Image& image1, const Image& image2,
float& mse, float* mseV,
CMSE_FLAGS flags = CMSE_DEFAULT );flags: a combination of the following flags
-
CMSE_DEFAULTDefault flags -
CMSE_IMAGE1_SRGBIndicates image1 should have sRGB -> scRGB conversion applied before comparison. -
CMSE_IMAGE2_SRGBIndicates image2 should have sRGB -> scRGB conversion applied before comparison. -
CMSE_IMAGE1_X2_BIASIndicates image1 should have the UNORM -> SNORM conversion applied before comparison. -
CMSE_IMAGE2_X2_BIASIndicates image2 should have the UNORM -> SNORM conversion applied before comparison. -
CMSE_IGNORE_REDIndicates comparison should ignore differences in the RED (X) channel. -
CMSE_IGNORE_GREENIndicates comparison should ignore differences in the GREEN (Y) channel. -
CMSE_IGNORE_BLUEIndicates comparison should ignore differences in the BLUE (Z) channel. -
CMSE_IGNORE_ALPHAIndicates comparison should ignore differences in the ALPHA (W) channel.
mse: The sum of the channel mean-squared error.
mseV: Points to an array of 4 floats which holds the individual channel mean-squared error. Can be nullptr.
These functions will succeed with an S_OK or will return an HRESULT error code (E_INVALIDARG, E_OUTOFMEMORY, E_FAIL, E_POINTER, E_UNEXPECTED, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), or HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)).
These functions are marked noexcept, and do not throw C++ exceptions.
Image data is converted to DXGI_FORMAT_R32G32B32A32_FLOAT for this operation. BC data is automatically decompressed.
This function cannot operate directly on a planar format image. See ConvertToSinglePlane for a method for converting planar data to a format that is supported by this routine.
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Xbox One
- Xbox Series X|S
- Windows Subsystem for Linux
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v20
- GCC 10.5, 11.4, 12.3, 13.3, 14.2
- MinGW 12.2, 13.2
- CMake 3.21
DirectX Tool Kit for DirectX 11