CanvasImage.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * CanvasImage.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "IImage.h"
  12. #include "Canvas.h"
  13. class CanvasImage : public IImage
  14. {
  15. public:
  16. CanvasImage(const Point & size, CanvasScalingPolicy scalingPolicy);
  17. Canvas getCanvas();
  18. void draw(SDL_Surface * where, const Point & pos, const Rect * src, int scalingFactor) const override;
  19. void scaleTo(const Point & size, EScalingAlgorithm algorithm) override;
  20. void exportBitmap(const boost::filesystem::path & path) const override;
  21. Rect contentRect() const override;
  22. Point dimensions() const override;
  23. //no-op methods
  24. bool isTransparent(const Point & coords) const override{ return false;};
  25. void setAlpha(uint8_t value) override{};
  26. void playerColored(const PlayerColor & player) override{};
  27. void setOverlayColor(const ColorRGBA & color) override{};
  28. void shiftPalette(uint32_t firstColorID, uint32_t colorsToMove, uint32_t distanceToMove) override{};
  29. void adjustPalette(const ColorFilter & shifter, uint32_t colorsToSkipMask) override{};
  30. private:
  31. SDL_Surface * surface;
  32. CanvasScalingPolicy scalingPolicy;
  33. };