Merge branch 'master' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa into r6xx...
[mesa.git] / include / VG / vgu.h
1 /* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
2
3 /*------------------------------------------------------------------------
4 *
5 * VGU 1.0.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.0.1 API.
32 *//*-------------------------------------------------------------------*/
33
34 #ifndef _VGU_H
35 #define _VGU_H
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #include <VG/openvg.h>
42
43 #define VGU_VERSION_1_0 1
44
45 #ifndef VGU_API_CALL
46 # error VGU_API_CALL must be defined
47 #endif
48
49 #ifndef VGU_API_ENTRY
50 # error VGU_API_ENTRY must be defined
51 #endif
52
53 #ifndef VGU_API_EXIT
54 # error VGU_API_EXIT must be defined
55 #endif
56
57
58 typedef enum {
59 VGU_NO_ERROR = 0,
60 VGU_BAD_HANDLE_ERROR = 0xF000,
61 VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
62 VGU_OUT_OF_MEMORY_ERROR = 0xF002,
63 VGU_PATH_CAPABILITY_ERROR = 0xF003,
64 VGU_BAD_WARP_ERROR = 0xF004,
65
66 VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
67 } VGUErrorCode;
68
69 typedef enum {
70 VGU_ARC_OPEN = 0xF100,
71 VGU_ARC_CHORD = 0xF101,
72 VGU_ARC_PIE = 0xF102,
73
74 VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
75 } VGUArcType;
76
77 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
78 VGfloat x0, VGfloat y0,
79 VGfloat x1, VGfloat y1) VGU_API_EXIT;
80
81 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
82 const VGfloat * points, VGint count,
83 VGboolean closed) VGU_API_EXIT;
84
85 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
86 VGfloat x, VGfloat y,
87 VGfloat width, VGfloat height) VGU_API_EXIT;
88
89 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
90 VGfloat x, VGfloat y,
91 VGfloat width, VGfloat height,
92 VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
93
94 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
95 VGfloat cx, VGfloat cy,
96 VGfloat width, VGfloat height) VGU_API_EXIT;
97
98 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
99 VGfloat x, VGfloat y,
100 VGfloat width, VGfloat height,
101 VGfloat startAngle, VGfloat angleExtent,
102 VGUArcType arcType) VGU_API_EXIT;
103
104 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
105 VGfloat sx1, VGfloat sy1,
106 VGfloat sx2, VGfloat sy2,
107 VGfloat sx3, VGfloat sy3,
108 VGfloat * matrix) VGU_API_EXIT;
109
110 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
111 VGfloat dx1, VGfloat dy1,
112 VGfloat dx2, VGfloat dy2,
113 VGfloat dx3, VGfloat dy3,
114 VGfloat * matrix) VGU_API_EXIT;
115
116 VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
117 VGfloat dx1, VGfloat dy1,
118 VGfloat dx2, VGfloat dy2,
119 VGfloat dx3, VGfloat dy3,
120 VGfloat sx0, VGfloat sy0,
121 VGfloat sx1, VGfloat sy1,
122 VGfloat sx2, VGfloat sy2,
123 VGfloat sx3, VGfloat sy3,
124 VGfloat * matrix) VGU_API_EXIT;
125
126 #ifdef __cplusplus
127 } /* extern "C" */
128 #endif
129
130 #endif /* #ifndef _VGU_H */