ScummVM API documentation
Blitting

Description

Graphics blitting operations.

Classes

class  Graphics::BlendBlit
 

Functions

void Graphics::copyBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const uint bytesPerPixel)
 
bool Graphics::keyBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const uint bytesPerPixel, const uint32 key)
 
bool Graphics::maskBlit (byte *dst, const byte *src, const byte *mask, const uint dstPitch, const uint srcPitch, const uint maskPitch, const uint w, const uint h, const uint bytesPerPixel)
 
bool Graphics::crossBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt)
 
bool Graphics::crossKeyBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt, const uint32 key)
 
bool Graphics::crossMaskBlit (byte *dst, const byte *src, const byte *mask, const uint dstPitch, const uint srcPitch, const uint maskPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt)
 
bool Graphics::crossBlitMap (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const uint bytesPerPixel, const uint32 *map)
 
bool Graphics::crossKeyBlitMap (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const uint bytesPerPixel, const uint32 *map, const uint32 key)
 
bool Graphics::crossMaskBlitMap (byte *dst, const byte *src, const byte *mask, const uint dstPitch, const uint srcPitch, const uint maskPitch, const uint w, const uint h, const uint bytesPerPixel, const uint32 *map)
 
bool Graphics::scaleBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint dstW, const uint dstH, const uint srcW, const uint srcH, const Graphics::PixelFormat &fmt, const byte flip=0)
 
bool Graphics::scaleBlitBilinear (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint dstW, const uint dstH, const uint srcW, const uint srcH, const Graphics::PixelFormat &fmt, const byte flip=0)
 
bool Graphics::rotoscaleBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint dstW, const uint dstH, const uint srcW, const uint srcH, const Graphics::PixelFormat &fmt, const TransformStruct &transform, const Common::Point &newHotspot)
 
bool Graphics::rotoscaleBlitBilinear (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint dstW, const uint dstH, const uint srcW, const uint srcH, const Graphics::PixelFormat &fmt, const TransformStruct &transform, const Common::Point &newHotspot)
 
bool Graphics::applyColorKey (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &format, const bool overwriteAlpha, const uint8 rKey, const uint8 gKey, const uint8 bKey, const uint8 rNew, const uint8 gNew, const uint8 bNew)
 
bool Graphics::setAlpha (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &format, const bool skipTransparent, const uint8 alpha)
 

Function Documentation

◆ copyBlit()

void Graphics::copyBlit ( byte *  dst,
const byte *  src,
const uint  dstPitch,
const uint  srcPitch,
const uint  w,
const uint  h,
const uint  bytesPerPixel 
)

Blits a rectangle.

Parameters
dstthe buffer which will receive the converted graphics data
srcthe buffer containing the original graphics data
dstPitchwidth in bytes of one full line of the dest buffer
srcPitchwidth in bytes of one full line of the source buffer
wthe width of the graphics data
hthe height of the graphics data
bytesPerPixelthe number of bytes per pixel

◆ keyBlit()

bool Graphics::keyBlit ( byte *  dst,
const byte *  src,
const uint  dstPitch,
const uint  srcPitch,
const uint  w,
const uint  h,
const uint  bytesPerPixel,
const uint32  key 
)

Blits a rectangle with a transparent color key.

Parameters
dstthe buffer which will receive the converted graphics data
srcthe buffer containing the original graphics data
dstPitchwidth in bytes of one full line of the dest buffer
srcPitchwidth in bytes of one full line of the source buffer
wthe width of the graphics data
hthe height of the graphics data
bytesPerPixelthe number of bytes per pixel
keythe transparent color key

◆ maskBlit()

bool Graphics::maskBlit ( byte *  dst,
const byte *  src,
const byte *  mask,
const uint  dstPitch,
const uint  srcPitch,
const uint  maskPitch,
const uint  w,
const uint  h,
const uint  bytesPerPixel 
)

Blits a rectangle with a transparent color mask.

A mask is a separate CLUT8 surface where for each pixel in the mask, 0 means the corresponding pixel in the source is transparent, while a non-zero value means that the corresponding pixel is opaque.

