2
0

ZoomImage.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Jolt/Core/Reference.h>
  5. class Surface;
  6. /// Filter function used to rescale the image
  7. enum EFilter
  8. {
  9. FilterBox,
  10. FilterTriangle,
  11. FilterBell,
  12. FilterBSpline,
  13. FilterLanczos3,
  14. FilterMitchell,
  15. };
  16. /// Zoom settings for ZoomImage
  17. class ZoomSettings
  18. {
  19. public:
  20. /// Constructor
  21. ZoomSettings();
  22. /// Comparison operators
  23. bool operator == (const ZoomSettings &inRHS) const;
  24. /// Default settings
  25. static const ZoomSettings sDefault;
  26. EFilter mFilter; ///< Filter function for image scaling
  27. bool mWrapFilter; ///< If true, the filter will be applied wrapping around the image, this provides better results for repeating textures
  28. float mBlur; ///< If > 1 then the image will be blurred, if < 1 the image will be sharpened
  29. };
  30. /// Function to resize an image
  31. bool ZoomImage(RefConst<Surface> inSrc, Ref<Surface> ioDst, const ZoomSettings &inZoomSettings = ZoomSettings::sDefault);