2
0

ZoomImage.h 1.1 KB

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