Atom/rbarrand/export screenshot diff (#7300)
* Small refactor on ImageComparison utils. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Add aznumeric cast. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Correction on aznumeric cast. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Add unit test for new image comparison function. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Use span instead of array_view Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com>
This commit is contained in:
@@ -24,7 +24,7 @@ namespace AZ
|
||||
};
|
||||
|
||||
//! Calculates the maximum difference of the rgb channels between two image buffers.
|
||||
int16_t CalcMaxChannelDifference(AZStd::array_view<uint8_t> bufferA, AZStd::array_view<uint8_t> bufferB, size_t index);
|
||||
int16_t CalcMaxChannelDifference(AZStd::span<const uint8_t> bufferA, AZStd::span<const uint8_t> bufferB, size_t index);
|
||||
|
||||
//! Compares two images and returns the RMS (root mean square) of the difference.
|
||||
//! @param buffer[A|B] the raw buffer of image data
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace AZ
|
||||
{
|
||||
namespace Utils
|
||||
{
|
||||
int16_t CalcMaxChannelDifference(AZStd::array_view<uint8_t> bufferA, AZStd::array_view<uint8_t> bufferB, size_t index)
|
||||
int16_t CalcMaxChannelDifference(AZStd::span<const uint8_t> bufferA, AZStd::span<const uint8_t> bufferB, size_t index)
|
||||
{
|
||||
// We use the max error from a single channel instead of accumulating the error from each channel.
|
||||
// This normalizes differences so that for example black vs red has the same weight as black vs yellow.
|
||||
|
||||
Reference in New Issue
Block a user