22#ifndef GRAPHICS_SURFACE_H
23#define GRAPHICS_SURFACE_H
25#include "common/scummsys.h"
26#include "common/endian.h"
27#include "common/list.h"
34#include "graphics/pixelformat.h"
35#include "graphics/transform_struct.h"
48struct TransformStruct;
187 assert(x >= 0 && x < w && y >= 0 && y <
h);
308 void copyRectToSurface(
const void *buffer,
int srcPitch,
int destX,
int destY,
int width,
int height);
394 Graphics::Surface *
convertTo(
const PixelFormat &dstFormat,
const byte *srcPalette = 0,
int srcPaletteCount = 256,
const byte *dstPalette = 0,
int dstPaletteCount = 0, DitherMethod method = kDitherFloyd)
const;
397 void ditherFloyd(
const byte *srcPalette,
int srcPaletteCount,
Surface *dstSurf,
const byte *dstPalette,
int dstPaletteCount, DitherMethod method,
const PixelFormat &dstFormat)
const;
412 void drawLine(
int x0,
int y0,
int x1,
int y1, uint32 color);
429 void drawThickLine(
int x0,
int y0,
int x1,
int y1,
int penX,
int penY, uint32 color);
468 void drawEllipse(
int x0,
int y0,
int x1,
int y1, uint32 color,
bool filled);
479 void hLine(
int x,
int y,
int x2, uint32 color);
490 void vLine(
int x,
int y,
int y2, uint32 color);
512 void move(
int dx,
int dy,
int height);
536 bool applyColorKey(uint8 rKey, uint8 gKey, uint8 bKey,
bool overwriteAlpha =
false);
550 uint8 rNew, uint8 gNew, uint8 bNew);
557 bool setAlpha(uint8 alpha,
bool skipTransparent =
false);
604 void debugPrint(
int debuglevel = 0,
int width = 0,
int height = 0,
int x = 0,
int y = 0,
int scale = -1,
int maxwidth = 160,
const byte *palette = NULL)
const;
613 void operator()(
Surface *ptr) {
679 uint32 _oldColor, _fillColor;
Definition: surface.h:631
FloodFill(Surface *surface, uint32 oldColor, uint32 fillColor, bool maskMode=false)
void addSeed(int x, int y)
Surface * getMask()
Definition: surface.h:673
Definition: algorithm.h:29
Definition: formatinfo.h:28
@ FLIP_NONE
The image will not be flipped.
Definition: transform_struct.h:49
Definition: surface.h:612
uint32 getPixel(int x, int y) const
Definition: surface.h:164
int16 h
Definition: surface.h:76
void init(int16 width, int16 height, int16 pitch, void *pixels, const PixelFormat &format)
void copyRectToSurfaceWithKey(const void *buffer, int srcPitch, int destX, int destY, int width, int height, uint32 key)
void flipHorizontal(const Common::Rect &r)
AlphaType detectAlpha() const
Graphics::Surface * rotoscale(const TransformStruct &transform, bool filtering=false) const
Rotoscale function; this returns a transformed version of this surface after rotation and scaling....
Surface()
Definition: surface.h:100
void fillRect(Common::Rect r, uint32 color)
const Surface getSubArea(const Common::Rect &area) const
Graphics::Surface * convertTo(const PixelFormat &dstFormat, const byte *srcPalette=0, int srcPaletteCount=256, const byte *dstPalette=0, int dstPaletteCount=0, DitherMethod method=kDitherFloyd) const
void convertFrom(const Surface &surf, const PixelFormat &format)
const void * getBasePtr(int x, int y) const
Definition: surface.h:140
void debugPrint(int debuglevel=0, int width=0, int height=0, int x=0, int y=0, int scale=-1, int maxwidth=160, const byte *palette=NULL) const
void convertToInPlace(const PixelFormat &dstFormat)
Definition: surface.h:361
bool applyColorKey(uint8 rKey, uint8 gKey, uint8 bKey, bool overwriteAlpha=false)
void frameRect(const Common::Rect &r, uint32 color)
void convertToInPlace(const PixelFormat &dstFormat, const byte *palette, uint16 paletteCount)
void hLine(int x, int y, int x2, uint32 color)
void move(int dx, int dy, int height)
bool setAlpha(uint8 alpha, bool skipTransparent=false)
void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect &subRect)
void copyRectToSurfaceWithKey(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect &subRect, uint32 key)
void drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY, uint32 color)
Surface getSubArea(const Common::Rect &area)
void copyRectToSurface(const void *buffer, int srcPitch, int destX, int destY, int width, int height)
void * getPixels()
Definition: surface.h:119
void drawRoundRect(const Common::Rect &rect, int arc, uint32 color, bool filled)
void setPixel(int x, int y, int pixel)
Definition: surface.h:185
void flipVertical(const Common::Rect &r)
bool applyColorKey(uint8 rKey, uint8 gKey, uint8 bKey, bool overwriteAlpha, uint8 rNew, uint8 gNew, uint8 bNew)
void * getBasePtr(int x, int y)
Definition: surface.h:152
bool clip(Common::Rect &srcBounds, Common::Rect &destBounds, uint src_w=0, uint src_h=0, byte flip=FLIP_NONE) const
Graphics::Surface * scale(int16 newWidth, int16 newHeight, bool filtering=false, byte flip=0) const
void setPixels(void *newPixels)
Definition: surface.h:130
void * pixels
Definition: surface.h:89
int32 pitch
Definition: surface.h:83
void drawLine(int x0, int y0, int x1, int y1, uint32 color)
void drawEllipse(int x0, int y0, int x1, int y1, uint32 color, bool filled)
int16 w
Definition: surface.h:71
void vLine(int x, int y, int y2, uint32 color)
const void * getPixels() const
Definition: surface.h:110
void drawPolygonScan(const int *polyX, const int *polyY, int npoints, const Common::Rect &bbox, uint32 color)
void create(int16 width, int16 height, const PixelFormat &format)
PixelFormat format
Definition: surface.h:95
void copyFrom(const Surface &surf)
Definition: display_client.h:58