Parameters
dstthe buffer which will receive the converted graphics data
srcthe buffer containing the original graphics data
maskthe buffer containing the mask
dstPitchwidth in bytes of one full line of the dest buffer
srcPitchwidth in bytes of one full line of the source buffer
maskPitchwidth in bytes of one full line of the mask buffer
wthe width of the graphics data
hthe height of the graphics data
bytesPerPixelthe number of bytes per pixel

◆ crossBlit()

bool Graphics::crossBlit ( byte *  dst,
const byte *  src,
const uint  dstPitch,
const uint  srcPitch,
const uint  w,
const uint  h,
const Graphics::PixelFormat dstFmt,
const Graphics::PixelFormat srcFmt 
)

Blits a rectangle from one graphical format to another.

Parameters
dstthe buffer which will receive the converted graphics data
srcthe buffer containing the original graphics data
dstPitchwidth in bytes of one full line of the dest buffer
srcPitchwidth in bytes of one full line of the source buffer
wthe width of the graphics data
hthe height of the graphics data
dstFmtthe desired pixel format
srcFmtthe original pixel format
Returns
true if conversion completes successfully, false if there is an error.
Note
This can convert a surface in place, regardless of the source and destination format, as long as there is enough space for the destination. The dstPitch / srcPitch ratio must at least equal the dstBpp / srcBpp ratio for dstPitch >= srcPitch and at most dstBpp / srcBpp for dstPitch < srcPitch though.

◆ crossKeyBlit()

bool Graphics::crossKeyBlit ( byte *  dst,
const byte *  src,
const uint  dstPitch,
const uint  srcPitch,
const uint  w,
const uint  h,
const Graphics::PixelFormat dstFmt,
const Graphics::PixelFormat srcFmt,
const uint32  key 
)

Blits a rectangle from one graphical format to another with a transparent color key.

Parameters
dstthe buffer which will receive the converted graphics data
srcthe buffer containing the original graphics data
dstPitchwidth in bytes of one full line of the dest buffer
srcPitchwidth in bytes of one full line of the source buffer
wthe width of the graphics data
hthe height of the graphics data
dstFmtthe desired pixel format
srcFmtthe original pixel format
keythe transparent color key in the original pixel format
Returns
true if conversion completes successfully, false if there is an error.
Note
This can convert a surface in place, regardless of the source and destination format, as long as there is enough space for the destination. The dstPitch / srcPitch ratio must at least equal the dstBpp / srcBpp ratio for dstPitch >= srcPitch and at most dstBpp / srcBpp for dstPitch < srcPitch though.

◆ crossMaskBlit()

bool Graphics::crossMaskBlit ( byte *  dst,
const byte *  src,
const byte *  mask,
const uint  dstPitch,
const uint  srcPitch,
const uint  maskPitch,
const uint  w,
const uint  h,
const Graphics::PixelFormat dstFmt,
const Graphics::PixelFormat srcFmt 
)

Blits a rectangle from one graphical format to another with a transparent color mask.

A mask is a separate CLUT8 surface where for each pixel in the mask, 0 means the corresponding pixel in the source is transparent, while a non-zero value means that the corresponding pixel is opaque.

Parameters
dstthe buffer which will receive the converted graphics data
srcthe buffer containing the original graphics data
maskthe buffer containing the mask
dstPitchwidth in bytes of one full line of the dest buffer
srcPitchwidth in bytes of one full line of the source buffer
maskPitchwidth in bytes of one full line of the mask buffer
wthe width of the graphics data
hthe height of the graphics data
dstFmtthe desired pixel format
srcFmtthe original pixel format
Returns
true if conversion completes successfully, false if there is an error.
Note
This can convert a surface in place, regardless of the source and destination format, as long as there is enough space for the destination. The dstPitch / srcPitch ratio must at least equal the dstBpp / srcBpp ratio for dstPitch >= srcPitch and at most dstBpp / srcBpp for dstPitch < srcPitch though.