#include <managed_surface.h>
Public Member Functions | |
bool | clip (Common::Rect &srcBounds, Common::Rect &destBounds) const |
ManagedSurface () | |
ManagedSurface (const ManagedSurface &surf) | |
ManagedSurface (ManagedSurface &&surf) | |
ManagedSurface (int width, int height) | |
ManagedSurface (int width, int height, const Graphics::PixelFormat &pixelFormat) | |
ManagedSurface (ManagedSurface &surf, const Common::Rect &bounds) | |
ManagedSurface (Surface *surf, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES) | |
ManagedSurface (const Surface *surf) | |
virtual | ~ManagedSurface () |
operator const Surface & () const | |
const Surface & | rawSurface () const |
Surface * | surfacePtr () |
ManagedSurface & | operator= (const ManagedSurface &surf) |
ManagedSurface & | operator= (ManagedSurface &&surf) |
bool | empty () const |
DisposeAfterUse::Flag | disposeAfterUse () const |
uint32 | getPixel (int x, int y) const |
void | setPixel (int x, int y, uint32 pixel) |
const void * | getBasePtr (int x, int y) const |
void * | getBasePtr (int x, int y) |
void * | getPixels () |
const void * | getPixels () const |
virtual void | setPixels (void *newPixels) |
virtual void | create (int16 width, int16 height) |
virtual void | create (int16 width, int16 height, const PixelFormat &pixelFormat) |
virtual void | create (ManagedSurface &surf, const Common::Rect &bounds) |
virtual void | free () |
virtual void | clearDirtyRects () |
virtual void | addDirtyRect (const Common::Rect &r) |
const Common::Point | getOffsetFromOwner () const |
const Common::Rect | getBounds () const |
void | simpleBlitFrom (const Surface &src, const Palette *srcPalette=nullptr) |
void | simpleBlitFrom (const Surface &src, const Common::Point &destPos, const Palette *srcPalette=nullptr) |
void | simpleBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette=nullptr) |
void | simpleBlitFrom (const ManagedSurface &src) |
void | simpleBlitFrom (const ManagedSurface &src, const Common::Point &destPos) |
void | simpleBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos) |
void | blitFrom (const Surface &src, const Palette *srcPalette=nullptr) |
void | blitFrom (const Surface &src, const Common::Point &destPos, const Palette *srcPalette=nullptr) |
void | blitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette=nullptr) |
void | blitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette=nullptr) |
void | blitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Rect &destRect) |
void | blitFrom (const ManagedSurface &src) |
void | blitFrom (const ManagedSurface &src, const Common::Point &destPos) |
void | blitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos) |
void | transBlitFrom (const Surface &src, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr) |
void | transBlitFrom (const Surface &src, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr) |
void | transBlitFrom (const Surface &src, const Common::Point &destPos, const ManagedSurface &mask, const Palette *srcPalette=nullptr) |
void | transBlitFrom (const Surface &src, const Common::Point &destPos, const Surface &mask, const Palette *srcPalette=nullptr) |
void | transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr) |
void | transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette) |
void | transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Surface *mask=nullptr, bool maskOnly=false, const Palette *srcPalette=nullptr) |
void | transBlitFrom (const ManagedSurface &src, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff) |
void | transBlitFrom (const ManagedSurface &src, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff) |
void | transBlitFrom (const ManagedSurface &src, const Common::Point &destPos, const ManagedSurface &mask) |
void | transBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff) |
void | transBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Surface *mask=nullptr, bool maskOnly=false) |
void | rawBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos) |
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. More... | |
Common::Rect | blendBlitTo (Surface &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) |
void | clear (uint32 color=0) |
void | markAllDirty () |
void | copyRectToSurface (const void *buffer, int srcPitch, int destX, int destY, int width, int height) |
void | copyRectToSurface (const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect subRect) |
void | copyRectToSurfaceWithKey (const void *buffer, int srcPitch, int destX, int destY, int width, int height, uint32 key) |
void | copyRectToSurfaceWithKey (const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect subRect, uint32 key) |
void | copyFrom (const ManagedSurface &surf) |
void | copyFrom (const Surface &surf) |
void | convertFrom (const ManagedSurface &surf, const PixelFormat &fmt) |
void | convertFrom (const Surface &surf, const PixelFormat &fmt) |
ManagedSurface * | scale (int16 newWidth, int16 newHeight, bool filtering=false) const |
ManagedSurface * | rotoscale (const TransformStruct &transform, bool filtering=false) const |
Rotoscale function; this returns a transformed version of this surface after rotation and scaling. Please do not use this if angle == 0, use plain old scaling function. More... | |
void | drawLine (int x0, int y0, int x1, int y1, uint32 color) |
void | drawThickLine (int x0, int y0, int x1, int y1, int penX, int penY, uint32 color) |
void | hLine (int x, int y, int x2, uint32 color) |
void | vLine (int x, int y, int y2, uint32 color) |
void | fillRect (Common::Rect r, uint32 color) |
void | frameRect (const Common::Rect &r, uint32 color) |
AlphaType | detectAlpha () const |
Surface | getSubArea (const Common::Rect &area) |
void | convertToInPlace (const PixelFormat &dstFormat) |
void | convertToInPlace (const PixelFormat &dstFormat, const byte *palette, uint16 paletteCount) |
uint | getTransparentColor () const |
void | setTransparentColor (uint32 color) |
void | clearTransparentColor () |
bool | hasTransparentColor () const |
void | clearPalette () |
bool | hasPalette () const |
void | grabPalette (byte *colors, uint start, uint num) const |
void | setPalette (const byte *colors, uint start, uint num) |
Static Public Member Functions | |
static bool | isBlendBlitPixelFormatSupported (const PixelFormat &src, const PixelFormat &dst) |
Public Attributes | |
int16 & | w |
int16 & | h |
int32 & | pitch |
PixelFormat & | format |
Protected Member Functions | |
void | simpleBlitFromInner (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette, bool transparentColorSet, uint transparentColor) |
void | blitFromInner (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette) |
void | transBlitFromInner (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor, bool flipped, uint32 overrideColor, uint32 srcAlpha, const Palette *srcPalette, const Palette *dstPalette, const Surface *mask, bool maskOnly) |
A derived graphics surface, which supports automatically managing the allocated surface data block and introduces several new blitting methods.
Graphics::ManagedSurface::ManagedSurface | ( | ) |
Create the managed surface.
Graphics::ManagedSurface::ManagedSurface | ( | const ManagedSurface & | surf | ) |
Create a managed surface from another one.
If the source surface is maintaining its own surface data, then this surface will create its own surface of the same size and copy the contents from the source surface.
Graphics::ManagedSurface::ManagedSurface | ( | ManagedSurface && | surf | ) |
Create a managed surface from another one.
Graphics::ManagedSurface::ManagedSurface | ( | int | width, |
int | height | ||
) |
Create the managed surface.
Graphics::ManagedSurface::ManagedSurface | ( | int | width, |
int | height, | ||
const Graphics::PixelFormat & | pixelFormat | ||
) |
Create the managed surface.
Graphics::ManagedSurface::ManagedSurface | ( | ManagedSurface & | surf, |
const Common::Rect & | bounds | ||
) |
Create the managed surface.
Graphics::ManagedSurface::ManagedSurface | ( | Surface * | surf, |
DisposeAfterUse::Flag | disposeAfterUse = DisposeAfterUse::YES |
||
) |
Create a managed surface from plain Surface.
If disposeAfterUse flag is set (default), the surface will reuse all structures from the surface and destroy it, otherwise it will make a copy.
Graphics::ManagedSurface::ManagedSurface | ( | const Surface * | surf | ) |
Create a managed surface from plain Surface.
|
virtual |
Destroy the managed surface.
|
protected |
Inner method for blitting.
|
protected |
Inner method for blitting.
|
protected |
Inner method for copying another surface into this one at a given destination position.
|
inline |
Clip the given source bounds so the passed destBounds will be entirely on-screen.
|
inline |
Automatically convert to a Graphics::Surface by simply returning the inner surface.
This must be const, because changes are not supposed to be done directly to it, since it would bypass dirty rect handling.
|
inline |
Return the underlying Graphics::Surface
If a caller uses the non-const surfacePtr version and changes the surface, they'll be responsible for calling addDirtyRect for any affected area
ManagedSurface& Graphics::ManagedSurface::operator= | ( | const ManagedSurface & | surf | ) |
Reassign one managed surface to another one.
ManagedSurface& Graphics::ManagedSurface::operator= | ( | ManagedSurface && | surf | ) |
Reassign one managed surface to another one.
|
inline |
Return true if the surface has not yet been allocated.
|
inline |
Return true if the surface manages its own pixels.
|
inline |
Return the pixel at the specified point.
x | The x coordinate of the pixel. |
y | The y coordinate of the pixel. |
|
inline |
Set the pixel at the specified point.
x | The x coordinate of the pixel. |
y | The y coordinate of the pixel. |
pixel | The value of the pixel. |
|
inline |
Return a pointer to the pixel at the specified point.
x | The x coordinate of the pixel. |
y | The y coordinate of the pixel. |
|
inline |
Return a pointer to the pixel at the specified point.
x | The x coordinate of the pixel. |
y | The y coordinate of the pixel. |
|
inline |
Get a reference to the pixel data.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Set the pixel data.
|
virtual |
Allocate memory for the pixel data of the surface.
Reimplemented in TsAGE::GfxSurface.
|
virtual |
Allocate memory for the pixel data of the surface.
|
virtual |
Set up the surface as a subsection of another passed parent surface.
This surface will not own the pixels, and any dirty rect notifications will be automatically passed to the original parent surface.
|
virtual |
Release the memory used by the pixel memory of this surface.
This is a counterpart of create().
|
inlinevirtual |
Clear any pending dirty rectangles that have been generated for the surface.
Reimplemented in Graphics::Screen.
|
virtual |
Base method that descendant classes can override for recording the affected dirty areas of the surface.
Reimplemented in MADS::MSurface, Access::ASurface, Sherlock::Surface, MM::Xeen::Window, TsAGE::GfxSurface, Graphics::Screen, MM::Xeen::Screen, Petka::VideoSystem, and MM::Shared::Xeen::BaseSurface.
|
inline |
When the managed surface is a subsection of a parent surface, return the the offset in the parent surface where the managed surface starts at.
|
inline |
Return a rect providing the bounds of the surface.
void Graphics::ManagedSurface::simpleBlitFrom | ( | const Surface & | src, |
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one.
void Graphics::ManagedSurface::simpleBlitFrom | ( | const Surface & | src, |
const Common::Point & | destPos, | ||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one at a given destination position.
void Graphics::ManagedSurface::simpleBlitFrom | ( | const Surface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Point & | destPos, | ||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one at a given destination position.
void Graphics::ManagedSurface::simpleBlitFrom | ( | const ManagedSurface & | src | ) |
Copy another surface into this one.
void Graphics::ManagedSurface::simpleBlitFrom | ( | const ManagedSurface & | src, |
const Common::Point & | destPos | ||
) |
Copy another surface into this one at a given destination position.
void Graphics::ManagedSurface::simpleBlitFrom | ( | const ManagedSurface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Point & | destPos | ||
) |
Copy another surface into this one at a given destination position.
void Graphics::ManagedSurface::blitFrom | ( | const Surface & | src, |
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one.
void Graphics::ManagedSurface::blitFrom | ( | const Surface & | src, |
const Common::Point & | destPos, | ||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one at a given destination position.
void Graphics::ManagedSurface::blitFrom | ( | const Surface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Point & | destPos, | ||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one at a given destination position.
void Graphics::ManagedSurface::blitFrom | ( | const Surface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Rect & | destRect, | ||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one at a given destination area and perform the potential scaling.
void Graphics::ManagedSurface::blitFrom | ( | const ManagedSurface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Rect & | destRect | ||
) |
Copy another surface into this one at a given destination area and perform the potential scaling.
void Graphics::ManagedSurface::blitFrom | ( | const ManagedSurface & | src | ) |
Copy another surface into this one.
void Graphics::ManagedSurface::blitFrom | ( | const ManagedSurface & | src, |
const Common::Point & | destPos | ||
) |
Copy another surface into this one at a given destination position.
void Graphics::ManagedSurface::blitFrom | ( | const ManagedSurface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Point & | destPos | ||
) |
Copy another surface into this one at a given destination position.
void Graphics::ManagedSurface::transBlitFrom | ( | const Surface & | src, |
uint32 | transColor = 0 , |
||
bool | flipped = false , |
||
uint32 | overrideColor = 0 , |
||
uint32 | srcAlpha = 0xff , |
||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
transColor | Transparency color to ignore copying of. |
flipped | Whether to horizontally flip the image. |
overrideColor | Optional color to use instead of non-transparent pixels from the source surface. |
srcAlpha | Optional additional transparency applied to src . |
srcPalette | Optional palette if the src surface uses a CLUT8 pixel format. |
void Graphics::ManagedSurface::transBlitFrom | ( | const Surface & | src, |
const Common::Point & | destPos, | ||
uint32 | transColor = 0 , |
||
bool | flipped = false , |
||
uint32 | overrideColor = 0 , |
||
uint32 | srcAlpha = 0xff , |
||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
destPos | Destination position to draw the surface. |
transColor | Transparency color to ignore copying of. |
flipped | Whether to horizontally flip the image. |
overrideColor | Optional color to use instead of non-transparent pixels from the source surface. |
srcAlpha | Optional additional transparency applied to src . |
srcPalette | Optional palette if the src surface uses a CLUT8 pixel format. |
void Graphics::ManagedSurface::transBlitFrom | ( | const Surface & | src, |
const Common::Point & | destPos, | ||
const ManagedSurface & | mask, | ||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
destPos | Destination position to draw the surface. |
mask | Mask definition. |
srcPalette | Optional palette if the src surface uses a CLUT8 pixel format. |
void Graphics::ManagedSurface::transBlitFrom | ( | const Surface & | src, |
const Common::Point & | destPos, | ||
const Surface & | mask, | ||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
destPos | Destination position to draw the surface. |
mask | Mask definition. |
srcPalette | Optional palette if the src surface uses a CLUT8 pixel format. |
void Graphics::ManagedSurface::transBlitFrom | ( | const Surface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Point & | destPos, | ||
uint32 | transColor = 0 , |
||
bool | flipped = false , |
||
uint32 | overrideColor = 0 , |
||
uint32 | srcAlpha = 0xff , |
||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
srcRect | Subsection of the source surface to draw. |
destPos | Destination position to draw the surface. |
transColor | Transparency color to ignore copying of. |
flipped | Specifies whether to horizontally flip the image. |
overrideColor | Optional color to use instead of non-transparent pixels from the source surface. |
srcAlpha | Optional additional transparency applied to src . |
srcPalette | Optional palette if the src surface uses a CLUT8 pixel format. |
void Graphics::ManagedSurface::transBlitFrom | ( | const Surface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Rect & | destRect, | ||
const Palette * | srcPalette | ||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
srcRect | Subsection of the source surface to draw. |
destRect | Destination area to draw the surface in. This can be sized differently then srcRect , allowing for arbitrary scaling of the image. |
srcPalette | Palette for the CLUT8 src surface. |
void Graphics::ManagedSurface::transBlitFrom | ( | const Surface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Rect & | destRect, | ||
uint32 | transColor = 0 , |
||
bool | flipped = false , |
||
uint32 | overrideColor = 0 , |
||
uint32 | srcAlpha = 0xff , |
||
const Surface * | mask = nullptr , |
||
bool | maskOnly = false , |
||
const Palette * | srcPalette = nullptr |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
srcRect | Subsection of the source surface to draw. |
destRect | Destination area to draw the surface in. This can be sized differently then srcRect , allowing for arbitrary scaling of the image. |
transColor | Transparency color to ignore copying of. |
flipped | Whether to horizontally flip the image. |
overrideColor | Optional color to use instead of non-transparent pixels from the source surface. |
srcAlpha | Optional additional transparency applied to src . |
mask | Optional parameter with mask definition. |
maskOnly | Optional parameter for using mask over transColor . |
srcPalette | Optional palette if the src surface uses a CLUT8 pixel format. |
void Graphics::ManagedSurface::transBlitFrom | ( | const ManagedSurface & | src, |
uint32 | transColor = 0 , |
||
bool | flipped = false , |
||
uint32 | overrideColor = 0 , |
||
uint32 | srcAlpha = 0xff |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
transColor | Transparency color to ignore copying of. |
flipped | Whether to horizontally flip the image. |
overrideColor | Optional color to use instead of non-transparent pixels from the source surface. |
srcAlpha | Optional additional transparency applied to src . |
void Graphics::ManagedSurface::transBlitFrom | ( | const ManagedSurface & | src, |
const Common::Point & | destPos, | ||
uint32 | transColor = 0 , |
||
bool | flipped = false , |
||
uint32 | overrideColor = 0 , |
||
uint32 | srcAlpha = 0xff |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
destPos | Destination position to draw the surface. |
transColor | Transparency color to ignore copying of. |
flipped | Whether to horizontally flip the image. |
overrideColor | Optional color to use instead of non-transparent pixels from the source surface. |
srcAlpha | Optional additional transparency applied to src . |
void Graphics::ManagedSurface::transBlitFrom | ( | const ManagedSurface & | src, |
const Common::Point & | destPos, | ||
const ManagedSurface & | mask | ||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
destPos | Destination position to draw the surface. |
mask | Mask definition. |
void Graphics::ManagedSurface::transBlitFrom | ( | const ManagedSurface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Point & | destPos, | ||
uint32 | transColor = 0 , |
||
bool | flipped = false , |
||
uint32 | overrideColor = 0 , |
||
uint32 | srcAlpha = 0xff |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
srcRect | Subsection of the source surface to draw. |
destPos | Destination position to draw the surface. |
transColor | Transparency color to ignore copying of. |
flipped | Whether to horizontally flip the image. |
overrideColor | Optional color to use instead of non-transparent pixels from the source surface. |
srcAlpha | Optional additional transparency applied to src . |
void Graphics::ManagedSurface::transBlitFrom | ( | const ManagedSurface & | src, |
const Common::Rect & | srcRect, | ||
const Common::Rect & | destRect, | ||
uint32 | transColor = 0 , |
||
bool | flipped = false , |
||
uint32 | overrideColor = 0 , |
||
uint32 | srcAlpha = 0xff , |
||
const Surface * | mask = nullptr , |
||
bool | maskOnly = false |
||
) |
Copy another surface into this one, ignoring pixels of a designated transparent color.
src | Source surface. |
srcRect | Subsection of the source surface to draw. |
destRect | Destination area to draw the surface in. This can be sized differently then srcRect , allowing for arbitrary scaling of the image. |
transColor | Transparency color to ignore copying of. |
flipped | Whether to horizontally flip the image. |
overrideColor | Optional color to use instead of non-transparent pixels from the source surface. |
srcAlpha | Optional additional transparency applied to src . |
mask | Optional parameter with mask definition. |
maskOnly | Optional parameter for using mask over transColor . |
|
inline |
Does a blitFrom ignoring any transparency settings
|
inlinestatic |
ManagedSurface::blendBlitTo is meant to be a highly optimized blending/blitting function, so it can only accept certain format combinations.
Common::Rect Graphics::ManagedSurface::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.
target | renders this surface onto this one |
src | source surface |
posX,posY | are the position of the src onto this surface |
flipping | flipping flags (use Graphics::FLIP_FLAGS) |
srcRect | source clipping |
width | width of destination |
height | height of destination |
colorMod | what color to multiply by (0xffffffff does nothing) |
blend | the blending mode to use. |
alphaType | what alpha mode to use. FULL is default |
void Graphics::ManagedSurface::clear | ( | uint32 | color = 0 | ) |
Clear the entire surface.
void Graphics::ManagedSurface::markAllDirty | ( | ) |
Mark the entire surface as dirty.
|
inline |
Copy a bitmap to the internal buffer of the surface.
The pixel format of the buffer must match the pixel format of the surface.
|
inline |
Copy a bitmap to the internal buffer of the surface.
The pixel format of the buffer must match the pixel format of the surface.
|
inline |
Copy a bitmap to the internal buffer of the surface.
The pixel format of the buffer must match the pixel format of the surface.
|
inline |
Copy a bitmap to the internal buffer of the surface.
The pixel format of the buffer must match the pixel format of the surface.
void Graphics::ManagedSurface::copyFrom | ( | const ManagedSurface & | surf | ) |
Copy the data from another surface, reinitializing the surface to match the dimensions of the passed surface.
void Graphics::ManagedSurface::copyFrom | ( | const Surface & | surf | ) |
Copy the data from another surface, reinitializing the surface to match the dimensions of the passed surface.
void Graphics::ManagedSurface::convertFrom | ( | const ManagedSurface & | surf, |
const PixelFormat & | fmt | ||
) |
Convert the data from another surface to a given pixel format, reinitializing the surface to match the dimensions of the passed surface.
void Graphics::ManagedSurface::convertFrom | ( | const Surface & | surf, |
const PixelFormat & | fmt | ||
) |
Convert the data from another surface to a given pixel format, reinitializing the surface to match the dimensions of the passed surface.
ManagedSurface* Graphics::ManagedSurface::scale | ( | int16 | newWidth, |
int16 | newHeight, | ||
bool | filtering = false |
||
) | const |
Scale the data to the given size.
newWidth | The resulting width. |
newHeight | The resulting height. |
filtering | Whether or not to use bilinear filtering. |
ManagedSurface* Graphics::ManagedSurface::rotoscale | ( | const TransformStruct & | transform, |
bool | filtering = false |
||
) | const |
Rotoscale function; this returns a transformed version of this surface after rotation and scaling. Please do not use this if angle == 0, use plain old scaling function.
transform | a TransformStruct wrapping the required info. |
filtering | Whether or not to use bilinear filtering. |
|
inline |
Draw a line.
|
inline |
Draw a thick line.
|
inline |
Draw a horizontal line.
|
inline |
Draw a vertical line.
|
inline |
Fill a rect with a given color.
|
inline |
Draw a frame around a specified rect.
|
inline |
Checks if the given surface contains alpha transparency
|
inline |
Return a sub-area of the screen, but only add a single initial dirty rect for the retrieved area.
|
inline |
Convert the data to another pixel format.
This works in-place. This means it does not create an additional buffer for the conversion process. The value of 'pixels' might change though (that means it might realloc the pixel data).
dstFormat | The desired format. |
|
inline |
Convert the data to another pixel format.
This works in-place. This means it does not create an additional buffer for the conversion process. The value of 'pixels' might change though (that means it might realloc the pixel data).
dstFormat | The desired format. |
palette | The palette (in RGB888), if the source format has one. |
paletteCount | The number of colors in the palette. |
|
inline |
Return the current transparent color.
|
inline |
Set the transparent color.
|
inline |
Clear the transparent color setting.
|
inline |
Return true if a transparent color has been set.
void Graphics::ManagedSurface::clearPalette | ( | ) |
Clear any existing palette.
bool Graphics::ManagedSurface::hasPalette | ( | ) | const |
Return true if a palette has been set.
void Graphics::ManagedSurface::grabPalette | ( | byte * | colors, |
uint | start, | ||
uint | num | ||
) | const |
Grab the palette using RGB tuples.
void Graphics::ManagedSurface::setPalette | ( | const byte * | colors, |
uint | start, | ||
uint | num | ||
) |
Set the palette using RGB tuples.
int16& Graphics::ManagedSurface::w |
Width of the surface rectangle.
int16& Graphics::ManagedSurface::h |
Height of the surface rectangle.
int32& Graphics::ManagedSurface::pitch |
Pitch of the surface rectangle. See Surface::pitch.
PixelFormat& Graphics::ManagedSurface::format |
Pixel format of the surface. See PixelFormat.