ScummVM API documentation
managed_surface.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GRAPHICS_MANAGED_SURFACE_H
23 #define GRAPHICS_MANAGED_SURFACE_H
24 
25 #include "graphics/pixelformat.h"
26 #include "graphics/surface.h"
27 #include "graphics/transform_struct.h"
28 #include "common/types.h"
29 #include "graphics/blit.h"
30 
31 #define MS_RGB(R,G,B) (uint32)(((R) << 24) | ((G) << 16) | ((B) << 8) | 0xff)
32 #define MS_ARGB(A,R,G,B) (uint32)(((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
33 
34 namespace Graphics {
35 
36 class Palette;
37 
52 private:
56  Surface _innerSurface;
57 
62  DisposeAfterUse::Flag _disposeAfterUse;
63 
68  ManagedSurface *_owner;
69 
74  Common::Point _offsetFromOwner;
75 
80  uint _transparentColor;
81  bool _transparentColorSet;
82 
86  Palette *_palette;
87 protected:
91  void simpleBlitFromInner(const Surface &src, const Common::Rect &srcRect,
92  const Common::Point &destPos, const Palette *srcPalette,
93  bool transparentColorSet, uint transparentColor);
94 
98  void maskBlitFromInner(const Surface &src, const Surface &mask,
99  const Common::Rect &srcRect, const Common::Point &destPos,
100  const Palette *srcPalette);
101 
105  void blitFromInner(const Surface &src, const Common::Rect &srcRect,
106  const Common::Rect &destRect, const Palette *srcPalette);
107 
111  void transBlitFromInner(const Surface &src, const Common::Rect &srcRect,
112  const Common::Rect &destRect, uint32 transColor, bool flipped, uint32 srcAlpha,
113  const Palette *srcPalette, const Palette *dstPalette);
114 
118  void blendBlitFromInner(const Surface &src, const Common::Rect &srcRect,
119  const Common::Rect &destRect, const int flipping, const uint colorMod,
120  const TSpriteBlendMode blend, const AlphaType alphaType);
121 
122 public:
126  bool clip(Common::Rect& srcBounds, Common::Rect& destBounds) const {
127  return _innerSurface.clip(srcBounds, destBounds);
128  }
129 
130 public:
131  int16 &w;
132  int16 &h;
133  int32 &pitch;
135 public:
139  ManagedSurface();
140 
148  WARN_DEPRECATED("Use copyFrom(), a move constructor or supply bounds")
149  ManagedSurface(const ManagedSurface &surf);
150 
155 
159  ManagedSurface(int width, int height);
160 
164  ManagedSurface(int width, int height, const Graphics::PixelFormat &pixelFormat);
165 
169  ManagedSurface(ManagedSurface &surf, const Common::Rect &bounds);
170 
174  virtual ~ManagedSurface();
175 
183  operator const Surface &() const { return _innerSurface; }
184 
192  const Surface &rawSurface() const { return _innerSurface; }
193  Surface *surfacePtr() { return &_innerSurface; }
194 
200  WARN_DEPRECATED("Use copyFrom() or a move constructor instead")
202 
207 
211  bool empty() const { return w == 0 || h == 0 || _innerSurface.getPixels() == nullptr; }
212 
216  DisposeAfterUse::Flag disposeAfterUse() const { return _disposeAfterUse; }
217 
226  inline uint32 getPixel(int x, int y) const {
227  return _innerSurface.getPixel(x, y);
228  }
229 
237  inline void setPixel(int x, int y, uint32 pixel) {
238  return _innerSurface.setPixel(x, y, pixel);
239  }
240 
249  inline const void *getBasePtr(int x, int y) const {
250  return _innerSurface.getBasePtr(x, y);
251  }
252 
261  inline void *getBasePtr(int x, int y) {
262  return _innerSurface.getBasePtr(x, y);
263  }
264 
268  inline void *getPixels() { return _innerSurface.getPixels(); }
270  inline const void *getPixels() const { return _innerSurface.getPixels(); }
271 
275  virtual void setPixels(void *newPixels);
276 
280  virtual void create(int16 width, int16 height);
281 
285  virtual void create(int16 width, int16 height, const PixelFormat &pixelFormat);
286 
296  virtual void create(ManagedSurface &surf, const Common::Rect &bounds);
297 
303  virtual void free();
304 
308  virtual void clearDirtyRects() {}
309 
314  virtual void addDirtyRect(const Common::Rect &r);
315 
320  const Common::Point getOffsetFromOwner() const { return _offsetFromOwner; }
321 
325  const Common::Rect getBounds() const {
326  return Common::Rect(0, 0, this->w, this->h);
327  }
328 
332  void simpleBlitFrom(const Surface &src, const Palette *srcPalette = nullptr);
333 
337  void simpleBlitFrom(const Surface &src, const Common::Point &destPos, const Palette *srcPalette = nullptr);
338 
342  void simpleBlitFrom(const Surface &src, const Common::Rect &srcRect,
343  const Common::Point &destPos, const Palette *srcPalette = nullptr);
344 
348  void simpleBlitFrom(const ManagedSurface &src);
349 
353  void simpleBlitFrom(const ManagedSurface &src, const Common::Point &destPos);
354 
358  void simpleBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect,
359  const Common::Point &destPos);
360 
364  void maskBlitFrom(const Surface &src, const Surface &mask, const Palette *srcPalette = nullptr);
365 
369  void maskBlitFrom(const Surface &src, const Surface &mask, const Common::Point &destPos, const Palette *srcPalette = nullptr);
370 
374  void maskBlitFrom(const Surface &src, const Surface &mask, const Common::Rect &srcRect,
375  const Common::Point &destPos, const Palette *srcPalette = nullptr);
376 
380  void maskBlitFrom(const ManagedSurface &src, const ManagedSurface &mask);
381 
385  void maskBlitFrom(const ManagedSurface &src, const ManagedSurface &mask, const Common::Point &destPos);
386 
390  void maskBlitFrom(const ManagedSurface &src, const ManagedSurface &mask,
391  const Common::Rect &srcRect, const Common::Point &destPos);
392 
396  void blitFrom(const Surface &src, const Palette *srcPalette = nullptr);
397 
401  void blitFrom(const Surface &src, const Common::Point &destPos, const Palette *srcPalette = nullptr);
402 
406  void blitFrom(const Surface &src, const Common::Rect &srcRect,
407  const Common::Point &destPos, const Palette *srcPalette = nullptr);
408 
412  void blitFrom(const Surface &src, const Common::Rect &srcRect,
413  const Common::Rect &destRect, const Palette *srcPalette = nullptr);
414 
418  void blitFrom(const ManagedSurface &src, const Common::Rect &srcRect,
419  const Common::Rect &destRect);
420 
424  void blitFrom(const ManagedSurface &src);
425 
429  void blitFrom(const ManagedSurface &src, const Common::Point &destPos);
430 
434  void blitFrom(const ManagedSurface &src, const Common::Rect &srcRect,
435  const Common::Point &destPos);
436 
446  void transBlitFrom(const Surface &src, uint32 transColor = 0, bool flipped = false,
447  uint32 srcAlpha = 0xff, const Palette *srcPalette = nullptr);
448 
459  void transBlitFrom(const Surface &src, const Common::Point &destPos,
460  uint32 transColor = 0, bool flipped = false, uint32 srcAlpha = 0xff, const Palette *srcPalette = nullptr);
461 
473  void transBlitFrom(const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos,
474  uint32 transColor = 0, bool flipped = false, uint32 srcAlpha = 0xff, const Palette *srcPalette = nullptr);
475 
485  void transBlitFrom(const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette);
486 
499  void transBlitFrom(const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect,
500  uint32 transColor = 0, bool flipped = false, uint32 srcAlpha = 0xff,
501  const Palette *srcPalette = nullptr);
502 
511  void transBlitFrom(const ManagedSurface &src, uint32 transColor = 0, bool flipped = false,
512  uint32 srcAlpha = 0xff);
513 
523  void transBlitFrom(const ManagedSurface &src, const Common::Point &destPos,
524  uint32 transColor = 0, bool flipped = false, uint32 srcAlpha = 0xff);
525 
536  void transBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos,
537  uint32 transColor = 0, bool flipped = false, uint32 srcAlpha = 0xff);
538 
550  void transBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect, const Common::Rect &destRect,
551  uint32 transColor = 0, bool flipped = false, uint32 srcAlpha = 0xff);
552 
556  void rawBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect,
557  const Common::Point &destPos) {
558  blitFromInner(src._innerSurface, srcRect, Common::Rect(destPos.x, destPos.y, destPos.x + srcRect.width(),
559  destPos.y + srcRect.height()), src._palette);
560  }
561 
567  static inline bool isBlendBlitPixelFormatSupported(const PixelFormat &src, const PixelFormat &dst) {
569  }
570 
584  void blendBlitFrom(const Surface &src,
585  const int flipping = FLIP_NONE,
586  const uint colorMod = MS_ARGB(255, 255, 255, 255),
587  const TSpriteBlendMode blend = BLEND_NORMAL,
588  const AlphaType alphaType = ALPHA_FULL);
589 
604  void blendBlitFrom(const Surface &src, const Common::Point &destPos,
605  const int flipping = FLIP_NONE,
606  const uint colorMod = MS_ARGB(255, 255, 255, 255),
607  const TSpriteBlendMode blend = BLEND_NORMAL,
608  const AlphaType alphaType = ALPHA_FULL);
609 
625  void blendBlitFrom(const Surface &src, const Common::Rect &srcRect,
626  const Common::Point &destPos,
627  const int flipping = FLIP_NONE,
628  const uint colorMod = MS_ARGB(255, 255, 255, 255),
629  const TSpriteBlendMode blend = BLEND_NORMAL,
630  const AlphaType alphaType = ALPHA_FULL);
631 
648  void blendBlitFrom(const Surface &src, const Common::Rect &srcRect,
649  const Common::Rect &destRect,
650  const int flipping = FLIP_NONE,
651  const uint colorMod = MS_ARGB(255, 255, 255, 255),
652  const TSpriteBlendMode blend = BLEND_NORMAL,
653  const AlphaType alphaType = ALPHA_FULL);
654 
668  void blendBlitFrom(const ManagedSurface &src,
669  const int flipping = FLIP_NONE,
670  const uint colorMod = MS_ARGB(255, 255, 255, 255),
671  const TSpriteBlendMode blend = BLEND_NORMAL,
672  const AlphaType alphaType = ALPHA_FULL);
673 
688  void blendBlitFrom(const ManagedSurface &src, const Common::Point &destPos,
689  const int flipping = FLIP_NONE,
690  const uint colorMod = MS_ARGB(255, 255, 255, 255),
691  const TSpriteBlendMode blend = BLEND_NORMAL,
692  const AlphaType alphaType = ALPHA_FULL);
693 
709  void blendBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect,
710  const Common::Point &destPos,
711  const int flipping = FLIP_NONE,
712  const uint colorMod = MS_ARGB(255, 255, 255, 255),
713  const TSpriteBlendMode blend = BLEND_NORMAL,
714  const AlphaType alphaType = ALPHA_FULL);
715 
732  void blendBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect,
733  const Common::Rect &destRect,
734  const int flipping = FLIP_NONE,
735  const uint colorMod = MS_ARGB(255, 255, 255, 255),
736  const TSpriteBlendMode blend = BLEND_NORMAL,
737  const AlphaType alphaType = ALPHA_FULL);
738 
754  const int posX = 0, const int posY = 0,
755  const int flipping = FLIP_NONE,
756  const Common::Rect *srcRect = nullptr,
757  const uint colorMod = MS_ARGB(255, 255, 255, 255),
758  const int width = -1, const int height = -1,
759  const TSpriteBlendMode blend = BLEND_NORMAL,
760  const AlphaType alphaType = ALPHA_FULL);
762  const int posX = 0, const int posY = 0,
763  const int flipping = FLIP_NONE,
764  const Common::Rect *srcRect = nullptr,
765  const uint colorMod = MS_ARGB(255, 255, 255, 255),
766  const int width = -1, const int height = -1,
767  const TSpriteBlendMode blend = BLEND_NORMAL,
768  const AlphaType alphaType = ALPHA_FULL);
769 
777  void blendFillRect(const Common::Rect r, const uint colorMod, const TSpriteBlendMode blend);
778 
782  void clear(uint32 color = 0);
783 
787  void markAllDirty();
788 
794  void copyRectToSurface(const void *buffer, int srcPitch, int destX, int destY, int width, int height) {
795  _innerSurface.copyRectToSurface(buffer, srcPitch, destX, destY, width, height);
796  addDirtyRect(Common::Rect(destX, destY, destX + width, destY + height));
797  }
798 
804  void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect &subRect) {
805  _innerSurface.copyRectToSurface(srcSurface, destX, destY, subRect);
806  addDirtyRect(Common::Rect(destX, destY, destX + subRect.width(), destY + subRect.height()));
807  }
808 
814  void copyRectToSurfaceWithKey(const void *buffer, int srcPitch, int destX, int destY, int width, int height, uint32 key) {
815  _innerSurface.copyRectToSurfaceWithKey(buffer, srcPitch, destX, destY, width, height, key);
816  addDirtyRect(Common::Rect(destX, destY, destX + width, destY + height));
817  }
818 
824  void copyRectToSurfaceWithKey(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect &subRect, uint32 key) {
825  _innerSurface.copyRectToSurfaceWithKey(srcSurface, destX, destY, subRect, key);
826  addDirtyRect(Common::Rect(destX, destY, destX + subRect.width(), destY + subRect.height()));
827  }
828 
833  void copyFrom(const ManagedSurface &surf);
834 
839  void copyFrom(const Surface &surf);
840 
846  void convertFrom(const ManagedSurface &surf, const PixelFormat &fmt);
847 
853  void convertFrom(const Surface &surf, const PixelFormat &fmt);
854 
862  ManagedSurface *scale(int16 newWidth, int16 newHeight, bool filtering = false) const;
863 
872  ManagedSurface *rotoscale(const TransformStruct &transform, bool filtering = false) const;
873 
877  void drawLine(int x0, int y0, int x1, int y1, uint32 color) {
878  _innerSurface.drawLine(x0, y0, x1, y1, color);
879  addDirtyRect(Common::Rect(MIN(x0, x1), MIN(y0, y1), MAX(x0, x1 + 1), MAX(y0, y1 + 1)));
880  }
881 
885  void drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY, uint32 color) {
886  _innerSurface.drawThickLine(x0, y0, x1, y1, penX, penY, color);
887  addDirtyRect(Common::Rect(MIN(x0, x1 + penX), MIN(y0, y1 + penY), MAX(x0, x1 + penX), MAX(y0, y1 + penY)));
888  }
889 
893  void drawRoundRect(const Common::Rect &rect, int arc, uint32 color, bool filled) {
894  _innerSurface.drawRoundRect(rect, arc, color, filled);
895  addDirtyRect(rect);
896  }
897 
901  void drawPolygonScan(const int *polyX, const int *polyY, int npoints, const Common::Rect &bbox, uint32 color) {
902  _innerSurface.drawPolygonScan(polyX, polyY, npoints, bbox, color);
903  addDirtyRect(bbox);
904  }
905 
909  void drawEllipse(int x0, int y0, int x1, int y1, uint32 color, bool filled) {
910  _innerSurface.drawEllipse(x0, y0, x1, y1, color, filled);
911  addDirtyRect(Common::Rect(MIN(x0, x1), MIN(y0, y1), MAX(x0, x1 + 1), MAX(y0, y1 + 1)));
912  }
913 
917  void hLine(int x, int y, int x2, uint32 color) {
918  _innerSurface.hLine(x, y, x2, color);
919  addDirtyRect(Common::Rect(x, y, x2 + 1, y + 1));
920  }
921 
925  void vLine(int x, int y, int y2, uint32 color) {
926  _innerSurface.vLine(x, y, y2, color);
927  addDirtyRect(Common::Rect(x, y, x + 1, y2 + 1));
928  }
929 
933  void fillRect(const Common::Rect &r, uint32 color) {
934  _innerSurface.fillRect(r, color);
935  addDirtyRect(r);
936  }
937 
941  void frameRect(const Common::Rect &r, uint32 color) {
942  _innerSurface.frameRect(r, color);
943  addDirtyRect(r);
944  }
945 
949  AlphaType detectAlpha() const {
950  return _innerSurface.detectAlpha();
951  }
952 
958  addDirtyRect(area);
959  return _innerSurface.getSubArea(area);
960  }
961 
971  void convertToInPlace(const PixelFormat &dstFormat) {
972  _innerSurface.convertToInPlace(dstFormat);
973  }
974 
986  void convertToInPlace(const PixelFormat &dstFormat, const byte *palette, uint16 paletteCount) {
987  _innerSurface.convertToInPlace(dstFormat, palette, paletteCount);
988  }
989 
993  uint getTransparentColor() const { return _transparentColor; }
994 
998  void setTransparentColor(uint32 color) {
999  _transparentColor = color;
1000  _transparentColorSet = true;
1001  }
1002 
1007  _transparentColorSet = false;
1008  }
1009 
1013  bool hasTransparentColor() const {
1014  return _transparentColorSet;
1015  }
1016 
1020  void clearPalette();
1021 
1025  bool hasPalette() const;
1026 
1030  void grabPalette(byte *colors, uint start, uint num) const;
1031 
1035  void setPalette(const byte *colors, uint start, uint num);
1036 };
1038 } // End of namespace Graphics
1039 
1040 #endif
void clear(uint32 color=0)
Definition: managed_surface.h:51
void convertFrom(const ManagedSurface &surf, const PixelFormat &fmt)
void convertToInPlace(const PixelFormat &dstFormat)
Definition: managed_surface.h:971
const Common::Rect getBounds() const
Definition: managed_surface.h:325
static PixelFormat getSupportedPixelFormat()
Definition: blit.h:375
int16 & w
Definition: managed_surface.h:131
uint getTransparentColor() const
Definition: managed_surface.h:993
Definition: surface.h:67
Common::Rect blendBlitTo(ManagedSurface &target, const int posX=0, const int posY=0, const int flipping=FLIP_NONE, const Common::Rect *srcRect=nullptr, const uint colorMod=(uint32)(((255)<< 24)|((255)<< 16)|((255)<< 8)|(255)), const int width=-1, const int height=-1, const TSpriteBlendMode blend=BLEND_NORMAL, const AlphaType alphaType=ALPHA_FULL)
Renders this surface onto target.
virtual void addDirtyRect(const Common::Rect &r)
bool clip(Common::Rect &srcBounds, Common::Rect &destBounds) const
Definition: managed_surface.h:126
void transBlitFromInner(const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor, bool flipped, uint32 srcAlpha, const Palette *srcPalette, const Palette *dstPalette)
Surface getSubArea(const Common::Rect &area)
void copyRectToSurfaceWithKey(const void *buffer, int srcPitch, int destX, int destY, int width, int height, uint32 key)
Definition: managed_surface.h:814
virtual void create(int16 width, int16 height)
void rawBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos)
Definition: managed_surface.h:556
void drawPolygonScan(const int *polyX, const int *polyY, int npoints, const Common::Rect &bbox, uint32 color)
void simpleBlitFrom(const Surface &src, const Palette *srcPalette=nullptr)
Definition: pixelformat.h:138
void convertToInPlace(const PixelFormat &dstFormat)
Definition: surface.h:359
Surface getSubArea(const Common::Rect &area)
Definition: managed_surface.h:957
void drawPolygonScan(const int *polyX, const int *polyY, int npoints, const Common::Rect &bbox, uint32 color)
Definition: managed_surface.h:901
static bool isBlendBlitPixelFormatSupported(const PixelFormat &src, const PixelFormat &dst)
Definition: managed_surface.h:567
void drawEllipse(int x0, int y0, int x1, int y1, uint32 color, bool filled)
Definition: managed_surface.h:909
virtual void clearDirtyRects()
Definition: managed_surface.h:308
int32 & pitch
Definition: managed_surface.h:133
void * getBasePtr(int x, int y)
Definition: managed_surface.h:261
void maskBlitFrom(const Surface &src, const Surface &mask, const Palette *srcPalette=nullptr)
DisposeAfterUse::Flag disposeAfterUse() const
Definition: managed_surface.h:216
void setTransparentColor(uint32 color)
Definition: managed_surface.h:998
void clearTransparentColor()
Definition: managed_surface.h:1006
const void * getBasePtr(int x, int y) const
Definition: managed_surface.h:249
AlphaType detectAlpha() const
Definition: managed_surface.h:949
void drawLine(int x0, int y0, int x1, int y1, uint32 color)
Definition: managed_surface.h:877
Definition: rect.h:524
void copyRectToSurfaceWithKey(const void *buffer, int srcPitch, int destX, int destY, int width, int height, uint32 key)
bool empty() const
Definition: managed_surface.h:211
void vLine(int x, int y, int y2, uint32 color)
Definition: managed_surface.h:925
T width() const
Definition: rect.h:217
void fillRect(const Common::Rect &r, uint32 color)
Definition: managed_surface.h:933
void copyFrom(const ManagedSurface &surf)
void drawRoundRect(const Common::Rect &rect, int arc, uint32 color, bool filled)
void drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY, uint32 color)
Definition: managed_surface.h:885
void drawRoundRect(const Common::Rect &rect, int arc, uint32 color, bool filled)
Definition: managed_surface.h:893
bool hasTransparentColor() const
Definition: managed_surface.h:1013
bool clip(Common::Rect &srcBounds, Common::Rect &destBounds) const
void blitFrom(const Surface &src, const Palette *srcPalette=nullptr)
int16 & h
Definition: managed_surface.h:132
T height() const
Definition: rect.h:218
const void * getBasePtr(int x, int y) const
Definition: surface.h:138
T y
Definition: rect.h:49
void hLine(int x, int y, int x2, uint32 color)
void * getPixels()
Definition: managed_surface.h:268
Definition: algorithm.h:29
void drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY, uint32 color)
Definition: formatinfo.h:28
T x
Definition: rect.h:48
void blendBlitFromInner(const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const int flipping, const uint colorMod, const TSpriteBlendMode blend, const AlphaType alphaType)
Definition: rect.h:144
const Surface & rawSurface() const
Definition: managed_surface.h:192
ManagedSurface * scale(int16 newWidth, int16 newHeight, bool filtering=false) const
void drawLine(int x0, int y0, int x1, int y1, uint32 color)
void frameRect(const Common::Rect &r, uint32 color)
void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect &subRect)
Definition: managed_surface.h:804
ManagedSurface * rotoscale(const TransformStruct &transform, bool filtering=false) const
Rotoscale function; this returns a transformed version of this surface after rotation and scaling...
const Common::Point getOffsetFromOwner() const
Definition: managed_surface.h:320
void copyRectToSurfaceWithKey(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect &subRect, uint32 key)
Definition: managed_surface.h:824
void setPixel(int x, int y, int pixel)
Definition: surface.h:183
AlphaType detectAlpha() const
void blendFillRect(const Common::Rect r, const uint colorMod, const TSpriteBlendMode blend)
void transBlitFrom(const Surface &src, uint32 transColor=0, bool flipped=false, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
void frameRect(const Common::Rect &r, uint32 color)
Definition: managed_surface.h:941
void blitFromInner(const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette)
T MIN(T a, T b)
Definition: util.h:61
void grabPalette(byte *colors, uint start, uint num) const
void simpleBlitFromInner(const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette, bool transparentColorSet, uint transparentColor)
ManagedSurface & operator=(const ManagedSurface &surf)
void drawEllipse(int x0, int y0, int x1, int y1, uint32 color, bool filled)
PixelFormat & format
Definition: managed_surface.h:134
T MAX(T a, T b)
Definition: util.h:64
void vLine(int x, int y, int y2, uint32 color)
Definition: transform_struct.h:75
void hLine(int x, int y, int x2, uint32 color)
Definition: managed_surface.h:917
void blendBlitFrom(const Surface &src, const int flipping=FLIP_NONE, const uint colorMod=(uint32)(((255)<< 24)|((255)<< 16)|((255)<< 8)|(255)), const TSpriteBlendMode blend=BLEND_NORMAL, const AlphaType alphaType=ALPHA_FULL)
uint32 getPixel(int x, int y) const
Definition: managed_surface.h:226
Simple class for handling a palette data.
Definition: palette.h:55
void fillRect(Common::Rect r, uint32 color)
void copyRectToSurface(const void *buffer, int srcPitch, int destX, int destY, int width, int height)
void setPalette(const byte *colors, uint start, uint num)
const void * getPixels() const
Definition: managed_surface.h:270
uint32 getPixel(int x, int y) const
Definition: surface.h:162
void setPixel(int x, int y, uint32 pixel)
Definition: managed_surface.h:237
void convertToInPlace(const PixelFormat &dstFormat, const byte *palette, uint16 paletteCount)
Definition: managed_surface.h:986
virtual void setPixels(void *newPixels)
const void * getPixels() const
Definition: surface.h:108
void copyRectToSurface(const void *buffer, int srcPitch, int destX, int destY, int width, int height)
Definition: managed_surface.h:794
void maskBlitFromInner(const Surface &src, const Surface &mask, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette)
Definition: atari-screen.h:42