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.

Public Member Functions
voidWriteRgbAlphaLine(TInt, TInt, TInt, const TUint8 *, const TUint8 *, TShadowing, CGraphicsContext::TDrawMode)
Public Member Enumerations
enumTShadowing { EShdwBefore, EShdwAfter }

Member Functions Documentation

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

voidWriteRgbAlphaLine(TIntaX,
TIntaY,
TIntaLength,
const TUint8 *aRgbBuffer,
const TUint8 *aMaskBuffer,
TShadowingaShadowing,
CGraphicsContext::TDrawModeaDrawMode
)[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 aXLogical X coordinate of the position in the target the result should be drawn to.
TInt aYLogical Y coordinate of the position in the target the result should be drawn to.
TInt aLengthSource data - length in pixels.
const TUint8 * aRgbBufferA pointer to a line of the source bitmap data.
const TUint8 * aMaskBufferBuffer containing the data which should be used as an alpha blending factor.
TShadowing aShadowingIt 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 aDrawModeThe 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