ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

A transparent graphics surface, which implements alpha blitting. More...

#include <transparent_surface.h>

Inheritance diagram for Graphics::TransparentSurface:
Collaboration diagram for Graphics::TransparentSurface:

List of all members.

Public Member Functions

 TransparentSurface ()
 TransparentSurface (const Graphics::Surface &surf, bool copyData=false)
void setColorKey (char r, char g, char b)
void disableColorKey ()
Common::Rect blit (Graphics::Surface &target, int posX=0, int posY=0, int flipping=FLIP_NONE, Common::Rect *pPartRect=nullptr, uint color=TS_ARGB(255, 255, 255, 255), int width=-1, int height=-1, TSpriteBlendMode blend=BLEND_NORMAL)
 renders the surface to another surface
Common::Rect blitClip (Graphics::Surface &target, Common::Rect clippingArea, int posX=0, int posY=0, int flipping=FLIP_NONE, Common::Rect *pPartRect=nullptr, uint color=TS_ARGB(255, 255, 255, 255), int width=-1, int height=-1, TSpriteBlendMode blend=BLEND_NORMAL)
void applyColorKey (uint8 r, uint8 g, uint8 b, bool overwriteAlpha=false)
 Writes a color key to the alpha channel of the surface.
template<TFilteringMode filteringMode>
TransparentSurfacescaleT (uint16 newWidth, uint16 newHeight) const
 Scale function; this returns a transformed version of this surface after rotation and scaling.
TransparentSurfacescale (uint16 newWidth, uint16 newHeight) const
template<TFilteringMode filteringMode>
TransparentSurfacerotoscaleT (const TransformStruct &transform) const
 Rotoscale function; this returns a transformed version of this surface after rotation and scaling.
TransparentSurfacerotoscale (const TransformStruct &transform) const
TransparentSurfaceconvertTo (const PixelFormat &dstFormat, const byte *palette=0) const
 Convert the data to another pixel format.
float getRatio ()
AlphaType getAlphaMode () const
void setAlphaMode (AlphaType)

Static Public Member Functions

static PixelFormat getSupportedPixelFormat ()
 Returns the pixel format all operations of TransparentSurface support.

Private Member Functions

template<typename Size >
void scaleNN (int *scaleCacheX, TransparentSurface *target) const

Private Attributes

AlphaType _alphaMode

Detailed Description

A transparent graphics surface, which implements alpha blitting.

Definition at line 79 of file transparent_surface.h.


Constructor & Destructor Documentation

Graphics::TransparentSurface::TransparentSurface (  ) 

Definition at line 67 of file transparent_surface.cpp.

Graphics::TransparentSurface::TransparentSurface ( const Graphics::Surface surf,
bool  copyData = false 
)

Definition at line 69 of file transparent_surface.cpp.


Member Function Documentation

void Graphics::TransparentSurface::applyColorKey ( uint8  rKey,
uint8  gKey,
uint8  bKey,
bool  overwriteAlpha = false 
)

Writes a color key to the alpha channel of the surface.

Parameters:
rKey the red component of the color key
gKey the green component of the color key
bKey the blue component of the color key
overwriteAlpha if true, all other alpha will be set fully opaque

Definition at line 698 of file transparent_surface.cpp.

Common::Rect Graphics::TransparentSurface::blit ( Graphics::Surface target,
int  posX = 0,
int  posY = 0,
int  flipping = FLIP_NONE,
Common::Rect pPartRect = nullptr,
uint  color = TS_ARGB(255, 255, 255, 255),
int  width = -1,
int  height = -1,
TSpriteBlendMode  blend = BLEND_NORMAL 
)

renders the surface to another surface

