Computes the mean-squared error for each component based on two input images.

HRESULT ComputeMSE( _In_ const Image& image1, _In_ const Image& image2,
    _Out_ float& mse, _Out_writes_opt_(4) float* mseV,
    _In_ DWORD flags = 0 );

Parameters

flags: a combination of the following flags
  • CMSE_DEFAULT Default flags
  • CMSE_IMAGE1_SRGB Indicates image1 should have sRGB -> scRGB conversion applied before comparison.
  • CMSE_IMAGE2_SRGB Indicates image2 should have sRGB -> scRGB conversion applied before comparison.
  • CMSE_IMAGE1_X2_BIAS Indicates image1 should have the UNORM -> SNORM conversion applied before comparison.
  • CMSE_IMAGE2_X2_BIAS Indicates image2 should have the UNORM -> SNORM conversion applied before comparison.
  • CMSE_IGNORE_RED Indicates comparison should ignore differences in the RED (X) channel.
  • CMSE_IGNORE_GREEN Indicates comparison should ignore differences in the GREEN (Y) channel.
  • CMSE_IGNORE_BLUE Indicates comparison should ignore differences in the BLUE (Z) channel.
  • CMSE_IGNORE_ALPHA Indicates 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.

Remarks

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.

Last edited Jun 22, 2015 at 6:05 AM by walbourn, version 5