MAlphaBlend Class Reference

class MAlphaBlend

MAlphaBlend interface provides only one method, which does an alpha blending using the supplied as arguments source and mask bitmap scanline data and writes the result to the screen. The content of the source and mask bitmap scanlines is preserved.

Member Functions Documentation

WriteRgbAlphaLine(TInt, TInt, TInt, const TUint8 *, const TUint8 *, TShadowing, CGraphicsContext::TDrawMode)

void WriteRgbAlphaLine ( TInt aX,
TInt aY,
TInt aLength,
const TUint8 * aRgbBuffer,
const TUint8 * aMaskBuffer,
TShadowing aShadowing,
CGraphicsContext::TDrawMode aDrawMode
) [pure virtual]
The method performs an alpha blending of the source data - aRgbBuffer and the screen pixels, using the data from aMaskBuffer buffer as an alpha blending factor. The formula used for that, is: (C1 * A + C2 * (255 - A)) / 255, where:
  • C1 - a pixel from aRgbBuffer1;

  • C2 - a pixel from screen;

  • A - a pixel from aMaskBuffer; The content of source and mask buffers is preserved. The calculated alpha blended pixel is written to the destination - the screen or a bitmap.

Parameters

TInt aX Logical X coordinate of the position in the target the result should be drawn to.
TInt aY Logical Y coordinate of the position in the target the result should be drawn to.
TInt aLength Source data - length in pixels.
const TUint8 * aRgbBuffer A pointer to a line of the source bitmap data.
const TUint8 * aMaskBuffer Buffer containing the data which should be used as an alpha blending factor.
TShadowing aShadowing It says when the shadowing/fading has to be done - before or after the alpha blending transformation. Before: A shadow/fade copy of the source bitmap will be used. After: The result pixels will be shadowed/faded.
CGraphicsContext::TDrawMode aDrawMode The mode for rendering the source image to the destination.

Member Enumerations Documentation

Enum TShadowing

TShadowing enum values are used in alpha blending implementations to specify when the shadowing/fading has to be done: before or after tha alpha blending.

Enumerators

EShdwBefore
EShdwAfter