CNvgEngine Class Reference

class CNvgEngine : public CBase

Inherits from

Public Member Functions
~CNvgEngine ()
IMPORT_C TSize ContentDimensions (const TDesC8 &)
IMPORT_C MNVGIcon * CreateNVGIcon (const TDesC8 &, const TSize &)
IMPORT_C TInt DrawNvg (const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)
IMPORT_C CNvgEngine * NewL ()
TInt OpenVGErrorToSymbianError ( TInt )
IMPORT_C void ResetNvgState ()
IMPORT_C void Rotate ( TReal32 , TReal32 , TReal32 )
IMPORT_C void SetBackgroundColor ( TUint32 )
IMPORT_C void SetPreserveAspectRatio ( TNvgAlignStatusType , TNvgMeetOrSliceType )
void SetVGImageBinder ( MVGImageBinder *)
Private Member Functions
CNvgEngine ()
void ApplyRotation ()
void ApplyScissoring ( VGfloat , const TSize &)
void ApplyViewboxToViewPortTransformationL (const TSize &, TReal32 , TReal32 , TReal32 , TReal32 )
void ClearBackground ()
void ConstructL ()
TInt CreatePathHandle ( TInt16 , TReal32 , TReal32 )
void DoDrawNVGL (const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)
TInt DrawCommandSectionL ( TDereferencer *, const TSize &, CFbsBitmap *, CFbsBitmap *)
void DrawPathL ( TDereferencer *)
TInt DrawTLVL (const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)
void ExecuteNVGCSCommandLoopL ( TUint16 , TDereferencer *, TDereferencer *, TDereferencer *, TInt )
void GenerateMask ( CFbsBitmap *)
TPoint GetTranslatedPoint ( VGfloat , TPoint )
TInt InitializeGC ()
TBool IsIdentity ( VGfloat )
VGfloat MaxVal4 ( VGfloat , VGfloat , VGfloat , VGfloat )
VGfloat MinVal4 ( VGfloat , VGfloat , VGfloat , VGfloat )
void RestoreClientMatrices ()
TInt SetColorRampL ( TDereferencer *)
TInt SetFillPaintL ( TDereferencer *)
void SetStrokeMiterLimit (const TUint8 *)
void SetStrokePaintL ( TDereferencer *)
void SetStrokeWidth (const TUint8 *)
void SetTransformL ( TDereferencer *, TUint32 &, const VGfloat *)
void UpdateClientMatrices ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TUint32 iBackgroundColor
TReal32 iCentreX
TReal32 iCentreY
VGfloat * iColorRamps
TSize iCurrentBufferSize
CFbsBitmap * iDstBimtap
TInt iFillAlpha
TReal32 iFillPaintMatrix
CNvgFitToViewBoxImpl * iFitToViewBoxImpl
VGPaint iGradPaintFill
VGPaint iGradPaintStroke
TReal32 iImageMatrix
TNVGEngineInternal * iInternal
TInt16 iLastPathDataType
VGint iMatrixMode
VGPaint iPaintFill
VGPaint iPaintStroke
VGPath iPath
TReal32 iPathMatrix
TNvgAlignStatusType iPreserveAspectSetting
VGfloat iRotateAngle
TBool iRotateApplied
TNvgMeetOrSliceType iSmilFitSetting
TInt iStrokeAlpha
TReal32 iStrokePaintMatrix
VGPaint iUserStrokePaint
TUint32 iUserStrokePaintColor
MVGImageBinder * iVGImageBinder
VGboolean idoFill
VGboolean idoStroke

Constructor & Destructor Documentation

CNvgEngine()

CNvgEngine ( ) [private]

Constructor

~CNvgEngine()

IMPORT_C ~CNvgEngine ( )

Destructor

Member Functions Documentation

ApplyRotation()

void ApplyRotation ( ) [private]

Applies the rotation

ApplyScissoring(VGfloat, const TSize &)

void ApplyScissoring ( VGfloat aMatrix,
const TSize & aTargetSize
) [private]

Applies the scissoring

Parameters

VGfloat aMatrix
const TSize & aTargetSize

ApplyViewboxToViewPortTransformationL(const TSize &, TReal32, TReal32, TReal32, TReal32)

void ApplyViewboxToViewPortTransformationL ( const TSize & aTargetSize,
TReal32 aViewboxX,
TReal32 aViewboxY,
TReal32 aViewboxW,
TReal32 aViewboxH
) [private]

Applies viewbox to viewport transformation

Parameters

const TSize & aTargetSize
TReal32 aViewboxX
TReal32 aViewboxY
TReal32 aViewboxW
TReal32 aViewboxH

ClearBackground()

void ClearBackground ( ) [private]

To clear the background of the target

ConstructL()

void ConstructL ( ) [private]

Constructor

ContentDimensions(const TDesC8 &)

IMPORT_C TSize ContentDimensions ( const TDesC8 & aBuf )
Version
Version

Parameters

const TDesC8 & aBuf NVG byte data of the file

