|
1 /*------------------------------------------------------------------------ |
|
2 * |
|
3 * OpenVG 1.1 Reference Implementation |
|
4 * ------------------------------------- |
|
5 * |
|
6 * Copyright (c) 2008-2009 The Khronos Group Inc. |
|
7 * |
|
8 * Permission is hereby granted, free of charge, to any person obtaining a |
|
9 * copy of this software and /or associated documentation files |
|
10 * (the "Materials "), to deal in the Materials without restriction, |
|
11 * including without limitation the rights to use, copy, modify, merge, |
|
12 * publish, distribute, sublicense, and/or sell copies of the Materials, |
|
13 * and to permit persons to whom the Materials are furnished to do so, |
|
14 * subject to the following conditions: |
|
15 * |
|
16 * The above copyright notice and this permission notice shall be included |
|
17 * in all copies or substantial portions of the Materials. |
|
18 * |
|
19 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
22 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|
23 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|
24 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR |
|
25 * THE USE OR OTHER DEALINGS IN THE MATERIALS. |
|
26 * |
|
27 *//** |
|
28 * \file |
|
29 * \brief OpenVG 1.1 API. |
|
30 *//*-------------------------------------------------------------------*/ |
|
31 |
|
32 #ifndef __VG_1_1_OPENVG_H |
|
33 #define __VG_1_1_OPENVG_H |
|
34 |
|
35 #ifndef __VG_OPENVG_H_ |
|
36 #error Do not include this file directly. Use <VG/openvg.h>. |
|
37 #endif |
|
38 |
|
39 /* differences from the actual sample implemtation provided by Khronos: |
|
40 - this comment |
|
41 - the Doxygen comment with tag 'publishedAll', and tag 'released' |
|
42 - changing |
|
43 #define VG_API_CALL extern |
|
44 to |
|
45 #define VG_API_CALL IMPORT_C |
|
46 - the addition of __SOFTFP to all function prototypes |
|
47 - the addition of VG_PATH_DATATYPE_INVALID in VGPathDatatype |
|
48 - the addition of VG_IMAGE_FORMAT_INVALID in VGImageFormat |
|
49 - the addition of VGeglImageKHR typedef for the VG_KHR_EGL_image extension |
|
50 */ |
|
51 |
|
52 /** |
|
53 @publishedAll |
|
54 @released |
|
55 */ |
|
56 |
|
57 #ifdef __cplusplus |
|
58 extern "C" { |
|
59 #endif |
|
60 |
|
61 #include <khronos_types.h> |
|
62 |
|
63 #define OPENVG_VERSION_1_0 1 |
|
64 #define OPENVG_VERSION_1_0_1 1 |
|
65 #define OPENVG_VERSION_1_1 2 |
|
66 |
|
67 typedef khronos_float_t VGfloat; |
|
68 typedef khronos_int8_t VGbyte; |
|
69 typedef khronos_uint8_t VGubyte; |
|
70 typedef khronos_int16_t VGshort; |
|
71 typedef khronos_int32_t VGint; |
|
72 typedef khronos_uint32_t VGuint; |
|
73 typedef khronos_uint32_t VGbitfield; |
|
74 |
|
75 typedef enum { |
|
76 VG_FALSE = 0, |
|
77 VG_TRUE = 1 |
|
78 } VGboolean; |
|
79 |
|
80 #define VG_MAXSHORT ((VGshort)((~((unsigned)0)) >> 1)) |
|
81 #define VG_MAXINT ((VGint)((~((unsigned)0)) >> 1)) |
|
82 |
|
83 typedef VGuint VGHandle; |
|
84 |
|
85 #define VG_INVALID_HANDLE ((VGHandle)0) |
|
86 |
|
87 typedef enum { |
|
88 VG_NO_ERROR = 0, |
|
89 VG_BAD_HANDLE_ERROR = 0x1000, |
|
90 VG_ILLEGAL_ARGUMENT_ERROR = 0x1001, |
|
91 VG_OUT_OF_MEMORY_ERROR = 0x1002, |
|
92 VG_PATH_CAPABILITY_ERROR = 0x1003, |
|
93 VG_UNSUPPORTED_IMAGE_FORMAT_ERROR = 0x1004, |
|
94 VG_UNSUPPORTED_PATH_FORMAT_ERROR = 0x1005, |
|
95 VG_IMAGE_IN_USE_ERROR = 0x1006, |
|
96 VG_NO_CONTEXT_ERROR = 0x1007 |
|
97 } VGErrorCode; |
|
98 |
|
99 typedef enum { |
|
100 /* Mode settings */ |
|
101 VG_MATRIX_MODE = 0x1100, |
|
102 VG_FILL_RULE = 0x1101, |
|
103 VG_IMAGE_QUALITY = 0x1102, |
|
104 VG_RENDERING_QUALITY = 0x1103, |
|
105 VG_BLEND_MODE = 0x1104, |
|
106 VG_IMAGE_MODE = 0x1105, |
|
107 |
|
108 /* Scissoring rectangles */ |
|
109 VG_SCISSOR_RECTS = 0x1106, |
|
110 |
|
111 /* Color Transformation */ |
|
112 VG_COLOR_TRANSFORM = 0x1170, |
|
113 VG_COLOR_TRANSFORM_VALUES = 0x1171, |
|
114 |
|
115 /* Stroke parameters */ |
|
116 VG_STROKE_LINE_WIDTH = 0x1110, |
|
117 VG_STROKE_CAP_STYLE = 0x1111, |
|
118 VG_STROKE_JOIN_STYLE = 0x1112, |
|
119 VG_STROKE_MITER_LIMIT = 0x1113, |
|
120 VG_STROKE_DASH_PATTERN = 0x1114, |
|
121 VG_STROKE_DASH_PHASE = 0x1115, |
|
122 VG_STROKE_DASH_PHASE_RESET = 0x1116, |
|
123 |
|
124 /* Edge fill color for VG_TILE_FILL tiling mode */ |
|
125 VG_TILE_FILL_COLOR = 0x1120, |
|
126 |
|
127 /* Color for vgClear */ |
|
128 VG_CLEAR_COLOR = 0x1121, |
|
129 |
|
130 /* Glyph origin */ |
|
131 VG_GLYPH_ORIGIN = 0x1122, |
|
132 |
|
133 /* Enable/disable alpha masking and scissoring */ |
|
134 VG_MASKING = 0x1130, |
|
135 VG_SCISSORING = 0x1131, |
|
136 |
|
137 /* Pixel layout information */ |
|
138 VG_PIXEL_LAYOUT = 0x1140, |
|
139 VG_SCREEN_LAYOUT = 0x1141, |
|
140 |
|
141 /* Source format selection for image filters */ |
|
142 VG_FILTER_FORMAT_LINEAR = 0x1150, |
|
143 VG_FILTER_FORMAT_PREMULTIPLIED = 0x1151, |
|
144 |
|
145 /* Destination write enable mask for image filters */ |
|
146 VG_FILTER_CHANNEL_MASK = 0x1152, |
|
147 |
|
148 /* Implementation limits (read-only) */ |
|
149 VG_MAX_SCISSOR_RECTS = 0x1160, |
|
150 VG_MAX_DASH_COUNT = 0x1161, |
|
151 VG_MAX_KERNEL_SIZE = 0x1162, |
|
152 VG_MAX_SEPARABLE_KERNEL_SIZE = 0x1163, |
|
153 VG_MAX_COLOR_RAMP_STOPS = 0x1164, |
|
154 VG_MAX_IMAGE_WIDTH = 0x1165, |
|
155 VG_MAX_IMAGE_HEIGHT = 0x1166, |
|
156 VG_MAX_IMAGE_PIXELS = 0x1167, |
|
157 VG_MAX_IMAGE_BYTES = 0x1168, |
|
158 VG_MAX_FLOAT = 0x1169, |
|
159 VG_MAX_GAUSSIAN_STD_DEVIATION = 0x116A |
|
160 } VGParamType; |
|
161 |
|
162 typedef enum { |
|
163 VG_RENDERING_QUALITY_NONANTIALIASED = 0x1200, |
|
164 VG_RENDERING_QUALITY_FASTER = 0x1201, |
|
165 VG_RENDERING_QUALITY_BETTER = 0x1202 /* Default */ |
|
166 } VGRenderingQuality; |
|
167 |
|
168 typedef enum { |
|
169 VG_PIXEL_LAYOUT_UNKNOWN = 0x1300, |
|
170 VG_PIXEL_LAYOUT_RGB_VERTICAL = 0x1301, |
|
171 VG_PIXEL_LAYOUT_BGR_VERTICAL = 0x1302, |
|
172 VG_PIXEL_LAYOUT_RGB_HORIZONTAL = 0x1303, |
|
173 VG_PIXEL_LAYOUT_BGR_HORIZONTAL = 0x1304 |
|
174 } VGPixelLayout; |
|
175 |
|
176 typedef enum { |
|
177 VG_MATRIX_PATH_USER_TO_SURFACE = 0x1400, |
|
178 VG_MATRIX_IMAGE_USER_TO_SURFACE = 0x1401, |
|
179 VG_MATRIX_FILL_PAINT_TO_USER = 0x1402, |
|
180 VG_MATRIX_STROKE_PAINT_TO_USER = 0x1403, |
|
181 VG_MATRIX_GLYPH_USER_TO_SURFACE = 0x1404 |
|
182 } VGMatrixMode; |
|
183 |
|
184 typedef enum { |
|
185 VG_CLEAR_MASK = 0x1500, |
|
186 VG_FILL_MASK = 0x1501, |
|
187 VG_SET_MASK = 0x1502, |
|
188 VG_UNION_MASK = 0x1503, |
|
189 VG_INTERSECT_MASK = 0x1504, |
|
190 VG_SUBTRACT_MASK = 0x1505 |
|
191 } VGMaskOperation; |
|
192 |
|
193 #define VG_PATH_FORMAT_STANDARD 0 |
|
194 |
|
195 typedef enum { |
|
196 VG_PATH_DATATYPE_INVALID = -1, |
|
197 VG_PATH_DATATYPE_S_8 = 0, |
|
198 VG_PATH_DATATYPE_S_16 = 1, |
|
199 VG_PATH_DATATYPE_S_32 = 2, |
|
200 VG_PATH_DATATYPE_F = 3 |
|
201 } VGPathDatatype; |
|
202 |
|
203 typedef enum { |
|
204 VG_ABSOLUTE = 0, |
|
205 VG_RELATIVE = 1 |
|
206 } VGPathAbsRel; |
|
207 |
|
208 typedef enum { |
|
209 VG_CLOSE_PATH = ( 0 << 1), |
|
210 VG_MOVE_TO = ( 1 << 1), |
|
211 VG_LINE_TO = ( 2 << 1), |
|
212 VG_HLINE_TO = ( 3 << 1), |
|
213 VG_VLINE_TO = ( 4 << 1), |
|
214 VG_QUAD_TO = ( 5 << 1), |
|
215 VG_CUBIC_TO = ( 6 << 1), |
|
216 VG_SQUAD_TO = ( 7 << 1), |
|
217 VG_SCUBIC_TO = ( 8 << 1), |
|
218 VG_SCCWARC_TO = ( 9 << 1), |
|
219 VG_SCWARC_TO = (10 << 1), |
|
220 VG_LCCWARC_TO = (11 << 1), |
|
221 VG_LCWARC_TO = (12 << 1) |
|
222 } VGPathSegment; |
|
223 |
|
224 typedef enum { |
|
225 VG_MOVE_TO_ABS = VG_MOVE_TO | VG_ABSOLUTE, |
|
226 VG_MOVE_TO_REL = VG_MOVE_TO | VG_RELATIVE, |
|
227 VG_LINE_TO_ABS = VG_LINE_TO | VG_ABSOLUTE, |
|
228 VG_LINE_TO_REL = VG_LINE_TO | VG_RELATIVE, |
|
229 VG_HLINE_TO_ABS = VG_HLINE_TO | VG_ABSOLUTE, |
|
230 VG_HLINE_TO_REL = VG_HLINE_TO | VG_RELATIVE, |
|
231 VG_VLINE_TO_ABS = VG_VLINE_TO | VG_ABSOLUTE, |
|
232 VG_VLINE_TO_REL = VG_VLINE_TO | VG_RELATIVE, |
|
233 VG_QUAD_TO_ABS = VG_QUAD_TO | VG_ABSOLUTE, |
|
234 VG_QUAD_TO_REL = VG_QUAD_TO | VG_RELATIVE, |
|
235 VG_CUBIC_TO_ABS = VG_CUBIC_TO | VG_ABSOLUTE, |
|
236 VG_CUBIC_TO_REL = VG_CUBIC_TO | VG_RELATIVE, |
|
237 VG_SQUAD_TO_ABS = VG_SQUAD_TO | VG_ABSOLUTE, |
|
238 VG_SQUAD_TO_REL = VG_SQUAD_TO | VG_RELATIVE, |
|
239 VG_SCUBIC_TO_ABS = VG_SCUBIC_TO | VG_ABSOLUTE, |
|
240 VG_SCUBIC_TO_REL = VG_SCUBIC_TO | VG_RELATIVE, |
|
241 VG_SCCWARC_TO_ABS = VG_SCCWARC_TO | VG_ABSOLUTE, |
|
242 VG_SCCWARC_TO_REL = VG_SCCWARC_TO | VG_RELATIVE, |
|
243 VG_SCWARC_TO_ABS = VG_SCWARC_TO | VG_ABSOLUTE, |
|
244 VG_SCWARC_TO_REL = VG_SCWARC_TO | VG_RELATIVE, |
|
245 VG_LCCWARC_TO_ABS = VG_LCCWARC_TO | VG_ABSOLUTE, |
|
246 VG_LCCWARC_TO_REL = VG_LCCWARC_TO | VG_RELATIVE, |
|
247 VG_LCWARC_TO_ABS = VG_LCWARC_TO | VG_ABSOLUTE, |
|
248 VG_LCWARC_TO_REL = VG_LCWARC_TO | VG_RELATIVE |
|
249 } VGPathCommand; |
|
250 |
|
251 typedef VGHandle VGPath; |
|
252 |
|
253 typedef enum { |
|
254 VG_PATH_CAPABILITY_APPEND_FROM = (1 << 0), |
|
255 VG_PATH_CAPABILITY_APPEND_TO = (1 << 1), |
|
256 VG_PATH_CAPABILITY_MODIFY = (1 << 2), |
|
257 VG_PATH_CAPABILITY_TRANSFORM_FROM = (1 << 3), |
|
258 VG_PATH_CAPABILITY_TRANSFORM_TO = (1 << 4), |
|
259 VG_PATH_CAPABILITY_INTERPOLATE_FROM = (1 << 5), |
|
260 VG_PATH_CAPABILITY_INTERPOLATE_TO = (1 << 6), |
|
261 VG_PATH_CAPABILITY_PATH_LENGTH = (1 << 7), |
|
262 VG_PATH_CAPABILITY_POINT_ALONG_PATH = (1 << 8), |
|
263 VG_PATH_CAPABILITY_TANGENT_ALONG_PATH = (1 << 9), |
|
264 VG_PATH_CAPABILITY_PATH_BOUNDS = (1 << 10), |
|
265 VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS = (1 << 11), |
|
266 VG_PATH_CAPABILITY_ALL = (1 << 12) - 1 |
|
267 } VGPathCapabilities; |
|
268 |
|
269 typedef enum { |
|
270 VG_PATH_FORMAT = 0x1600, |
|
271 VG_PATH_DATATYPE = 0x1601, |
|
272 VG_PATH_SCALE = 0x1602, |
|
273 VG_PATH_BIAS = 0x1603, |
|
274 VG_PATH_NUM_SEGMENTS = 0x1604, |
|
275 VG_PATH_NUM_COORDS = 0x1605 |
|
276 } VGPathParamType; |
|
277 |
|
278 typedef enum { |
|
279 VG_CAP_BUTT = 0x1700, |
|
280 VG_CAP_ROUND = 0x1701, |
|
281 VG_CAP_SQUARE = 0x1702 |
|
282 } VGCapStyle; |
|
283 |
|
284 typedef enum { |
|
285 VG_JOIN_MITER = 0x1800, |
|
286 VG_JOIN_ROUND = 0x1801, |
|
287 VG_JOIN_BEVEL = 0x1802 |
|
288 } VGJoinStyle; |
|
289 |
|
290 typedef enum { |
|
291 VG_EVEN_ODD = 0x1900, |
|
292 VG_NON_ZERO = 0x1901 |
|
293 } VGFillRule; |
|
294 |
|
295 typedef enum { |
|
296 VG_STROKE_PATH = (1 << 0), |
|
297 VG_FILL_PATH = (1 << 1) |
|
298 } VGPaintMode; |
|
299 |
|
300 typedef VGHandle VGPaint; |
|
301 |
|
302 typedef enum { |
|
303 /* Color paint parameters */ |
|
304 VG_PAINT_TYPE = 0x1A00, |
|
305 VG_PAINT_COLOR = 0x1A01, |
|
306 VG_PAINT_COLOR_RAMP_SPREAD_MODE = 0x1A02, |
|
307 VG_PAINT_COLOR_RAMP_PREMULTIPLIED = 0x1A07, |
|
308 VG_PAINT_COLOR_RAMP_STOPS = 0x1A03, |
|
309 |
|
310 /* Linear gradient paint parameters */ |
|
311 VG_PAINT_LINEAR_GRADIENT = 0x1A04, |
|
312 |
|
313 /* Radial gradient paint parameters */ |
|
314 VG_PAINT_RADIAL_GRADIENT = 0x1A05, |
|
315 |
|
316 /* Pattern paint parameters */ |
|
317 VG_PAINT_PATTERN_TILING_MODE = 0x1A06 |
|
318 } VGPaintParamType; |
|
319 |
|
320 typedef enum { |
|
321 VG_PAINT_TYPE_COLOR = 0x1B00, |
|
322 VG_PAINT_TYPE_LINEAR_GRADIENT = 0x1B01, |
|
323 VG_PAINT_TYPE_RADIAL_GRADIENT = 0x1B02, |
|
324 VG_PAINT_TYPE_PATTERN = 0x1B03 |
|
325 } VGPaintType; |
|
326 |
|
327 typedef enum { |
|
328 VG_COLOR_RAMP_SPREAD_PAD = 0x1C00, |
|
329 VG_COLOR_RAMP_SPREAD_REPEAT = 0x1C01, |
|
330 VG_COLOR_RAMP_SPREAD_REFLECT = 0x1C02 |
|
331 } VGColorRampSpreadMode; |
|
332 |
|
333 typedef enum { |
|
334 VG_TILE_FILL = 0x1D00, |
|
335 VG_TILE_PAD = 0x1D01, |
|
336 VG_TILE_REPEAT = 0x1D02, |
|
337 VG_TILE_REFLECT = 0x1D03 |
|
338 } VGTilingMode; |
|
339 |
|
340 typedef enum { |
|
341 /* RGB{A,X} channel ordering */ |
|
342 VG_IMAGE_FORMAT_INVALID = -1, |
|
343 VG_sRGBX_8888 = 0, |
|
344 VG_sRGBA_8888 = 1, |
|
345 VG_sRGBA_8888_PRE = 2, |
|
346 VG_sRGB_565 = 3, |
|
347 VG_sRGBA_5551 = 4, |
|
348 VG_sRGBA_4444 = 5, |
|
349 VG_sL_8 = 6, |
|
350 VG_lRGBX_8888 = 7, |
|
351 VG_lRGBA_8888 = 8, |
|
352 VG_lRGBA_8888_PRE = 9, |
|
353 VG_lL_8 = 10, |
|
354 VG_A_8 = 11, |
|
355 VG_BW_1 = 12, |
|
356 VG_A_1 = 13, |
|
357 VG_A_4 = 14, |
|
358 |
|
359 /* {A,X}RGB channel ordering */ |
|
360 VG_sXRGB_8888 = 0 | (1 << 6), |
|
361 VG_sARGB_8888 = 1 | (1 << 6), |
|
362 VG_sARGB_8888_PRE = 2 | (1 << 6), |
|
363 VG_sARGB_1555 = 4 | (1 << 6), |
|
364 VG_sARGB_4444 = 5 | (1 << 6), |
|
365 VG_lXRGB_8888 = 7 | (1 << 6), |
|
366 VG_lARGB_8888 = 8 | (1 << 6), |
|
367 VG_lARGB_8888_PRE = 9 | (1 << 6), |
|
368 |
|
369 /* BGR{A,X} channel ordering */ |
|
370 VG_sBGRX_8888 = 0 | (1 << 7), |
|
371 VG_sBGRA_8888 = 1 | (1 << 7), |
|
372 VG_sBGRA_8888_PRE = 2 | (1 << 7), |
|
373 VG_sBGR_565 = 3 | (1 << 7), |
|
374 VG_sBGRA_5551 = 4 | (1 << 7), |
|
375 VG_sBGRA_4444 = 5 | (1 << 7), |
|
376 VG_lBGRX_8888 = 7 | (1 << 7), |
|
377 VG_lBGRA_8888 = 8 | (1 << 7), |
|
378 VG_lBGRA_8888_PRE = 9 | (1 << 7), |
|
379 |
|
380 /* {A,X}BGR channel ordering */ |
|
381 VG_sXBGR_8888 = 0 | (1 << 6) | (1 << 7), |
|
382 VG_sABGR_8888 = 1 | (1 << 6) | (1 << 7), |
|
383 VG_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7), |
|
384 VG_sABGR_1555 = 4 | (1 << 6) | (1 << 7), |
|
385 VG_sABGR_4444 = 5 | (1 << 6) | (1 << 7), |
|
386 VG_lXBGR_8888 = 7 | (1 << 6) | (1 << 7), |
|
387 VG_lABGR_8888 = 8 | (1 << 6) | (1 << 7), |
|
388 VG_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7) |
|
389 } VGImageFormat; |
|
390 |
|
391 typedef VGHandle VGImage; |
|
392 typedef int VGeglImageKHR; |
|
393 |
|
394 typedef enum { |
|
395 VG_IMAGE_QUALITY_NONANTIALIASED = (1 << 0), |
|
396 VG_IMAGE_QUALITY_FASTER = (1 << 1), |
|
397 VG_IMAGE_QUALITY_BETTER = (1 << 2) |
|
398 } VGImageQuality; |
|
399 |
|
400 typedef enum { |
|
401 VG_IMAGE_FORMAT = 0x1E00, |
|
402 VG_IMAGE_WIDTH = 0x1E01, |
|
403 VG_IMAGE_HEIGHT = 0x1E02 |
|
404 } VGImageParamType; |
|
405 |
|
406 typedef enum { |
|
407 VG_DRAW_IMAGE_NORMAL = 0x1F00, |
|
408 VG_DRAW_IMAGE_MULTIPLY = 0x1F01, |
|
409 VG_DRAW_IMAGE_STENCIL = 0x1F02 |
|
410 } VGImageMode; |
|
411 |
|
412 typedef enum { |
|
413 VG_RED = (1 << 3), |
|
414 VG_GREEN = (1 << 2), |
|
415 VG_BLUE = (1 << 1), |
|
416 VG_ALPHA = (1 << 0) |
|
417 } VGImageChannel; |
|
418 |
|
419 typedef enum { |
|
420 VG_BLEND_SRC = 0x2000, |
|
421 VG_BLEND_SRC_OVER = 0x2001, |
|
422 VG_BLEND_DST_OVER = 0x2002, |
|
423 VG_BLEND_SRC_IN = 0x2003, |
|
424 VG_BLEND_DST_IN = 0x2004, |
|
425 VG_BLEND_MULTIPLY = 0x2005, |
|
426 VG_BLEND_SCREEN = 0x2006, |
|
427 VG_BLEND_DARKEN = 0x2007, |
|
428 VG_BLEND_LIGHTEN = 0x2008, |
|
429 VG_BLEND_ADDITIVE = 0x2009 |
|
430 } VGBlendMode; |
|
431 |
|
432 typedef enum { |
|
433 VG_IMAGE_FORMAT_QUERY = 0x2100, |
|
434 VG_PATH_DATATYPE_QUERY = 0x2101 |
|
435 } VGHardwareQueryType; |
|
436 |
|
437 typedef enum { |
|
438 VG_HARDWARE_ACCELERATED = 0x2200, |
|
439 VG_HARDWARE_UNACCELERATED = 0x2201 |
|
440 } VGHardwareQueryResult; |
|
441 |
|
442 typedef enum { |
|
443 VG_VENDOR = 0x2300, |
|
444 VG_RENDERER = 0x2301, |
|
445 VG_VERSION = 0x2302, |
|
446 VG_EXTENSIONS = 0x2303 |
|
447 } VGStringID; |
|
448 |
|
449 typedef enum { |
|
450 VG_FONT_NUM_GLYPHS = 0x2F00 |
|
451 } VGFontParamType; |
|
452 |
|
453 |
|
454 /* Function Prototypes */ |
|
455 |
|
456 #ifndef VG_API_CALL |
|
457 # if defined(SYMBIAN_VG_DLL_EXPORTS) |
|
458 # define VG_API_CALL EXPORT_C |
|
459 # else |
|
460 # define VG_API_CALL IMPORT_C |
|
461 # endif //defined(SYMBIAN_VG_DLL_EXPORTS) |
|
462 #endif |
|
463 #ifndef VG_APIENTRY |
|
464 #define VG_APIENTRY /* nothing */ |
|
465 #endif |
|
466 #ifndef VG_APIEXIT |
|
467 #define VG_APIEXIT __SOFTFP |
|
468 #endif |
|
469 |
|
470 VG_API_CALL VGErrorCode VG_APIENTRY |
|
471 vgGetError(void) VG_APIEXIT; |
|
472 |
|
473 VG_API_CALL void VG_APIENTRY |
|
474 vgFlush(void) VG_APIEXIT; |
|
475 VG_API_CALL void VG_APIENTRY |
|
476 vgFinish(void) VG_APIEXIT; |
|
477 |
|
478 /* Getters and Setters */ |
|
479 VG_API_CALL void VG_APIENTRY |
|
480 vgSetf (VGParamType type, VGfloat value) VG_APIEXIT; |
|
481 VG_API_CALL void VG_APIENTRY |
|
482 vgSeti (VGParamType type, VGint value) VG_APIEXIT; |
|
483 VG_API_CALL void VG_APIENTRY |
|
484 vgSetfv(VGParamType type, VGint count, |
|
485 const VGfloat * values) VG_APIEXIT; |
|
486 VG_API_CALL void VG_APIENTRY |
|
487 vgSetiv(VGParamType type, VGint count, |
|
488 const VGint * values) VG_APIEXIT; |
|
489 VG_API_CALL VGfloat VG_APIENTRY |
|
490 vgGetf(VGParamType type) VG_APIEXIT; |
|
491 VG_API_CALL VGint VG_APIENTRY |
|
492 vgGeti(VGParamType type) VG_APIEXIT; |
|
493 VG_API_CALL VGint VG_APIENTRY |
|
494 vgGetVectorSize(VGParamType type) VG_APIEXIT; |
|
495 VG_API_CALL void VG_APIENTRY |
|
496 vgGetfv(VGParamType type, VGint count, |
|
497 VGfloat * values) VG_APIEXIT; |
|
498 VG_API_CALL void VG_APIENTRY |
|
499 vgGetiv(VGParamType type, VGint count, |
|
500 VGint * values) VG_APIEXIT; |
|
501 VG_API_CALL void VG_APIENTRY |
|
502 vgSetParameterf(VGHandle object, |
|
503 VGint paramType, |
|
504 VGfloat value) VG_APIEXIT; |
|
505 VG_API_CALL void VG_APIENTRY |
|
506 vgSetParameteri(VGHandle object, |
|
507 VGint paramType, |
|
508 VGint value) VG_APIEXIT; |
|
509 VG_API_CALL void VG_APIENTRY |
|
510 vgSetParameterfv(VGHandle object, |
|
511 VGint paramType, |
|
512 VGint count, |
|
513 const VGfloat * values) VG_APIEXIT; |
|
514 VG_API_CALL void VG_APIENTRY |
|
515 vgSetParameteriv(VGHandle object, |
|
516 VGint paramType, |
|
517 VGint count, |
|
518 const VGint * values) VG_APIEXIT; |
|
519 |
|
520 VG_API_CALL VGfloat VG_APIENTRY |
|
521 vgGetParameterf(VGHandle object, |
|
522 VGint paramType) VG_APIEXIT; |
|
523 VG_API_CALL VGint VG_APIENTRY |
|
524 vgGetParameteri(VGHandle object, |
|
525 VGint paramType) VG_APIEXIT; |
|
526 VG_API_CALL VGint VG_APIENTRY |
|
527 vgGetParameterVectorSize(VGHandle object, |
|
528 VGint paramType) VG_APIEXIT; |
|
529 VG_API_CALL void VG_APIENTRY |
|
530 vgGetParameterfv(VGHandle object, |
|
531 VGint paramType, |
|
532 VGint count, |
|
533 VGfloat * values) VG_APIEXIT; |
|
534 VG_API_CALL void VG_APIENTRY |
|
535 vgGetParameteriv(VGHandle object, |
|
536 VGint paramType, |
|
537 VGint count, |
|
538 VGint * values) VG_APIEXIT; |
|
539 |
|
540 /* Matrix Manipulation */ |
|
541 VG_API_CALL void VG_APIENTRY |
|
542 vgLoadIdentity(void) VG_APIEXIT; |
|
543 VG_API_CALL void VG_APIENTRY |
|
544 vgLoadMatrix(const VGfloat * m) VG_APIEXIT; |
|
545 VG_API_CALL void VG_APIENTRY |
|
546 vgGetMatrix(VGfloat * m) VG_APIEXIT; |
|
547 VG_API_CALL void VG_APIENTRY |
|
548 vgMultMatrix(const VGfloat * m) VG_APIEXIT; |
|
549 VG_API_CALL void VG_APIENTRY |
|
550 vgTranslate(VGfloat tx, VGfloat ty) VG_APIEXIT; |
|
551 VG_API_CALL void VG_APIENTRY |
|
552 vgScale(VGfloat sx, VGfloat sy) VG_APIEXIT; |
|
553 VG_API_CALL void VG_APIENTRY |
|
554 vgShear(VGfloat shx, VGfloat shy) VG_APIEXIT; |
|
555 VG_API_CALL void VG_APIENTRY |
|
556 vgRotate(VGfloat angle) VG_APIEXIT; |
|
557 |
|
558 /* Masking and Clearing */ |
|
559 typedef VGHandle VGMaskLayer; |
|
560 |
|
561 VG_API_CALL void VG_APIENTRY |
|
562 vgMask(VGHandle mask, VGMaskOperation operation, |
|
563 VGint x, VGint y, |
|
564 VGint width, VGint height) VG_APIEXIT; |
|
565 VG_API_CALL void VG_APIENTRY |
|
566 vgRenderToMask(VGPath path, |
|
567 VGbitfield paintModes, |
|
568 VGMaskOperation operation) VG_APIEXIT; |
|
569 VG_API_CALL VGMaskLayer VG_APIENTRY |
|
570 vgCreateMaskLayer(VGint width, VGint height) VG_APIEXIT; |
|
571 VG_API_CALL void VG_APIENTRY |
|
572 vgDestroyMaskLayer(VGMaskLayer maskLayer) VG_APIEXIT; |
|
573 VG_API_CALL void VG_APIENTRY |
|
574 vgFillMaskLayer(VGMaskLayer maskLayer, |
|
575 VGint x, VGint y, |
|
576 VGint width, VGint height, |
|
577 VGfloat value) VG_APIEXIT; |
|
578 VG_API_CALL void VG_APIENTRY |
|
579 vgCopyMask(VGMaskLayer maskLayer, |
|
580 VGint sx, VGint sy, |
|
581 VGint dx, VGint dy, |
|
582 VGint width, VGint height) VG_APIEXIT; |
|
583 VG_API_CALL void VG_APIENTRY |
|
584 vgClear(VGint x, VGint y, |
|
585 VGint width, VGint height) VG_APIEXIT; |
|
586 |
|
587 /* Paths */ |
|
588 VG_API_CALL VGPath VG_APIENTRY |
|
589 vgCreatePath(VGint pathFormat, |
|
590 VGPathDatatype datatype, |
|
591 VGfloat scale, VGfloat bias, |
|
592 VGint segmentCapacityHint, |
|
593 VGint coordCapacityHint, |
|
594 VGbitfield capabilities) VG_APIEXIT; |
|
595 VG_API_CALL void VG_APIENTRY |
|
596 vgClearPath(VGPath path, VGbitfield capabilities) VG_APIEXIT; |
|
597 VG_API_CALL void VG_APIENTRY |
|
598 vgDestroyPath(VGPath path) VG_APIEXIT; |
|
599 VG_API_CALL void VG_APIENTRY |
|
600 vgRemovePathCapabilities(VGPath path, |
|
601 VGbitfield capabilities) VG_APIEXIT; |
|
602 VG_API_CALL VGbitfield VG_APIENTRY |
|
603 vgGetPathCapabilities(VGPath path) VG_APIEXIT; |
|
604 VG_API_CALL void VG_APIENTRY |
|
605 vgAppendPath(VGPath dstPath, VGPath srcPath) VG_APIEXIT; |
|
606 VG_API_CALL void VG_APIENTRY |
|
607 vgAppendPathData(VGPath dstPath, |
|
608 VGint numSegments, |
|
609 const VGubyte * pathSegments, |
|
610 const void * pathData) VG_APIEXIT; |
|
611 VG_API_CALL void VG_APIENTRY |
|
612 vgModifyPathCoords(VGPath dstPath, |
|
613 VGint startIndex, |
|
614 VGint numSegments, |
|
615 const void * pathData) VG_APIEXIT; |
|
616 VG_API_CALL void VG_APIENTRY |
|
617 vgTransformPath(VGPath dstPath, VGPath srcPath) VG_APIEXIT; |
|
618 VG_API_CALL VGboolean VG_APIENTRY |
|
619 vgInterpolatePath(VGPath dstPath, |
|
620 VGPath startPath, |
|
621 VGPath endPath, |
|
622 VGfloat amount) VG_APIEXIT; |
|
623 VG_API_CALL VGfloat VG_APIENTRY |
|
624 vgPathLength(VGPath path, |
|
625 VGint startSegment, |
|
626 VGint numSegments) VG_APIEXIT; |
|
627 VG_API_CALL void VG_APIENTRY |
|
628 vgPointAlongPath(VGPath path, |
|
629 VGint startSegment, |
|
630 VGint numSegments, |
|
631 VGfloat distance, |
|
632 VGfloat * x, VGfloat * y, |
|
633 VGfloat * tangentX, |
|
634 VGfloat * tangentY) VG_APIEXIT; |
|
635 VG_API_CALL void VG_APIENTRY |
|
636 vgPathBounds(VGPath path, |
|
637 VGfloat * minX, |
|
638 VGfloat * minY, |
|
639 VGfloat * width, |
|
640 VGfloat * height) VG_APIEXIT; |
|
641 VG_API_CALL void VG_APIENTRY |
|
642 vgPathTransformedBounds(VGPath path, |
|
643 VGfloat * minX, |
|
644 VGfloat * minY, |
|
645 VGfloat * width, |
|
646 VGfloat * height) VG_APIEXIT; |
|
647 VG_API_CALL void VG_APIENTRY |
|
648 vgDrawPath(VGPath path, VGbitfield paintModes) VG_APIEXIT; |
|
649 |
|
650 /* Paint */ |
|
651 VG_API_CALL VGPaint VG_APIENTRY |
|
652 vgCreatePaint(void) VG_APIEXIT; |
|
653 VG_API_CALL void VG_APIENTRY |
|
654 vgDestroyPaint(VGPaint paint) VG_APIEXIT; |
|
655 VG_API_CALL void VG_APIENTRY |
|
656 vgSetPaint(VGPaint paint, VGbitfield paintModes) VG_APIEXIT; |
|
657 VG_API_CALL VGPaint VG_APIENTRY |
|
658 vgGetPaint(VGPaintMode paintMode) VG_APIEXIT; |
|
659 VG_API_CALL void VG_APIENTRY |
|
660 vgSetColor(VGPaint paint, VGuint rgba) VG_APIEXIT; |
|
661 VG_API_CALL VGuint VG_APIENTRY |
|
662 vgGetColor(VGPaint paint) VG_APIEXIT; |
|
663 VG_API_CALL void VG_APIENTRY |
|
664 vgPaintPattern(VGPaint paint, VGImage pattern) VG_APIEXIT; |
|
665 |
|
666 /* Images */ |
|
667 VG_API_CALL VGImage VG_APIENTRY |
|
668 vgCreateImage(VGImageFormat format, |
|
669 VGint width, VGint height, |
|
670 VGbitfield allowedQuality) VG_APIEXIT; |
|
671 VG_API_CALL void VG_APIENTRY |
|
672 vgDestroyImage(VGImage image) VG_APIEXIT; |
|
673 VG_API_CALL void VG_APIENTRY |
|
674 vgClearImage(VGImage image, |
|
675 VGint x, VGint y, |
|
676 VGint width, VGint height) VG_APIEXIT; |
|
677 VG_API_CALL void VG_APIENTRY |
|
678 vgImageSubData(VGImage image, |
|
679 const void * data, |
|
680 VGint dataStride, |
|
681 VGImageFormat dataFormat, |
|
682 VGint x, VGint y, |
|
683 VGint width, VGint height) VG_APIEXIT; |
|
684 VG_API_CALL void VG_APIENTRY |
|
685 vgGetImageSubData(VGImage image, |
|
686 void * data, |
|
687 VGint dataStride, |
|
688 VGImageFormat dataFormat, |
|
689 VGint x, VGint y, |
|
690 VGint width, VGint height) VG_APIEXIT; |
|
691 VG_API_CALL VGImage VG_APIENTRY |
|
692 vgChildImage(VGImage parent, |
|
693 VGint x, VGint y, |
|
694 VGint width, VGint height) VG_APIEXIT; |
|
695 VG_API_CALL VGImage VG_APIENTRY |
|
696 vgGetParent(VGImage image) VG_APIEXIT; |
|
697 VG_API_CALL void VG_APIENTRY |
|
698 vgCopyImage(VGImage dst, VGint dx, VGint dy, |
|
699 VGImage src, VGint sx, VGint sy, |
|
700 VGint width, VGint height, |
|
701 VGboolean dither) VG_APIEXIT; |
|
702 VG_API_CALL void VG_APIENTRY |
|
703 vgDrawImage(VGImage image) VG_APIEXIT; |
|
704 VG_API_CALL void VG_APIENTRY |
|
705 vgSetPixels(VGint dx, VGint dy, |
|
706 VGImage src, VGint sx, VGint sy, |
|
707 VGint width, VGint height) VG_APIEXIT; |
|
708 VG_API_CALL void VG_APIENTRY |
|
709 vgWritePixels(const void * data, VGint dataStride, |
|
710 VGImageFormat dataFormat, |
|
711 VGint dx, VGint dy, |
|
712 VGint width, VGint height) VG_APIEXIT; |
|
713 VG_API_CALL void VG_APIENTRY |
|
714 vgGetPixels(VGImage dst, VGint dx, VGint dy, |
|
715 VGint sx, VGint sy, |
|
716 VGint width, VGint height) VG_APIEXIT; |
|
717 VG_API_CALL void VG_APIENTRY |
|
718 vgReadPixels(void * data, VGint dataStride, |
|
719 VGImageFormat dataFormat, |
|
720 VGint sx, VGint sy, |
|
721 VGint width, VGint height) VG_APIEXIT; |
|
722 VG_API_CALL void VG_APIENTRY |
|
723 vgCopyPixels(VGint dx, VGint dy, |
|
724 VGint sx, VGint sy, |
|
725 VGint width, VGint height) VG_APIEXIT; |
|
726 |
|
727 /* Text */ |
|
728 typedef VGHandle VGFont; |
|
729 |
|
730 VG_API_CALL VGFont VG_APIENTRY |
|
731 vgCreateFont(VGint glyphCapacityHint) VG_APIEXIT; |
|
732 VG_API_CALL void VG_APIENTRY |
|
733 vgDestroyFont(VGFont font) VG_APIEXIT; |
|
734 VG_API_CALL void VG_APIENTRY |
|
735 vgSetGlyphToPath(VGFont font, |
|
736 VGuint glyphIndex, |
|
737 VGPath path, |
|
738 VGboolean isHinted, |
|
739 const VGfloat glyphOrigin [2], |
|
740 const VGfloat escapement[2]) VG_APIEXIT; |
|
741 VG_API_CALL void VG_APIENTRY |
|
742 vgSetGlyphToImage(VGFont font, |
|
743 VGuint glyphIndex, |
|
744 VGImage image, |
|
745 const VGfloat glyphOrigin [2], |
|
746 const VGfloat escapement[2]) VG_APIEXIT; |
|
747 VG_API_CALL void VG_APIENTRY |
|
748 vgClearGlyph(VGFont font, |
|
749 VGuint glyphIndex) VG_APIEXIT; |
|
750 VG_API_CALL void VG_APIENTRY |
|
751 vgDrawGlyph(VGFont font, |
|
752 VGuint glyphIndex, |
|
753 VGbitfield paintModes, |
|
754 VGboolean allowAutoHinting) VG_APIEXIT; |
|
755 VG_API_CALL void VG_APIENTRY |
|
756 vgDrawGlyphs(VGFont font, |
|
757 VGint glyphCount, |
|
758 const VGuint * glyphIndices, |
|
759 const VGfloat * adjustments_x, |
|
760 const VGfloat * adjustments_y, |
|
761 VGbitfield paintModes, |
|
762 VGboolean allowAutoHinting) VG_APIEXIT; |
|
763 |
|
764 /* Image Filters */ |
|
765 VG_API_CALL void VG_APIENTRY |
|
766 vgColorMatrix(VGImage dst, VGImage src, |
|
767 const VGfloat * matrix) VG_APIEXIT; |
|
768 VG_API_CALL void VG_APIENTRY |
|
769 vgConvolve(VGImage dst, VGImage src, |
|
770 VGint kernelWidth, VGint kernelHeight, |
|
771 VGint shiftX, VGint shiftY, |
|
772 const VGshort * kernel, |
|
773 VGfloat scale, |
|
774 VGfloat bias, |
|
775 VGTilingMode tilingMode) VG_APIEXIT; |
|
776 VG_API_CALL void VG_APIENTRY |
|
777 vgSeparableConvolve(VGImage dst, VGImage src, |
|
778 VGint kernelWidth, |
|
779 VGint kernelHeight, |
|
780 VGint shiftX, VGint shiftY, |
|
781 const VGshort * kernelX, |
|
782 const VGshort * kernelY, |
|
783 VGfloat scale, |
|
784 VGfloat bias, |
|
785 VGTilingMode tilingMode) VG_APIEXIT; |
|
786 VG_API_CALL void VG_APIENTRY |
|
787 vgGaussianBlur(VGImage dst, VGImage src, |
|
788 VGfloat stdDeviationX, |
|
789 VGfloat stdDeviationY, |
|
790 VGTilingMode tilingMode) VG_APIEXIT; |
|
791 VG_API_CALL void VG_APIENTRY |
|
792 vgLookup(VGImage dst, VGImage src, |
|
793 const VGubyte * redLUT, |
|
794 const VGubyte * greenLUT, |
|
795 const VGubyte * blueLUT, |
|
796 const VGubyte * alphaLUT, |
|
797 VGboolean outputLinear, |
|
798 VGboolean outputPremultiplied) VG_APIEXIT; |
|
799 VG_API_CALL void VG_APIENTRY |
|
800 vgLookupSingle(VGImage dst, VGImage src, |
|
801 const VGuint * lookupTable, |
|
802 VGImageChannel sourceChannel, |
|
803 VGboolean outputLinear, |
|
804 VGboolean outputPremultiplied) VG_APIEXIT; |
|
805 |
|
806 /* Hardware Queries */ |
|
807 VG_API_CALL VGHardwareQueryResult VG_APIENTRY |
|
808 vgHardwareQuery |
|
809 (VGHardwareQueryType key, |
|
810 VGint setting) VG_APIEXIT; |
|
811 |
|
812 /* Renderer and Extension Information */ |
|
813 VG_API_CALL const VGubyte * VG_APIENTRY |
|
814 vgGetString(VGStringID name) VG_APIEXIT; |
|
815 |
|
816 #ifdef __cplusplus |
|
817 } /* extern "C" */ |
|
818 #endif |
|
819 |
|
820 #endif /* __VG_1_1_OPENVG_H */ |