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