ImageComparisonConfig.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/std/containers/vector.h>
  10. #include <AzCore/std/containers/map.h>
  11. #include <AzCore/std/string/string.h>
  12. #include <AzCore/RTTI/RTTI.h>
  13. namespace AZ
  14. {
  15. class ReflectContext;
  16. }
  17. namespace AtomSampleViewer
  18. {
  19. struct ImageComparisonToleranceLevel
  20. {
  21. AZ_TYPE_INFO(AtomSampleViewer::ImageComparisonToleranceLevel, "{C9B16AE8-71B4-48D8-A1DF-1128600EDE7A}")
  22. static void Reflect(AZ::ReflectContext* context);
  23. AZStd::string m_name; //!< A unique name for this tolerance level
  24. float m_threshold = 0.0f; //!< Range should be 0-1, with 0 meaning no error and 1 meaning as different as possible.
  25. bool m_filterImperceptibleDiffs = false; //!< If true, visually imperceptible differences will be filtered out before scoring.
  26. AZStd::string ToString() const;
  27. };
  28. struct ImageComparisonConfig final
  29. {
  30. AZ_TYPE_INFO(AtomSampleViewer::ImageComparisonConfig, "{7D5C0F1E-BEB7-4C80-B1A7-EDBD55EF6119}")
  31. static void Reflect(AZ::ReflectContext* context);
  32. //! Lists available tolerance levels sorted from most- to least-strict.
  33. AZStd::vector<ImageComparisonToleranceLevel> m_toleranceLevels;
  34. };
  35. } // namespace AtomSampleViewer