1 /**************************************************************************
3 * Copyright 2009 VMware, Inc. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 **************************************************************************/
30 #include "VG/openvg.h"
32 #define SEGMENT_COMMAND(command) /* Extract segment type */ \
34 #define SEGMENT_ABS_REL(command) /* Extract absolute/relative bit */ \
37 static INLINE VGint
size_for_datatype(VGPathDatatype datatype
)
40 case VG_PATH_DATATYPE_S_8
:
42 case VG_PATH_DATATYPE_S_16
:
44 case VG_PATH_DATATYPE_S_32
:
46 case VG_PATH_DATATYPE_F
:
49 assert(!"unknown datatype");
54 static INLINE VGint
num_elements_for_segments(const VGubyte
*segments
,
60 for (i
= 0; i
< num_segments
; ++i
) {
61 VGubyte segment
= segments
[i
];
62 VGint command
= SEGMENT_COMMAND(segment
);
103 assert(!"Unknown segment!");