Parameters:
target a pointer to the target surface. In most cases this is the framebuffer.
posX the position on the X-axis in the target image in pixels where the image is supposed to be rendered.
The default value is 0.
posY the position on the Y-axis in the target image in pixels where the image is supposed to be rendered.
The default value is 0.
flipping how the the image should be flipped.
The default value is Graphics::FLIP_NONE (no flipping)
pPartRect Pointer on Common::Rect which specifies the section to be rendered. If the whole image has to be rendered the Pointer is NULL.
This referes to the unflipped and unscaled image.
The default value is NULL.
color an ARGB color value, which determines the parameters for the color modulation und alpha blending.
The alpha component of the color determines the alpha blending parameter (0 = no covering, 255 = full covering).
The color components determines the color for color modulation.
The default value is TS_ARGB(255, 255, 255, 255) (full covering, no color modulation). The macros TS_RGB and TS_ARGB can be used for the creation of the color value.
width the output width of the screen section. The images will be scaled if the output width of the screen section differs from the image section.
The value -1 determines that the image should not be scaled.
The default value is -1.
height the output height of the screen section. The images will be scaled if the output width of the screen section differs from the image section.
The value -1 determines that the image should not be scaled.
The default value is -1.
Returns:
returns false if the rendering failed.

Definition at line 396 of file transparent_surface.cpp.

Common::Rect Graphics::TransparentSurface::blitClip ( Graphics::Surface target,
Common::Rect  clippingArea,
int  posX = 0,
int  posY = 0,
int  flipping = FLIP_NONE,
Common::Rect pPartRect = nullptr,
uint  color = TS_ARGB(255, 255, 255, 255),
int  width = -1,
int  height = -1,
TSpriteBlendMode  blend = BLEND_NORMAL 
)

Definition at line 544 of file transparent_surface.cpp.

TransparentSurface * Graphics::TransparentSurface::convertTo ( const PixelFormat dstFormat,
const byte palette = 0 
) const

Convert the data to another pixel format.

The calling code must call free on the returned surface and then delete it.

Parameters:
dstFormat The desired format
palette The palette (in RGB888), if the source format has a Bpp of 1

Reimplemented from Graphics::Surface.

Definition at line 1074 of file transparent_surface.cpp.

void Graphics::TransparentSurface::disableColorKey (  ) 
AlphaType Graphics::TransparentSurface::getAlphaMode (  )  const

Definition at line 716 of file transparent_surface.cpp.

float Graphics::TransparentSurface::getRatio (  )  [inline]

Definition at line 168 of file transparent_surface.h.

static PixelFormat Graphics::TransparentSurface::getSupportedPixelFormat (  )  [inline, static]

Returns the pixel format all operations of TransparentSurface support.

Unlike Surface TransparentSurface only works with a fixed pixel format. This format can be queried using this static function.

Returns:
Supported pixel format.

Definition at line 91 of file transparent_surface.h.

TransparentSurface * Graphics::TransparentSurface::rotoscale ( const TransformStruct transform  )  const

Definition at line 1172 of file transparent_surface.cpp.

template<TFilteringMode filteringMode>
template TransparentSurface * Graphics::TransparentSurface::rotoscaleT< FILTER_BILINEAR > ( const TransformStruct transform  )  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.

Parameters:
transform a TransformStruct wrapping the required info.
See also:
TransformStruct

Definition at line 775 of file transparent_surface.cpp.

TransparentSurface * Graphics::TransparentSurface::scale ( uint16  newWidth,
uint16  newHeight 
) const

Definition at line 1176 of file transparent_surface.cpp.

template<typename Size >
template void Graphics::TransparentSurface::scaleNN< uint32 > ( int *  scaleCacheX,
TransparentSurface target 
) const [private]

Definition at line 1153 of file transparent_surface.cpp.

template<TFilteringMode filteringMode>
template TransparentSurface * Graphics::TransparentSurface::scaleT< FILTER_BILINEAR > ( uint16  newWidth,
uint16  newHeight 
) const

Scale function; this returns a transformed version of this surface after rotation and scaling.

Please do not use this if angle != 0, use rotoscale.

Parameters:
newWidth the resulting width.
newHeight the resulting height.
See also:
TransformStruct

Definition at line 890 of file transparent_surface.cpp.

void Graphics::TransparentSurface::setAlphaMode ( AlphaType  mode  ) 

Definition at line 720 of file transparent_surface.cpp.

void Graphics::TransparentSurface::setColorKey ( char  r,
char  g,
char  b 
)

Member Data Documentation


The documentation for this struct was generated from the following files:


Generated on Sat Jan 12 2019 05:04:21 for ResidualVM by doxygen 1.7.1
curved edge   curved edge