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