ScummVM API documentation
Graphics::BlendBlit Class Reference

Static Public Member Functions

static int getScaleFactor (int srcSize, int dstSize)
 
static PixelFormat getSupportedPixelFormat ()
 
static void blit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const int posX, const int posY, const uint width, const uint height, const int scaleX, const int scaleY, const int scaleXsrcOff, const int scaleYsrcOff, const uint32 colorMod, const uint flipping, const TSpriteBlendMode blendMode, const AlphaType alphaType)
 

Static Public Attributes

static const int SCALE_THRESHOLD = 0x100
 
static const int kBModShift = 8
 
static const int kGModShift = 16
 
static const int kRModShift = 24
 
static const int kAModShift = 0
 
static const uint32 kBModMask = 0x0000ff00
 
static const uint32 kGModMask = 0x00ff0000
 
static const uint32 kRModMask = 0xff000000
 
static const uint32 kAModMask = 0x000000ff
 
static const uint32 kRGBModMask = (kRModMask | kGModMask | kBModMask)
 
static const int kAIndex = 0
 
static const int kBIndex = 1
 
static const int kGIndex = 2
 
static const int kRIndex = 3
 

Member Function Documentation

◆ getSupportedPixelFormat()

static PixelFormat Graphics::BlendBlit::getSupportedPixelFormat ( )
inlinestatic

Returns the pixel format all operations of BlendBlit::blit support.

Use MS_ARGB and MS_RGB to quickly make a color in this format. MS_ARGB/RGB are found in graphics/transform_struct.h

Returns
Supported pixel format.

◆ blit()

static void Graphics::BlendBlit::blit ( byte *  dst,
const byte *  src,
const uint  dstPitch,
const uint  srcPitch,
const int  posX,
const int  posY,
const uint  width,
const uint  height,
const int  scaleX,
const int  scaleY,
const int  scaleXsrcOff,
const int  scaleYsrcOff,
const uint32  colorMod,
const uint  flipping,
const TSpriteBlendMode  blendMode,
const AlphaType  alphaType 
)
static

Optimized version of doBlit to be used with alpha blended blitting NOTE: Can only be used with BlendBlit::getSupportedPixelFormat format

Parameters
dsta pointer to the destination buffer (can be offseted by pixels)
srca pointer to the source buffer (can be offseted by pixels)
dstPitchdestination pitch
srcPitchsource pitch
posXwhere src will be blitted to (onto dest)
posYwhere src will be blitted to (onto dest)
widthwidth of the input surface
heightheight of the input surface
scaleXscale factor to use when blitting (src / dst) (0.5 for 2x scale) use BlendBlit::SCALE_THRESHOLD
scaleYscale factor to use when blitting (src / dst) (0.5 for 2x scale) use BlendBlit::SCALE_THRESHOLD
scaleXsrcOffsince you can only offset the *src pointer to effectivly get a different part of the source image rendered, it can only go in 1 pixel chunks, so this fixes that by added a little offset
scaleYsrcOffsame as the X one
colorModthe color to multiply by. (0xffffffff does no multiplication and has 0 overhead usually)
flippingflipping flags used with Graphics::FLIP_FLAGS
blendModethe blending mode to be used
alphaTypethe alpha mixing mode to be used

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