ImageComparisonConfig.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. * its licensors.
  4. *
  5. * For complete copyright and license terms please see the LICENSE at the root of this
  6. * distribution (the "License"). All use of this software is governed by the License,
  7. * or, if provided, by the license below or the license accompanying this file. Do not
  8. * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. *
  11. */
  12. #pragma once
  13. #include <AzCore/std/containers/vector.h>
  14. #include <AzCore/std/containers/map.h>
  15. #include <AzCore/std/string/string.h>
  16. #include <AzCore/RTTI/RTTI.h>
  17. namespace AZ
  18. {
  19. class ReflectContext;
  20. }
  21. namespace AtomSampleViewer
  22. {
  23. struct ImageComparisonToleranceLevel
  24. {
  25. AZ_TYPE_INFO(AtomSampleViewer::ImageComparisonToleranceLevel, "{C9B16AE8-71B4-48D8-A1DF-1128600EDE7A}")
  26. static void Reflect(AZ::ReflectContext* context);
  27. AZStd::string m_name; //!< A unique name for this tolerance level
  28. float m_threshold = 0.0f; //!< Range should be 0-1, with 0 meaning no error and 1 meaning as different as possible.
  29. bool m_filterImperceptibleDiffs = false; //!< If true, visually imperceptible differences will be filtered out before scoring.
  30. AZStd::string ToString() const;
  31. };
  32. struct ImageComparisonConfig final
  33. {
  34. AZ_TYPE_INFO(AtomSampleViewer::ImageComparisonConfig, "{7D5C0F1E-BEB7-4C80-B1A7-EDBD55EF6119}")
  35. static void Reflect(AZ::ReflectContext* context);
  36. //! Lists available tolerance levels sorted from most- to least-strict.
  37. AZStd::vector<ImageComparisonToleranceLevel> m_toleranceLevels;
  38. };
  39. } // namespace AtomSampleViewer