CNvgEngine Class Reference

class CNvgEngine : public CBase

Inherits from

Public Member Functions
~CNvgEngine()
IMPORT_C TSizeContentDimensions(const TDesC8 &)
IMPORT_C MNVGIcon *CreateNVGIcon(const TDesC8 &, const TSize &)
IMPORT_C TIntDrawNvg(const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)
IMPORT_C CNvgEngine *NewL()
TInt OpenVGErrorToSymbianError(TInt)
IMPORT_C voidResetNvgState()
IMPORT_C voidRotate(TReal32, TReal32, TReal32)
IMPORT_C voidSetBackgroundColor(TUint32)
IMPORT_C voidSetPreserveAspectRatio(TNvgAlignStatusType, TNvgMeetOrSliceType)
voidSetVGImageBinder(MVGImageBinder *)
Private Member Functions
CNvgEngine()
voidApplyRotation()
voidApplyScissoring(VGfloat, const TSize &)
voidApplyViewboxToViewPortTransformationL(const TSize &, TReal32, TReal32, TReal32, TReal32)
voidClearBackground()
voidConstructL()
TInt CreatePathHandle(TInt16, TReal32, TReal32)
voidDoDrawNVGL(const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)
TInt DrawCommandSectionL(TDereferencer *, const TSize &, CFbsBitmap *, CFbsBitmap *)
voidDrawPathL(TDereferencer *)
TInt DrawTLVL(const TDesC8 &, const TSize &, CFbsBitmap *, CFbsBitmap *)
voidExecuteNVGCSCommandLoopL(TUint16, TDereferencer *, TDereferencer *, TDereferencer *, TInt)
voidGenerateMask(CFbsBitmap *)
TPoint GetTranslatedPoint(VGfloat, TPoint)
TInt InitializeGC()
TBool IsIdentity(VGfloat)
VGfloat MaxVal4(VGfloat, VGfloat, VGfloat, VGfloat)
VGfloat MinVal4(VGfloat, VGfloat, VGfloat, VGfloat)
voidRestoreClientMatrices()
TInt SetColorRampL(TDereferencer *)
TInt SetFillPaintL(TDereferencer *)
voidSetStrokeMiterLimit(const TUint8 *)
voidSetStrokePaintL(TDereferencer *)
voidSetStrokeWidth(const TUint8 *)
voidSetTransformL(TDereferencer *, TUint32 &, const VGfloat *)
voidUpdateClientMatrices()
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()

voidApplyRotation()[private]

Applies the rotation

ApplyScissoring(VGfloat, const TSize &)

voidApplyScissoring(VGfloataMatrix,
const TSize &aTargetSize
)[private]

Applies the scissoring

Parameters

VGfloat aMatrix
const TSize & aTargetSize

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

voidApplyViewboxToViewPortTransformationL(const TSize &aTargetSize,
TReal32aViewboxX,
TReal32aViewboxY,
TReal32aViewboxW,
TReal32aViewboxH
)[private]

Applies viewbox to viewport transformation

Parameters

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

ClearBackground()

voidClearBackground()[private]

To clear the background of the target

ConstructL()

voidConstructL()[private]

Constructor

ContentDimensions(const TDesC8 &)

IMPORT_C TSizeContentDimensions(const TDesC8 &aBuf)
Version
Version

Parameters

const TDesC8 & aBufNVG byte data of the file

CreateNVGIcon(const TDesC8 &, const TSize &)

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

Parameters

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

CreatePathHandle(TInt16, TReal32, TReal32)

TInt CreatePathHandle(TInt16aPathDataType,
TReal32aScale,
TReal32aBias
)[private]

Create the path handle

Parameters

TInt16 aPathDataType
TReal32 aScale
TReal32 aBias

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

voidDoDrawNVGL(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 TIntDrawNvg(const TDesC8 &aBuf,
const TSize &aSize,
CFbsBitmap *aDstBitmap,
CFbsBitmap *aMask
)
Version

Parameters

const TDesC8 & aBufbyte 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 *)

voidDrawPathL(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)

voidExecuteNVGCSCommandLoopL(TUint16aCommandCount,
TDereferencer *aIconData,
TDereferencer *aOffsetVector,
TDereferencer *aCommandSection,
TIntaNVGVersion
)[private]

Executes the nvg-cs commands

Parameters

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

GenerateMask(CFbsBitmap *)

voidGenerateMask(CFbsBitmap *aMask)[private]

Generate Mask for modes not supported by custom binding API

Parameters

CFbsBitmap * aMask

GetTranslatedPoint(VGfloat, TPoint)

TPoint GetTranslatedPoint(VGfloataTRMatrix,
TPointaPoint
)[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(VGfloatarray)[private]

Checks whether the given matrix is identity

Parameters

VGfloat array

MaxVal4(VGfloat, VGfloat, VGfloat, VGfloat)

VGfloat MaxVal4(VGfloatx1,
VGfloatx2,
VGfloatx3,
VGfloatx4
)[private]

Gives the maximum of the given arguments

Parameters

VGfloat x1
VGfloat x2
VGfloat x3
VGfloat x4

MinVal4(VGfloat, VGfloat, VGfloat, VGfloat)

VGfloat MinVal4(VGfloatx1,
VGfloatx2,
VGfloatx3,
VGfloatx4
)[private]

Gives the minimum of the given arguments

Parameters

VGfloat x1
VGfloat x2
VGfloat x3
VGfloat x4

NewL()

IMPORT_C CNvgEngine *NewL()[static]
Version

OpenVGErrorToSymbianError(TInt)

TInt OpenVGErrorToSymbianError(TIntaError)[static]

Parameters

TInt aError

ResetNvgState()

IMPORT_C voidResetNvgState()
Version

RestoreClientMatrices()

voidRestoreClientMatrices()[private]

Restores the callres matrix mode and matricies

Rotate(TReal32, TReal32, TReal32)

IMPORT_C voidRotate(TReal32aAngle,
TReal32aX,
TReal32aY
)
Version

Parameters

TReal32 aAnglecounter-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 voidSetBackgroundColor(TUint32aRGBA8888Color)
Version

Parameters

TUint32 aRGBA8888Colorcolour 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 voidSetPreserveAspectRatio(TNvgAlignStatusTypeaPreserveAspectSetting,
TNvgMeetOrSliceTypeaSmilFitSetting
)
Version

Parameters

TNvgAlignStatusType aPreserveAspectSetting
TNvgMeetOrSliceType aSmilFitSetting

SetStrokeMiterLimit(const TUint8 *)

voidSetStrokeMiterLimit(const TUint8 *aBuf)[private]

Sets the miter limit

Parameters

const TUint8 * aBuf

SetStrokePaintL(TDereferencer *)

voidSetStrokePaintL(TDereferencer *aIconData)[private]

Set stroke color in Openvg

Parameters

TDereferencer * aIconData

SetStrokeWidth(const TUint8 *)

voidSetStrokeWidth(const TUint8 *aBuf)[private]

Sets the stroke Width

Parameters

const TUint8 * aBuf

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

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

call SetTranslate in OpenVG

Parameters

TDereferencer * aIconData
TUint32 & transVal
const VGfloat * aCurrentMatrix

SetVGImageBinder(MVGImageBinder *)

voidSetVGImageBinder(MVGImageBinder *aImageBinder)[inline]

Parameters

MVGImageBinder * aImageBinder

UpdateClientMatrices()

voidUpdateClientMatrices()[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]