46
|
1 |
/*
|
|
2 |
* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: NVG Decoder header file
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef _TLVRENDERER_H_
|
|
20 |
#define _TLVRENDERER_H_
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <openvg.h>
|
|
24 |
#include <vgu.h>
|
|
25 |
#include "FloatFixPt.h"
|
|
26 |
#include "PseudoVG.h"
|
|
27 |
#include "NVGUtil.h"
|
|
28 |
|
|
29 |
class CNVGTLVIcon;
|
|
30 |
class CNVGIconData;
|
|
31 |
|
|
32 |
class MVGImageBinder;
|
|
33 |
|
|
34 |
class CTLVRenderer : public CBase
|
|
35 |
{
|
|
36 |
|
|
37 |
public:
|
|
38 |
static CTLVRenderer * NewL(const TDesC8& aPtr, TInt aWidth, TInt aHeight);
|
|
39 |
|
|
40 |
static CTLVRenderer * NewLC(const TDesC8& aPtr, TInt aWidth, TInt aHeight);
|
|
41 |
|
|
42 |
virtual ~CTLVRenderer();
|
|
43 |
|
|
44 |
virtual TInt ExecuteL();
|
|
45 |
|
|
46 |
void SetVGImageBinder(MVGImageBinder *aImageBinder)
|
|
47 |
{
|
|
48 |
iVGImageBinder = aImageBinder;
|
|
49 |
}
|
|
50 |
|
|
51 |
protected:
|
|
52 |
void ConstructL(const TDesC8& aPtr);
|
|
53 |
CTLVRenderer(TInt aWidth, TInt aHeight);
|
|
54 |
|
|
55 |
void DvgSetiL( );
|
|
56 |
void DvgSetfL( );
|
|
57 |
void DvgSetParameteriL( );
|
|
58 |
void DvgSetParameterfL( );
|
|
59 |
void DvgSetParameterfvL( );
|
|
60 |
void DvgSetColorL( );
|
|
61 |
void DvgSetPaintL( );
|
|
62 |
void DvgLoadMatrixL( );
|
|
63 |
void DvgMultMatrixL( );
|
|
64 |
void DvgLoadIdentityL( );
|
|
65 |
void DvgScaleL( );
|
|
66 |
void DvgTranslateL( );
|
|
67 |
void DvgAppendPathDataL( );
|
|
68 |
void DvgDrawPathL( );
|
|
69 |
void DvgClearPathL();
|
|
70 |
void DvguRectL( );
|
|
71 |
void DvguEllipseL( );
|
|
72 |
void DvguRoundRectL( );
|
|
73 |
void DvguLineL( );
|
|
74 |
void DvgCreatePaintL( );
|
|
75 |
void DvgSetivL( );
|
|
76 |
void DvgClearL();
|
|
77 |
void DvgSetfvL();
|
|
78 |
void DvgRotateL();
|
|
79 |
void DvgCreatePathL();
|
|
80 |
void DvgCreateImageL();
|
|
81 |
void DvgGetPixelsL();
|
|
82 |
void DvgClearImageL();
|
|
83 |
void DvgImageSubDataL();
|
|
84 |
void DvgDrawImageL();
|
|
85 |
void DvgDestroyImageL();
|
|
86 |
void DvgDestroyPaintL();
|
|
87 |
void DvgDestroyPathL();
|
|
88 |
|
|
89 |
void DvgPrepareToBindImageL();
|
|
90 |
void DvgBindImageL();
|
|
91 |
void DvgUnBindImageL();
|
|
92 |
|
|
93 |
void DvgFlushL();
|
|
94 |
|
|
95 |
virtual TInt ExecuteL(TInt index);
|
|
96 |
|
|
97 |
#ifdef NVG_DEBUG
|
|
98 |
//Command specific logging methods
|
|
99 |
void LogvgSeti(VGParamType type, VGint fvalue);
|
|
100 |
void LogvgSetf (VGParamType type, VGfloat fvalue);
|
|
101 |
void LogvgSetXv(VGParamType type, VGint count, TInt8 vtype, VGint * LogvgSetXv);
|
|
102 |
void LogvgSetParameteri(VGHandle handle, VGint paramType, VGint pvalue, TInt Lpvalue);
|
|
103 |
void LogvgSetPaint(VGPaint paint, VGbitfield paintModes, TInt Lpvalue);
|
|
104 |
void LogvgDrawPath(VGuint path, VGbitfield paintModes);
|
|
105 |
void LogvgSetParameterfv(VGPaint handle, VGint paramtype, TInt count, VGfloat * data);
|
|
106 |
void LogvgImageSubData(VGImage imageHandle, const void * dataPtr, TInt dataLength, VGint dataStride,
|
|
107 |
VGImageFormat dataFormat, VGint x, VGint y, VGint width, VGint height);
|
|
108 |
#endif
|
|
109 |
|
|
110 |
protected:
|
|
111 |
|
|
112 |
typedef void (CTLVRenderer::*pvgapi)( );
|
|
113 |
pvgapi vgapi[EvgFlush + 1];
|
|
114 |
|
|
115 |
CNVGIconData * iNVGIconData;
|
|
116 |
TInt iDataLength;
|
|
117 |
TSize iResizedCanvasSize;
|
|
118 |
|
|
119 |
struct TLVVGHandlePair
|
|
120 |
{
|
|
121 |
enum THandleType
|
|
122 |
{
|
|
123 |
EVGPATH,
|
|
124 |
EVGPAINT,
|
|
125 |
EVGIMAGE
|
|
126 |
};
|
|
127 |
VGHandle iVGHandle;
|
|
128 |
TInt iTLVHandle;
|
|
129 |
THandleType iHandleType;
|
|
130 |
TInt iCustomData;
|
|
131 |
|
|
132 |
explicit TLVVGHandlePair(VGHandle aVGHandle = 0, TInt aTLVHandle = 0,
|
|
133 |
THandleType aHandleType = EVGPAINT, TInt aCustomData = 0)
|
|
134 |
: iVGHandle(aVGHandle),
|
|
135 |
iTLVHandle(aTLVHandle),
|
|
136 |
iHandleType(aHandleType),
|
|
137 |
iCustomData(aCustomData)
|
|
138 |
{
|
|
139 |
}
|
|
140 |
};
|
|
141 |
|
|
142 |
VGHandle GetHandleL(int aIndex);
|
|
143 |
VGHandle GetHandle(int aIndex);
|
|
144 |
VGHandle RemoveHandleL(int aIndex);
|
|
145 |
|
|
146 |
void GetHandlePair(int aIndex, TLVVGHandlePair & aPair);
|
|
147 |
|
|
148 |
void SetHandle(int aIndex, VGHandle aHandle);
|
|
149 |
|
|
150 |
TPoint GetTranslatedPoint(VGfloat matrix[9], TPoint aPoint);
|
|
151 |
VGfloat MinVal4(VGfloat x1, VGfloat x2, VGfloat x3, VGfloat x4);
|
|
152 |
VGfloat MaxVal4(VGfloat x1, VGfloat x2, VGfloat x3, VGfloat x4);
|
|
153 |
|
|
154 |
VGPath iPathHandle;
|
|
155 |
|
|
156 |
TUint8 iNvgHeader[KNVGHeaderSize];
|
|
157 |
TInt iTargetWidth;
|
|
158 |
TInt iTargetHeight;
|
|
159 |
TBool iScaled;
|
|
160 |
|
|
161 |
TReal32 iUserMatrix[9];
|
|
162 |
MVGImageBinder * iVGImageBinder;
|
|
163 |
TUint iPrepareToBindImage;
|
|
164 |
RArray<TLVVGHandlePair> iTLVVGHandleList;
|
|
165 |
|
|
166 |
CNVGTLVIcon * iNVGTLVIcon;
|
|
167 |
friend class CNVGTLVIcon;
|
|
168 |
|
|
169 |
DECLARE_HANDLECHECKER()
|
|
170 |
};
|
|
171 |
|
|
172 |
#endif
|