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