Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: GraphicsAccelerator.h

Class TGopAlphaBlendTwoBitmaps

class TGopAlphaBlendTwoBitmaps : public TGraphicsOperation;

Description

An accelerated graphics operation that copies a rectangular region of two bitmaps to a destination, using alpha blending values provided in a third bitmap to blend the corresponding entries in the first and second bitmaps.

The way alpha blending works is as follows: if the alpha value is the maximum, the pixel from the first source is opaque, in other words, the full colour of the pixel is written to the destination. If the alpha value is zero, the pixel from the first source is fully transparent, in other words, the full colour of the pixel in the second source is used. Values in-between cause blending with the following formula:

Destination = Source1*Alpha/max_Alpha + Source2*(max_Alpha-Alpha)/max_Alpha

Colour alpha bitmaps specify red, green and blue alpha values for each pixel, greyscale bitmaps specify a single alpha value for each pixel. The maximum alpha value depends on the bitmap's display mode. For example, 255 is the maximum for an EGray256 or EColor16M bitmap. The maximum is less for bitmaps which use fewer bits per colour component.

Supported bitmap formats than can be used as alpha bitmaps are given in TGraphicsAcceleratorCaps::iAlphaBitmap.

Objects of this class can be passed to a graphics accelerator's Operation() function either individually, or in a buffer.

Derivation

Members

Defined in TGopAlphaBlendTwoBitmaps:
TGopAlphaBlendTwoBitmaps(), iAlphaBmp, iAlphaPt, iDestination, iSourceBmp1, iSourceBmp2, iSourceRect, iSrcPt2

Inherited from TGraphicsOperation:
Append(), EAlphaBlendOneBitmap, EAlphaBlendTwoBitmaps, EBitBlt, EBitBltAlphaBitmap, EBitBltAlphaChannel, EBitBltMasked, EBitBltTransparent, EFadeRect, EFilledPolygon, EFilledPolygonWithPattern, EFilledRect, EFilledRectUsingDrawMode, EFilledRectWithPattern, EInvertRect, EScaledBitBlt, EScaledBitBltAlphaBitmap, EScaledBitBltAlphaChannel, EScaledBitBltMasked, EScaledBitBltTransparent, Function(), Next(), Size(), TGopFunction, iFunction, iSize

See also:


Construction and destruction


TGopAlphaBlendTwoBitmaps()

inline TGopAlphaBlendTwoBitmaps(const TPoint &aDestination, TAcceleratedBitmapSpec aSourceBmp1, TAcceleratedBitmapSpec aSourceBmp2, TRect &aSourceRect, const TPoint &aSrcPt2, TAcceleratedBitmapSpec aAlphaBmp, const TPoint &aAlphaPt);

Description

Constructor with a position, three bitmap specs and a rectangle.

Parameters

const TPoint &aDestination

The destination for the top left hand corner of the portion of the source bitmaps.

TAcceleratedBitmapSpec aSourceBmp1

A handle to the first of the source bitmaps, and other information needed to draw it.

TAcceleratedBitmapSpec aSourceBmp2

A handle to the second of the source bitmaps, and other information needed to draw it.

TRect &aSourceRect

A rectangle within the source bitmaps. Its coordinates are relative to the top left of the bitmap. Defines the part of the bitmap to be copied.

const TPoint &aSrcPt2

TAcceleratedBitmapSpec aAlphaBmp

const TPoint &aAlphaPt

The point in the alpha bitmap from which we take pixels to blend

[Top]


Member data


iDestination

TPoint iDestination;

Description

The destination for the top left hand corner of the portion of the source bitmaps.


iSourceBmp1

TAcceleratedBitmapSpec iSourceBmp1;

Description

A handle to the first source bitmap, and other information needed to access it.


iSourceBmp2

TAcceleratedBitmapSpec iSourceBmp2;

Description

A handle to the second source bitmap, and other information needed to access it.


iSourceRect

TRect iSourceRect;

Description

A rectangle defining the part of the source bitmaps to be copied.


iSrcPt2

TPoint iSrcPt2;

Description

The point in the second source bitmap from which we take pixels to blend.


iAlphaBmp

TAcceleratedBitmapSpec iAlphaBmp;

Description

A handle to the alpha bitmap, the bitmap that contains alpha blending values.


iAlphaPt

TPoint iAlphaPt;

Description

The point in the alpha bitmap from which we take pixels to blend.