CreateNVGIcon(const TDesC8 &, const TSize &)

IMPORT_C MNVGIcon * CreateNVGIcon ( const TDesC8 & aBuf,
const TSize & aSize
)

Parameters

const TDesC8 & aBuf byte data of NVG file aSize Size in pixels of the target
const TSize & aSize

CreatePathHandle(TInt16, TReal32, TReal32)

TInt CreatePathHandle ( TInt16 aPathDataType,
TReal32 aScale,
TReal32 aBias
) [private]

Create the path handle

Parameters

TInt16 aPathDataType
TReal32 aScale
TReal32 aBias

DoDrawNVGL(const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)

void DoDrawNVGL ( const TDesC8 & aBuf,
const TSize & aSize,
CFbsBitmap * aDstBitmap,
CFbsBitmap * aMask
) [private]

Draws the nvg icon

Parameters

const TDesC8 & aBuf
const TSize & aSize
CFbsBitmap * aDstBitmap
CFbsBitmap * aMask

DrawCommandSectionL(TDereferencer *, const TSize &, CFbsBitmap *, CFbsBitmap *)

TInt DrawCommandSectionL ( TDereferencer * aIconData,
const TSize & aTargetSize,
CFbsBitmap * aDstBitmap,
CFbsBitmap * aMask
) [private]

Draws the nvg-cs icon

Parameters

TDereferencer * aIconData
const TSize & aTargetSize
CFbsBitmap * aDstBitmap
CFbsBitmap * aMask

DrawNvg(const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)

IMPORT_C TInt DrawNvg ( const TDesC8 & aBuf,
const TSize & aSize,
CFbsBitmap * aDstBitmap,
CFbsBitmap * aMask
)
Version

Parameters

const TDesC8 & aBuf byte data of NVG file aSize Size in pixels of the target aDstBitmap Target bitmap aMask Target mask
const TSize & aSize
CFbsBitmap * aDstBitmap
CFbsBitmap * aMask

DrawPathL(TDereferencer *)

void DrawPathL ( TDereferencer * aIconData ) [private]

Call vgDrawPath in OpenVG

Parameters

TDereferencer * aIconData

DrawTLVL(const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)

TInt DrawTLVL ( const TDesC8 & aBuf,
const TSize & aTargetSize,
CFbsBitmap * aDstBitmap,
CFbsBitmap * aMask
) [private]

Draws the nvg-tlv icon

Parameters

const TDesC8 & aBuf
const TSize & aTargetSize
CFbsBitmap * aDstBitmap
CFbsBitmap * aMask

ExecuteNVGCSCommandLoopL(TUint16, TDereferencer *, TDereferencer *, TDereferencer *, TInt)

void ExecuteNVGCSCommandLoopL ( TUint16 aCommandCount,
TDereferencer * aIconData,
TDereferencer * aOffsetVector,
TDereferencer * aCommandSection,
TInt aNVGVersion
) [private]

Executes the nvg-cs commands

Parameters

TUint16 aCommandCount
TDereferencer * aIconData
TDereferencer * aOffsetVector
TDereferencer * aCommandSection
TInt aNVGVersion

GenerateMask(CFbsBitmap *)

void GenerateMask ( CFbsBitmap * aMask ) [private]

Generate Mask for modes not supported by custom binding API

Parameters

CFbsBitmap * aMask

GetTranslatedPoint(VGfloat, TPoint)

TPoint GetTranslatedPoint ( VGfloat aTRMatrix,
TPoint aPoint
) [private]

Point transforms according to the given matrix

Parameters

VGfloat aTRMatrix
TPoint aPoint

InitializeGC()

TInt InitializeGC ( ) [private]

Initializes the OpenVg handles

IsIdentity(VGfloat)

TBool IsIdentity ( VGfloat array ) [private]

Checks whether the given matrix is identity

Parameters

VGfloat array

MaxVal4(VGfloat, VGfloat, VGfloat, VGfloat)

VGfloat MaxVal4 ( VGfloat x1,
VGfloat x2,
VGfloat x3,
VGfloat x4
) [private]

Gives the maximum of the given arguments

MinVal4(VGfloat, VGfloat, VGfloat, VGfloat)

VGfloat MinVal4 ( VGfloat x1,
VGfloat x2,
VGfloat x3,
VGfloat x4
) [private]

Gives the minimum of the given arguments

NewL()

IMPORT_C CNvgEngine * NewL ( ) [static]
Version

OpenVGErrorToSymbianError(TInt)

TInt OpenVGErrorToSymbianError ( TInt aError ) [static]

Parameters

TInt aError

ResetNvgState()

IMPORT_C void ResetNvgState ( )
Version

RestoreClientMatrices()

void RestoreClientMatrices ( ) [private]

Restores the callres matrix mode and matricies

Rotate(TReal32, TReal32, TReal32)

IMPORT_C void Rotate ( TReal32 aAngle,
TReal32 aX,
TReal32 aY
)
Version

Parameters

