3
0

MipmapSettings.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #include <BuilderSettings/MipmapSettings.h>
  9. #include <AzCore/Serialization/EditContext.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. namespace ImageProcessingAtom
  12. {
  13. bool MipmapSettings::operator!=(const MipmapSettings& other) const
  14. {
  15. return !(*this == other);
  16. }
  17. bool MipmapSettings::operator==(const MipmapSettings& other) const
  18. {
  19. return m_type == other.m_type;
  20. }
  21. void MipmapSettings::Reflect(AZ::ReflectContext* context)
  22. {
  23. AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context);
  24. if (serialize)
  25. {
  26. serialize->Class<MipmapSettings>()
  27. ->Version(1)
  28. ->Field("MipGenType", &MipmapSettings::m_type);
  29. AZ::EditContext* editContext = serialize->GetEditContext();
  30. if (editContext)
  31. {
  32. editContext->Class<MipmapSettings>("Mipmap Setting", "")
  33. ->DataElement(AZ::Edit::UIHandlers::ComboBox, &MipmapSettings::m_type, "Type", "")
  34. ->EnumAttribute(MipGenType::point, "Point")
  35. ->EnumAttribute(MipGenType::box, "Average")
  36. ->EnumAttribute(MipGenType::triangle, "Linear")
  37. ->EnumAttribute(MipGenType::quadratic, "Bilinear")
  38. ->EnumAttribute(MipGenType::gaussian, "Gaussian")
  39. ->EnumAttribute(MipGenType::blackmanHarris, "BlackmanHarris")
  40. ->EnumAttribute(MipGenType::kaiserSinc, "KaiserSinc")
  41. ->Attribute(AZ::Edit::Attributes::Min, 0)
  42. ;
  43. }
  44. }
  45. }
  46. } // namespace ImageProcessingAtom