williamr@2
|
1 |
/*------------------------------------------------------------------------
|
williamr@2
|
2 |
*
|
williamr@2
|
3 |
* VGU 1.1 Reference Implementation
|
williamr@2
|
4 |
* -------------------------------------
|
williamr@2
|
5 |
*
|
williamr@2
|
6 |
* Copyright (c) 2008 The Khronos Group Inc.
|
williamr@2
|
7 |
*
|
williamr@2
|
8 |
* Permission is hereby granted, free of charge, to any person obtaining a
|
williamr@2
|
9 |
* copy of this software and /or associated documentation files
|
williamr@2
|
10 |
* (the "Materials "), to deal in the Materials without restriction,
|
williamr@2
|
11 |
* including without limitation the rights to use, copy, modify, merge,
|
williamr@2
|
12 |
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
williamr@2
|
13 |
* and to permit persons to whom the Materials are furnished to do so,
|
williamr@2
|
14 |
* subject to the following conditions:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
* The above copyright notice and this permission notice shall be included
|
williamr@2
|
17 |
* in all copies or substantial portions of the Materials.
|
williamr@2
|
18 |
*
|
williamr@2
|
19 |
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
williamr@2
|
20 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
williamr@2
|
21 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
williamr@2
|
22 |
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
williamr@2
|
23 |
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
williamr@2
|
24 |
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
|
williamr@2
|
25 |
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
williamr@2
|
26 |
*
|
williamr@2
|
27 |
*//**
|
williamr@2
|
28 |
* \file
|
williamr@2
|
29 |
* \brief VGU 1.1 API.
|
williamr@2
|
30 |
*//*-------------------------------------------------------------------*/
|
williamr@2
|
31 |
|
williamr@2
|
32 |
#ifndef __VG_1_1_VGU_H
|
williamr@2
|
33 |
#define __VG_1_1_VGU_H
|
williamr@2
|
34 |
|
williamr@2
|
35 |
#ifndef __VG_VGU_H_
|
williamr@2
|
36 |
#error Do not include this file directly. Use <VG/vgu.h>.
|
williamr@2
|
37 |
#endif
|
williamr@2
|
38 |
|
williamr@2
|
39 |
/* differences from the actual sample implemtation provided by Khronos:
|
williamr@2
|
40 |
- this comment
|
williamr@2
|
41 |
- the Doxygen comment with tag 'publishedAll', and tag 'released'
|
williamr@2
|
42 |
- changing
|
williamr@2
|
43 |
#define VG_API_CALL extern
|
williamr@2
|
44 |
to
|
williamr@2
|
45 |
#define VG_API_CALL IMPORT_C
|
williamr@2
|
46 |
- the addition of __SOFTFP in some of the function prototypes
|
williamr@2
|
47 |
*/
|
williamr@2
|
48 |
|
williamr@2
|
49 |
/**
|
williamr@2
|
50 |
@publishedAll
|
williamr@2
|
51 |
@released
|
williamr@2
|
52 |
*/
|
williamr@2
|
53 |
#ifdef __cplusplus
|
williamr@2
|
54 |
extern "C" {
|
williamr@2
|
55 |
#endif
|
williamr@2
|
56 |
|
williamr@2
|
57 |
#include <VG/openvg.h>
|
williamr@2
|
58 |
|
williamr@2
|
59 |
#define VGU_VERSION_1_0 1
|
williamr@2
|
60 |
#define VGU_VERSION_1_1 2
|
williamr@2
|
61 |
|
williamr@2
|
62 |
#ifndef VGU_API_CALL
|
williamr@2
|
63 |
#define VGU_API_CALL IMPORT_C
|
williamr@2
|
64 |
#endif
|
williamr@2
|
65 |
#ifndef VGU_APIENTRY
|
williamr@2
|
66 |
#define VGU_APIENTRY /* nothing */
|
williamr@2
|
67 |
#endif
|
williamr@2
|
68 |
#ifndef VGU_APIEXIT
|
williamr@2
|
69 |
#define VGU_APIEXIT __SOFTFP
|
williamr@2
|
70 |
#endif
|
williamr@2
|
71 |
|
williamr@2
|
72 |
typedef enum {
|
williamr@2
|
73 |
VGU_NO_ERROR = 0,
|
williamr@2
|
74 |
VGU_BAD_HANDLE_ERROR = 0xF000,
|
williamr@2
|
75 |
VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
|
williamr@2
|
76 |
VGU_OUT_OF_MEMORY_ERROR = 0xF002,
|
williamr@2
|
77 |
VGU_PATH_CAPABILITY_ERROR = 0xF003,
|
williamr@2
|
78 |
VGU_BAD_WARP_ERROR = 0xF004
|
williamr@2
|
79 |
} VGUErrorCode;
|
williamr@2
|
80 |
|
williamr@2
|
81 |
typedef enum {
|
williamr@2
|
82 |
VGU_ARC_OPEN = 0xF100,
|
williamr@2
|
83 |
VGU_ARC_CHORD = 0xF101,
|
williamr@2
|
84 |
VGU_ARC_PIE = 0xF102
|
williamr@2
|
85 |
} VGUArcType;
|
williamr@2
|
86 |
|
williamr@2
|
87 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
88 |
vguLine(VGPath path,
|
williamr@2
|
89 |
VGfloat x0, VGfloat y0,
|
williamr@2
|
90 |
VGfloat x1, VGfloat y1) VGU_APIEXIT;
|
williamr@2
|
91 |
|
williamr@2
|
92 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
93 |
vguPolygon(VGPath path,
|
williamr@2
|
94 |
const VGfloat * points,
|
williamr@2
|
95 |
VGint count,
|
williamr@2
|
96 |
VGboolean closed) VGU_APIEXIT;
|
williamr@2
|
97 |
|
williamr@2
|
98 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
99 |
vguRect(VGPath path,
|
williamr@2
|
100 |
VGfloat x, VGfloat y,
|
williamr@2
|
101 |
VGfloat width, VGfloat height) VGU_APIEXIT;
|
williamr@2
|
102 |
|
williamr@2
|
103 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
104 |
vguRoundRect(VGPath path,
|
williamr@2
|
105 |
VGfloat x, VGfloat y,
|
williamr@2
|
106 |
VGfloat width,
|
williamr@2
|
107 |
VGfloat height,
|
williamr@2
|
108 |
VGfloat arcWidth,
|
williamr@2
|
109 |
VGfloat arcHeight) VGU_APIEXIT;
|
williamr@2
|
110 |
|
williamr@2
|
111 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
112 |
vguEllipse(VGPath path,
|
williamr@2
|
113 |
VGfloat cx, VGfloat cy,
|
williamr@2
|
114 |
VGfloat width,
|
williamr@2
|
115 |
VGfloat height) VGU_APIEXIT;
|
williamr@2
|
116 |
|
williamr@2
|
117 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
118 |
vguArc(VGPath path,
|
williamr@2
|
119 |
VGfloat x, VGfloat y,
|
williamr@2
|
120 |
VGfloat width, VGfloat height,
|
williamr@2
|
121 |
VGfloat startAngle,
|
williamr@2
|
122 |
VGfloat angleExtent,
|
williamr@2
|
123 |
VGUArcType arcType) VGU_APIEXIT;
|
williamr@2
|
124 |
|
williamr@2
|
125 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
126 |
vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
|
williamr@2
|
127 |
VGfloat sx1, VGfloat sy1,
|
williamr@2
|
128 |
VGfloat sx2, VGfloat sy2,
|
williamr@2
|
129 |
VGfloat sx3, VGfloat sy3,
|
williamr@2
|
130 |
VGfloat * matrix) VGU_APIEXIT;
|
williamr@2
|
131 |
|
williamr@2
|
132 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
133 |
vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
|
williamr@2
|
134 |
VGfloat dx1, VGfloat dy1,
|
williamr@2
|
135 |
VGfloat dx2, VGfloat dy2,
|
williamr@2
|
136 |
VGfloat dx3, VGfloat dy3,
|
williamr@2
|
137 |
VGfloat * matrix) VGU_APIEXIT;
|
williamr@2
|
138 |
|
williamr@2
|
139 |
VGU_API_CALL VGUErrorCode VGU_APIENTRY
|
williamr@2
|
140 |
vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
|
williamr@2
|
141 |
VGfloat dx1, VGfloat dy1,
|
williamr@2
|
142 |
VGfloat dx2, VGfloat dy2,
|
williamr@2
|
143 |
VGfloat dx3, VGfloat dy3,
|
williamr@2
|
144 |
VGfloat sx0, VGfloat sy0,
|
williamr@2
|
145 |
VGfloat sx1, VGfloat sy1,
|
williamr@2
|
146 |
VGfloat sx2, VGfloat sy2,
|
williamr@2
|
147 |
VGfloat sx3, VGfloat sy3,
|
williamr@2
|
148 |
VGfloat * matrix) VGU_APIEXIT;
|
williamr@2
|
149 |
|
williamr@2
|
150 |
#ifdef __cplusplus
|
williamr@2
|
151 |
} /* extern "C" */
|
williamr@2
|
152 |
#endif
|
williamr@2
|
153 |
|
williamr@2
|
154 |
#endif /* __VG_1_1_VGU_H */
|