TReal32 aAngle counter-clockwise rotation by a given angle (expressed in degrees) aX, aY point around which the rotation must take place
TReal32 aX
TReal32 aY

SetBackgroundColor(TUint32)

IMPORT_C void SetBackgroundColor ( TUint32 aRGBA8888Color )
Version

Parameters

TUint32 aRGBA8888Color colour in 32 bit RGBA format

SetColorRampL(TDereferencer *)

TInt SetColorRampL ( TDereferencer * aIconData ) [private]

SetColor in OpenVG

Parameters

TDereferencer * aIconData

SetFillPaintL(TDereferencer *)

TInt SetFillPaintL ( TDereferencer * aIconData ) [private]

SetPaint gradient or solid in OpenVG

Parameters

TDereferencer * aIconData

SetPreserveAspectRatio(TNvgAlignStatusType, TNvgMeetOrSliceType)

IMPORT_C void SetPreserveAspectRatio ( TNvgAlignStatusType aPreserveAspectSetting,
TNvgMeetOrSliceType aSmilFitSetting
)
Version

Parameters

TNvgAlignStatusType aPreserveAspectSetting
TNvgMeetOrSliceType aSmilFitSetting

SetStrokeMiterLimit(const TUint8 *)

void SetStrokeMiterLimit ( const TUint8 * aBuf ) [private]

Sets the miter limit

Parameters

const TUint8 * aBuf

SetStrokePaintL(TDereferencer *)

void SetStrokePaintL ( TDereferencer * aIconData ) [private]

Set stroke color in Openvg

Parameters

TDereferencer * aIconData

SetStrokeWidth(const TUint8 *)

void SetStrokeWidth ( const TUint8 * aBuf ) [private]

Sets the stroke Width

Parameters

const TUint8 * aBuf

SetTransformL(TDereferencer *, TUint32 &, const VGfloat *)

void SetTransformL ( TDereferencer * aIconData,
TUint32 & transVal,
const VGfloat * aCurrentMatrix
) [private]

call SetTranslate in OpenVG

Parameters

TDereferencer * aIconData
TUint32 & transVal
const VGfloat * aCurrentMatrix

SetVGImageBinder(MVGImageBinder *)

void SetVGImageBinder ( MVGImageBinder * aImageBinder ) [inline]

Parameters

MVGImageBinder * aImageBinder

UpdateClientMatrices()

void UpdateClientMatrices ( ) [private]

Stores the callres matrix mode and matricies

Member Data Documentation

TUint32 iBackgroundColor

TUint32 iBackgroundColor [private]

TReal32 iCentreX

TReal32 iCentreX [private]

TReal32 iCentreY

TReal32 iCentreY [private]

VGfloat * iColorRamps

VGfloat * iColorRamps [private]

TSize iCurrentBufferSize

TSize iCurrentBufferSize [private]

CFbsBitmap * iDstBimtap

CFbsBitmap * iDstBimtap [private]

TInt iFillAlpha

TInt iFillAlpha [private]

TReal32 iFillPaintMatrix

TReal32 iFillPaintMatrix [private]

CNvgFitToViewBoxImpl * iFitToViewBoxImpl

CNvgFitToViewBoxImpl * iFitToViewBoxImpl [private]

VGPaint iGradPaintFill

VGPaint iGradPaintFill [private]

VGPaint iGradPaintStroke

VGPaint iGradPaintStroke [private]

TReal32 iImageMatrix

TReal32 iImageMatrix [private]

TNVGEngineInternal * iInternal

TNVGEngineInternal * iInternal [private]

This class is added to maintain BC. If you want to add new member variable you can add in this class, without breaking BC. It is better to add members which are depend on macro's in this class.

TInt16 iLastPathDataType

TInt16 iLastPathDataType [private]

VGint iMatrixMode

VGint iMatrixMode [private]

VGPaint iPaintFill

VGPaint iPaintFill [private]

VGPaint iPaintStroke

VGPaint iPaintStroke [private]

VGPath iPath

VGPath iPath [private]

TReal32 iPathMatrix

TReal32 iPathMatrix [private]

TNvgAlignStatusType iPreserveAspectSetting

TNvgAlignStatusType iPreserveAspectSetting [private]

VGfloat iRotateAngle

VGfloat iRotateAngle [private]

TBool iRotateApplied

TBool iRotateApplied [private]

TNvgMeetOrSliceType iSmilFitSetting

TNvgMeetOrSliceType iSmilFitSetting [private]

TInt iStrokeAlpha

TInt iStrokeAlpha [private]

TReal32 iStrokePaintMatrix

TReal32 iStrokePaintMatrix [private]

VGPaint iUserStrokePaint

VGPaint iUserStrokePaint [private]

TUint32 iUserStrokePaintColor

TUint32 iUserStrokePaintColor [private]

MVGImageBinder * iVGImageBinder

MVGImageBinder * iVGImageBinder [private]

VGboolean idoFill

VGboolean idoFill [private]

VGboolean idoStroke

VGboolean idoStroke [private]