ComputeMSE

Computes the mean squared error (MSE) for each component, based on two input images.

Syntax

HRESULT ComputeMSE(
         const Image &image1,
         const Image &image2,
         float &mse,
         float *mseV,
         DWORD flags
)  

Parameters

image1
Type: Image 

[in] Pointer to an Image structure.

image2
Type: Image 

[in] Pointer to an Image structure.

mse
Type: float 

[out] Mean squared error.

mseV
Type: float *

[out] Mean squared eror, V value.

flags
Type: DWORD 

[in] One or more of the following flags.

Flag Description
CMSE_DEFAULT No special action.
CMSE_IMAGE1_SRGB Indicates image1 should have sRGB to scRGB conversion applied before the comparison.
CMSE_IMAGE2_SRGB Indicates image2 should have sRGB to scRGB conversion applied before the comparison.
CMSE_IGNORE_RED Indicates the comparison should ignore differences in the RED (X) channel.
CMSE_IGNORE_GREEN Indicates the comparison should ignore differences in the GREEN (Y) channel.
CMSE_IGNORE_BLUE Indicates the comparison should ignore differences in the BLUE (Z) channel.
CMSE_IGNORE_ALPHA Indicates the comparison should ignore differences in the ALPHA (W) channel.
CMSE_IMAGE1_X2_BIAS Indicates that image1 should be scaled and biased before comparison (that is, UNORM -> SNORM).
CMSE_IMAGE2_X2_BIAS Indicates that image2 should be scaled and biased before comparison (that is, UNORM -> SNORM).

Return value

Type: HRESULT 

Success or error code.

Requirements

Header: Declared in directxtex.h.