guestrendering/guestopenvg/src/openvg.cpp
author Matt Plumtree <matt.plumtree@nokia.com>
Mon, 15 Nov 2010 09:56:25 +0000
branchbug235_bringup_0
changeset 77 b0395290e61f
parent 24 a3f46bb01be2
permissions -rwxr-xr-x
Ensure OpenGL ES 2.0 C functions use C signatures in C++ builds (fixes VS builds)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     2
// All rights reserved.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     3
// This component and the accompanying materials are made available
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     5
// which accompanies this distribution, and is available
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     7
//
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     8
// Initial Contributors:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
     9
// Nokia Corporation - initial contribution.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    10
//
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    11
// Contributors:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    12
//
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    13
// Description:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    14
// OpenVG C API for Symbian DLL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    15
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    16
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    17
#include "vgstate.h"
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    18
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    19
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    20
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    21
extern "C" {
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    22
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    23
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    24
 Note: Comments at the start of each Open VG api are adapted from the Open VG 1.1 specification.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    25
 The text has been chosen/adapted to give a helpful overview of the function, and the errors
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    26
 (other than VG_NO_CONTEXT_ERROR) that it may generate.  For more details and diagrams see the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    27
 full Open VG specification.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    28
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    29
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    30
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    31
 The vgGetParameter functions return the value of a parameter on a given VGHandlebased
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    32
 object.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    33
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    34
 The original value passed to vgSetParameter (provided the call to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    35
 vgSetParameter completed without error) should be returned by
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    36
 vgGetParameter (except where specifically noted), even if the implementation
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    37
 makes use of a truncated or quantized value internally.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    38
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    39
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    40
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    41
   – if object is not a valid handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    42
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    43
   – if paramType is not a valid value from the appropriate enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    44
   – if paramType refers to a vector parameter in vgGetParameterf or
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    45
     vgGetParameteri
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    46
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    47
EXPORT_C VGint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    48
	vgGetParameteri(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    49
		VGint paramType)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    50
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    51
	OPENVG_TRACE("vgGetParameteri object=0x%x, paramType=0x%x -->", object, paramType);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    52
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    53
	VGint value = TGuestOpenVg::vgGetParameteri(object, paramType);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    54
	OPENVG_TRACE("vgGetParameteri value=0x%x <--", value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    55
	return value;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    56
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    57
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    58
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    59
////////////////////////////////////////////////////////////////////////////////////////////
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    60
//Functions returning value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    61
////////////////////////////////////////////////////////////////////////////////////////////
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    62
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    63
 Returns the oldest error code provided by an API call on the current context since the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    64
 previous  call to vgGetError on that context (or since the creation of the context). No
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    65
 error is indicated by a return value of 0 (VG_NO_ERROR). After the call, the error code is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    66
 cleared to 0. The possible errors that may be generated by each OpenVG function (apart from
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    67
 VG_OUT_OF_MEMORY_ERROR) are shown below the definition of the function.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    68
 If no context is current at the time vgGetError is called, the error code
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    69
 VG_NO_CONTEXT_ERROR is returned. Pending error codes on existing contexts are not affected
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    70
 by the call.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    71
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    72
EXPORT_C VGErrorCode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    73
	vgGetError(void)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    74
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    75
	OPENVG_TRACE("vgGetError");
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    76
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    77
	MVgContext* vgContext = CVghwUtils::VgContext();
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    78
	VGErrorCode error = VG_NO_CONTEXT_ERROR;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    79
	if (vgContext)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    80
		{ // thread state already exists - get client or Host VG error
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    81
		error = vgContext->VgError();
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    82
		}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    83
	return error;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    84
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    85
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    86
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    87
 Returns the paint object currently set for the given paintMode, or VG_INVALID_HANDLE
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    88
 if an error occurs or if no paint object is set (i.e., the default paint is present) on
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    89
 the given context with the given paintMode.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    90
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    91
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    92
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    93
   – if paintMode is not a valid value from the VGPaintMode enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    94
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    95
EXPORT_C VGPaint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    96
	vgGetPaint(VGPaintMode paintMode)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    97
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    98
	OPENVG_TRACE("vgGetPaint paintMode=0x%x -->", paintMode);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
    99
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   100
	VGPaint paintHandle = TGuestOpenVg::vgGetPaint(paintMode);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   101
	OPENVG_TRACE("vgGetPaint handle=0x%x <--", paintHandle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   102
	return paintHandle;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   103
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   104
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   105
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   106
 Creates a new paint object that is initialized to a set of default values and returns
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   107
 a VGPaint handle to it. If insufficient memory is available to allocate a new object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   108
 VG_INVALID_HANDLE is returned.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   109
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   110
EXPORT_C VGPaint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   111
	vgCreatePaint(void)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   112
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   113
	OPENVG_TRACE("vgCreatePaint -->");
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   114
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   115
	VGPaint paintHandle = TGuestOpenVg::vgCreatePaint();
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   116
	OPENVG_TRACE("vgCreatePaint handle=0x%x <--", paintHandle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   117
	return paintHandle;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   118
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   119
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   120
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   121
 Appends a path, defined by interpolation (or extrapolation) between the paths
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   122
 startPath and endPath by the given amount, to the path dstPath. It returns
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   123
 VG_TRUE if interpolation was successful (i.e., the paths had compatible segment
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   124
 types after normalization), and VG_FALSE otherwise. If interpolation is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   125
 unsuccessful, dstPath is left unchanged. It is legal for dstPath to be a handle
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   126
 to the same path object as either startPath or endPath or both, in which case
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   127
 the contents of the source path or paths referenced by dstPath will have the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   128
 interpolated path appended. If dstPath is not the a handle to the same path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   129
 object as either startPath or endPath, the contents of startPath and endPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   130
 will not be affected by the call.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   131
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   132
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   133
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   134
   – if any of dstPath, startPath, or endPath is not a valid path handle, or is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   135
     not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   136
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   137
   – if VG_PATH_CAPABILITY_INTERPOLATE_TO is not enabled for dstPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   138
   – if VG_PATH_CAPABILITY_INTERPOLATE_FROM is not enabled for startPath or endPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   139
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   140
EXPORT_C VGboolean
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   141
	vgInterpolatePath(VGPath dstPath,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   142
		VGPath startPath,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   143
		VGPath endPath,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   144
		VGfloat amount)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   145
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   146
	OPENVG_TRACE("vgInterpolatePath dstPath=0x%x, startPath=0x%x, endPath=0x%x, amount=%f",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   147
			dstPath, startPath, endPath, amount);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   148
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   149
	return TGuestOpenVg::vgInterpolatePath(dstPath, startPath, endPath, amount);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   150
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   151
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   152
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   153
 Returns the length of a given portion of a path in the user coordinate system
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   154
 (that is, in the path’s own coordinate system, disregarding any matrix
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   155
 settings). Only the subpath consisting of the numSegments path segments beginning
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   156
 with startSegment (where the initial path segment has index 0) is used. If an
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   157
 error occurs, -1.0f is returned.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   158
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   159
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   160
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   161
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   162
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   163
   – if VG_PATH_CAPABILITY_PATH_LENGTH is not enabled for path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   164
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   165
   – if startSegment is less than 0 or greater than the index of the final path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   166
     segment
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   167
   – if numSegments is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   168
   – if (startSegment + numSegments – 1) is greater than the index of the final
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   169
     path segment
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   170
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   171
EXPORT_C VGfloat
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   172
	vgPathLength(VGPath path,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   173
		VGint startSegment,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   174
		VGint numSegments)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   175
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   176
	OPENVG_TRACE("vgPathLength path=0x%x, startSegment=%d, numSegments=%d", path, startSegment, numSegments);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   177
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   178
	return TGuestOpenVg::vgPathLength(path, startSegment, numSegments);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   179
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   180
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   181
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   182
 Returns the current capabilities of the path, as a bitwise OR of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   183
 VGPathCapabilities constants. If an error occurs, 0 is returned.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   184
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   185
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   186
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   187
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   188
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   189
EXPORT_C VGbitfield
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   190
	vgGetPathCapabilities(VGPath path)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   191
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   192
	OPENVG_TRACE("vgGetPathCapabilities path=0x%x", path);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   193
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   194
	return TGuestOpenVg::vgGetPathCapabilities(path);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   195
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   196
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   197
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   198
 Create a new path that is ready to accept segment data and return a VGPath handle
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   199
 to it. The path data will be formatted in the format given by pathFormat, typically
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   200
 VG_PATH_FORMAT_STANDARD. The datatype parameter contains a value from the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   201
 VGPathDatatype enumeration indicating the datatype that will be used for coordinate
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   202
 data. The capabilities argument is a bitwise OR of the desired VGPathCapabilities
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   203
 values. Bits of capabilities that do not correspond to values from VGPathCapabilities
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   204
 have no effect.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   205
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   206
 If an error occurs, VG_INVALID_HANDLE is returned.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   207
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   208
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   209
   VG_UNSUPPORTED_PATH_FORMAT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   210
   – if pathFormat is not a supported format
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   211
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   212
   – if datatype is not a valid value from the VGPathDatatype enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   213
   – if scale is equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   214
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   215
EXPORT_C VGPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   216
	vgCreatePath(VGint pathFormat,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   217
		VGPathDatatype datatype,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   218
		VGfloat scale, VGfloat bias,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   219
		VGint segmentCapacityHint,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   220
		VGint coordCapacityHint,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   221
		VGbitfield capabilities)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   222
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   223
	OPENVG_TRACE("vgCreatePath pathFormat=%d, datatype=0x%x, scale=%f, bias=%f, segCapHint=%d, coordCapHint=%d, caps=0x%x -->",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   224
			pathFormat, datatype, scale, bias, segmentCapacityHint, coordCapacityHint, capabilities);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   225
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   226
	VGPath pathHandle = TGuestOpenVg::vgCreatePath(pathFormat, datatype, scale, bias, segmentCapacityHint, coordCapacityHint, capabilities);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   227
	OPENVG_TRACE("vgCreatePath handle=0x%x <--", pathHandle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   228
	return pathHandle;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   229
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   230
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   231
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   232
 The vgGet functions return the value of a parameter on the current context.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   233
 The original value passed to vgSet (except as specifically noted, and provided the call to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   234
 vgSet completed without error) is returned by vgGet, even if the implementation makes
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   235
 use of a truncated or quantized value internally. This rule ensures that OpenVG state may
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   236
 be saved and restored without degradation.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   237
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   238
 If an error occurs during a call to vgGetf, vgGeti, or vgGetVectorSize, the return value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   239
 is undefined.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   240
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   241
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   242
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   243
   – if paramType is not a valid value from the VGParamType enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   244
   – if paramType refers to a vector parameter in vgGetf or vgGeti
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   245
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   246
EXPORT_C VGfloat
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   247
	vgGetf(VGParamType type)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   248
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   249
	OPENVG_TRACE("vgGetf type=0x%x", type);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   250
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   251
	return TGuestOpenVg::vgGetf(type);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   252
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   253
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   254
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   255
 The vgGet functions return the value of a parameter on the current context.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   256
 The original value passed to vgSet (except as specifically noted, and provided the call to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   257
 vgSet completed without error) is returned by vgGet, even if the implementation makes
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   258
 use of a truncated or quantized value internally. This rule ensures that OpenVG state may
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   259
 be saved and restored without degradation.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   260
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   261
 If an error occurs during a call to vgGetf, vgGeti, or vgGetVectorSize, the return value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   262
 is undefined.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   263
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   264
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   265
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   266
   – if paramType is not a valid value from the VGParamType enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   267
   – if paramType refers to a vector parameter in vgGetf or vgGeti
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   268
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   269
EXPORT_C VGint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   270
	vgGeti(VGParamType type)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   271
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   272
	OPENVG_TRACE("vgGeti type=0x%x", type);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   273
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   274
	return TGuestOpenVg::vgGeti(type);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   275
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   276
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   277
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   278
 The vgGetVectorSize function returns the maximum number of elements in the vector
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   279
 that will be retrieved by the vgGetiv or vgGetfv functions if called with the given
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   280
 paramType argument. For scalar values, 1 is returned. If vgGetiv or vgGetfv is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   281
 called with a smaller value for count than that returned by vgGetVectorSize,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   282
 only the first count elements of the vector are retrieved. Use of a greater value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   283
 for count will result in an error.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   284
 The original value passed to vgSet (except as specifically noted, and provided the call to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   285
 vgSet completed without error) is returned by vgGet, even if the implementation makes
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   286
 use of a truncated or quantized value internally. This rule ensures that OpenVG state may
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   287
 be saved and restored without degradation.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   288
 If an error occurs during a call to vgGetf, vgGeti, or vgGetVectorSize, the return value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   289
 is undefined.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   290
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   291
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   292
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   293
   – if paramType is not a valid value from the VGParamType enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   294
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   295
EXPORT_C VGint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   296
	vgGetVectorSize(VGParamType type)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   297
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   298
	OPENVG_TRACE("vgGetVectorSize type=0x%x", type);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   299
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   300
	return TGuestOpenVg::vgGetVectorSize(type);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   301
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   302
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   303
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   304
 The vgGetParameter functions return the value of a parameter on a given VGHandlebased
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   305
 object.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   306
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   307
 The original value passed to vgSetParameter (provided the call to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   308
 vgSetParameter completed without error) should be returned by
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   309
 vgGetParameter (except where specifically noted), even if the implementation
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   310
 makes use of a truncated or quantized value internally.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   311
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   312
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   313
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   314
   – if object is not a valid handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   315
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   316
   – if paramType is not a valid value from the appropriate enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   317
   – if paramType refers to a vector parameter in vgGetParameterf or
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   318
     vgGetParameteri
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   319
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   320
EXPORT_C VGfloat
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   321
	vgGetParameterf(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   322
		VGint paramType)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   323
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   324
	OPENVG_TRACE("vgGetParameterf object=0x%x, paramType=0x%x -->", object, paramType);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   325
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   326
	VGfloat value = TGuestOpenVg::vgGetParameterf(object, paramType);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   327
	OPENVG_TRACE("vgGetParameterf value=%f <--", value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   328
	return value;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   329
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   330
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   331
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   332
 The vgGetParameterVectorSize function returns the number of elements in the vector
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   333
 that will be returned by the vgGetParameteriv or vgGetParameterfv functions if called
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   334
 with the given paramType argument. For scalar values, 1 is returned.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   335
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   336
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   337
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   338
   – if object is not a valid handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   339
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   340
   – if paramType is not a valid value from the appropriate enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   341
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   342
EXPORT_C VGint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   343
	vgGetParameterVectorSize(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   344
		VGint paramType)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   345
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   346
	OPENVG_TRACE("vgGetParameterVectorSize object=0x%x, paramType=0x%x -->", object, paramType);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   347
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   348
	VGint size = TGuestOpenVg::vgGetParameterVectorSize(object, paramType);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   349
	OPENVG_TRACE("vgGetParameterVectorSize size=%i <--", size);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   350
	return size;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   351
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   352
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   353
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   354
 Creates an object capable of storing a mask layer with the given width and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   355
 height and returns a VGMaskLayer handle to it. The mask layer is defined to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   356
 be compatible with the format and multisampling properties of the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   357
 drawing surface. If there is no current drawing surface, no mask is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   358
 configured for the current drawing surface, or an error occurs,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   359
 VG_INVALID_HANDLE is returned. All mask layer values are initially set to one.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   360
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   361
  ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   362
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   363
   – if width or height are less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   364
   – if width is greater than VG_MAX_IMAGE_WIDTH
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   365
   – if height is greater than VG_MAX_IMAGE_HEIGHT
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   366
   – if width*height is greater than VG_MAX_IMAGE_PIXELS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   367
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   368
EXPORT_C VGMaskLayer
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   369
	vgCreateMaskLayer(VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   370
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   371
	OPENVG_TRACE("vgCreateMaskLayer width=%d, height=%d -->", width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   372
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   373
	VGMaskLayer maskHandle = TGuestOpenVg::vgCreateMaskLayer(width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   374
	OPENVG_TRACE("vgCreateMaskLayer handle=0x%x <--", maskHandle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   375
	return maskHandle;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   376
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   377
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   378
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   379
 The current setting of the VG_PAINT_COLOR parameter on a given paint object may
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   380
 be queried as a 32-bit non-premultiplied sRGBA_8888 value. Each color channel or
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   381
 alpha value is clamped to the range [0, 1] , multiplied by 255, and rounded to obtain an
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   382
 8-bit integer; the resulting values are packed into a 32-bit value in the same format as for
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   383
 vgSetColor.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   384
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   385
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   386
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   387
   – if paint is not a valid paint handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   388
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   389
EXPORT_C VGuint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   390
	vgGetColor(VGPaint paint)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   391
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   392
	OPENVG_TRACE("vgGetColor paint=0x%x", paint);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   393
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   394
	return TGuestOpenVg::vgGetColor(paint);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   395
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   396
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   397
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   398
 Creates an image with the given width, height, and pixel format and returns a
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   399
 VGImage handle to it. If an error occurs, VG_INVALID_HANDLE is returned. All
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   400
 color and alpha channel values are initially set to zero. The format parameter
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   401
 must contain a value from the VGImageFormat enumeration.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   402
 The allowedQuality parameter is a bitwise OR of values from the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   403
 VGImageQuality enumeration, indicating which levels of resampling quality may be
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   404
 used to draw the image. It is always possible to draw an image using the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   405
 VG_IMAGE_QUALITY_NONANTIALIASED quality setting even if it is not explicitly
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   406
 specified.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   407
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   408
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   409
   VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   410
   – if format is not a valid value from the VGImageFormat enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   411
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   412
   – if width or height are less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   413
   – if width is greater than VG_MAX_IMAGE_WIDTH
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   414
   – if height is greater than VG_MAX_IMAGE_HEIGHT
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   415
   – if width*height is greater than VG_MAX_IMAGE_PIXELS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   416
   – if width*height*(pixel size of format) is greater than
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   417
   VG_MAX_IMAGE_BYTES
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   418
   – if allowedQuality is not a bitwise OR of values from the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   419
     VGImageQuality enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   420
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   421
EXPORT_C VGImage
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   422
	vgCreateImage(VGImageFormat format,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   423
		VGint width, VGint height,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   424
		VGbitfield allowedQuality)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   425
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   426
	OPENVG_TRACE("vgCreateImage format=0x%x, width=%d, height=%d, allowedQuality=0x%x -->",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   427
			format, width, height, allowedQuality);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   428
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   429
	VGImage imageHandle = TGuestOpenVg::vgCreateImage(format, width, height, allowedQuality);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   430
	OPENVG_TRACE("vgCreateImage handle=0x%x <--", imageHandle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   431
	return imageHandle;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   432
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   433
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   434
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   435
 Returns a new VGImage handle that refers to a portion of the parent image. The
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   436
 region is given by the intersection of the bounds of the parent image with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   437
 rectangle beginning at pixel (x, y) with dimensions width and height, which
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   438
 must define a positive region contained entirely within parent.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   439
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   440
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   441
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   442
   – if parent is not a valid image handle, or is not shared with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   443
     context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   444
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   445
   – if parent is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   446
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   447
   – if x is less than 0 or greater than or equal to the parent width
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   448
   – if y is less than 0 or greater than or equal to the parent height
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   449
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   450
   – if x + width is greater than the parent width
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   451
   – if y + height is greater than the parent height
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   452
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   453
EXPORT_C VGImage
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   454
	vgChildImage(VGImage parent,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   455
		VGint x, VGint y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   456
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   457
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   458
	OPENVG_TRACE("vgChildImage parent=oc%x, x=%d, y=%d, width=%d, height=%d -->",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   459
			parent, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   460
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   461
	VGImage imageHandle = TGuestOpenVg::vgChildImage(parent, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   462
	OPENVG_TRACE("vgChildImage handle=0x%x <--", imageHandle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   463
	return imageHandle;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   464
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   465
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   466
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   467
 Returns the closest valid ancestor (i.e., one that has not been the target of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   468
 a vgDestroyImage call) of the given image. If image has no ancestors, image is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   469
 returned.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   470
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   471
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   472
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   473
   – if image is not a valid image handle, or is not shared with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   474
     context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   475
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   476
   – if image is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   477
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   478
EXPORT_C VGImage vgGetParent(VGImage image)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   479
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   480
	OPENVG_TRACE("vgGetParent image=0x%x", image);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   481
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   482
	return TGuestOpenVg::vgGetParent(image);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   483
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   484
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   485
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   486
 Creates a new font object and returns a VGFont handle to it. The glyphCapacityHint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   487
 argument provides a hint as to the capacity of a VGFont, i.e., the total number of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   488
 glyphs that this VGFont object will be required to accept. A value of 0 indicates that
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   489
 the value is unknown. If an error occurs during execution, VG_INVALID_HANDLE is returned.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   490
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   491
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   492
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   493
   – if glyphCapacityHint is negative
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   494
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   495
EXPORT_C VGFont vgCreateFont(VGint glyphCapacityHint)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   496
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   497
	OPENVG_TRACE("vgCreateFont glyphCapacityHint=%d -->", glyphCapacityHint);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   498
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   499
	VGFont fontHandle = TGuestOpenVg::vgCreateFont(glyphCapacityHint);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   500
	OPENVG_TRACE("vgCreateFont handle=0x%x <--", fontHandle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   501
	return fontHandle;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   502
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   503
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   504
/* Hardware Queries */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   505
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   506
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   507
 Returns a value indicating whether a given setting of a property of a type given
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   508
 by key is generally accelerated in hardware on the currently running OpenVG
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   509
 implementation.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   510
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   511
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   512
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   513
   – if key is not one of the values from the VGHardwareQueryType enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   514
   – if setting is not one of the values from the enumeration associated with
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   515
     key
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   516
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   517
EXPORT_C VGHardwareQueryResult
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   518
	vgHardwareQuery
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   519
		(VGHardwareQueryType key,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   520
		VGint setting)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   521
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   522
	OPENVG_TRACE("vgHardwareQuery key=0x%x, setting=%d", key, setting);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   523
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   524
	return TGuestOpenVg::vgHardwareQuery(key, setting);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   525
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   526
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   527
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   528
 The vgGetString function returns information about the OpenVG implementation,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   529
 including extension information. The values returned may vary according to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   530
 the display (e.g., the EGLDisplay when using EGL) associated with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   531
 context.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   532
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   533
 Returns NULL if no context is current.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   534
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   535
EXPORT_C const VGubyte *
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   536
	vgGetString(VGStringID name)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   537
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   538
	OPENVG_TRACE("vgGetString name=0x%x", name);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   539
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   540
	switch (name)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   541
		{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   542
		case VG_VENDOR:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   543
			return (const VGubyte *)"Nokia";
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   544
		case VG_RENDERER:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   545
			return (const VGubyte *)"Guest 1.0";
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   546
		case VG_VERSION:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   547
			return (const VGubyte *)"1.1";
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   548
		case VG_EXTENSIONS: // supported VG extensions, (associated function addresses are fetched with eglGetProcAddress)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   549
			return (const VGubyte *)"VG_KHR_EGL_image";
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   550
		}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   551
	return (const VGubyte *)NULL;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   552
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   553
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   554
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   555
 The vgGetParameter functions return the value of a parameter on a given VGHandlebased
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   556
 object.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   557
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   558
 If vgGetParameteriv or vgGetParameterfv is called with a smaller value for
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   559
 count than that returned by vgGetParameterVectorSize, only the first count
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   560
 elements of the vector are retrieved. Use of a greater value for count will result
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   561
 in an error.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   562
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   563
 The original value passed to vgSetParameter (provided the call to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   564
 vgSetParameter completed without error) should be returned by
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   565
 vgGetParameter (except where specifically noted), even if the implementation
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   566
 makes use of a truncated or quantized value internally.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   567
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   568
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   569
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   570
   – if object is not a valid handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   571
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   572
   – if paramType is not a valid value from the appropriate enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   573
   – if values is NULL in vgGetParameterfv or vgGetParameteriv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   574
   – if values is not properly aligned in vgGetParameterfv or vgGetParameteriv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   575
   – if count is less than or equal to 0 in vgGetParameterfv or vgGetParameteriv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   576
   – if count is greater than the value returned by vgGetParameterVectorSize for
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   577
     the given parameter in vgGetParameterfv or vgGetParameteriv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   578
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   579
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   580
	vgGetParameterfv(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   581
		VGint paramType,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   582
		VGint count,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   583
		VGfloat * values)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   584
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   585
	OPENVG_TRACE("vgGetParameterfv object=0x%x, paramType=0x%x, count=%d, values=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   586
			object, paramType, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   587
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   588
	TGuestOpenVg::vgGetParameterfv(object, paramType, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   589
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   590
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   591
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   592
	vgGetParameteriv(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   593
		VGint paramType,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   594
		VGint count,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   595
		VGint * values)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   596
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   597
	OPENVG_TRACE("vgGetParameteriv object=0x%x, paramType=0x%x, count=%d, values=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   598
			object, paramType, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   599
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   600
	TGuestOpenVg::vgGetParameteriv(object, paramType, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   601
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   602
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   603
/* Renderer and Extension Information */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   604
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   605
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   606
The vgGetVectorSize function returns the maximum number of elements in the vector
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   607
that will be retrieved by the vgGetiv or vgGetfv functions if called with the given
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   608
paramType argument. For scalar values, 1 is returned. If vgGetiv or vgGetfv is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   609
called with a smaller value for count than that returned by vgGetVectorSize,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   610
only the first count elements of the vector are retrieved. Use of a greater value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   611
for count will result in an error.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   612
The original value passed to vgSet (except as specifically noted, and provided the call to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   613
vgSet completed without error) is returned by vgGet, even if the implementation makes
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   614
use of a truncated or quantized value internally. This rule ensures that OpenVG state may
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   615
be saved and restored without degradation.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   616
If an error occurs during a call to vgGetfv or vgGetiv, nothing is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   617
written to values.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   618
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   619
ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   620
VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   621
– if paramType is not a valid value from the VGParamType enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   622
– if values is NULL in vgGetfv or vgGetiv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   623
– if values is not properly aligned in vgGetfv or vgGetiv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   624
– if count is less than or equal to 0 in vgGetfv or vgGetiv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   625
– if count is greater than the value returned by vgGetVectorSize for the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   626
given parameter in vgGetfv or vgGetiv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   627
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   628
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   629
	vgGetfv(VGParamType type, VGint count,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   630
		VGfloat * values)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   631
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   632
	OPENVG_TRACE("vgGetfv type=0x%x, count=%d, values=0x%x", type, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   633
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   634
	TGuestOpenVg::vgGetfv(type, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   635
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   636
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   637
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   638
	vgGetiv(VGParamType type, VGint count,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   639
		VGint * values)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   640
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   641
	OPENVG_TRACE("vgGetiv type=0x%x, count=%d, values=0x%x", type, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   642
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   643
	TGuestOpenVg::vgGetiv(type, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   644
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   645
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   646
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   647
 Retrieve the value of the current transformation.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   648
 Nine values are written to m in the order:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   649
 { sx, shy, w0, shx, sy, w1, tx, ty, w2 }
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   650
 For an affine matrix, w0 and w1 will always be 0 and w2 will always be 1.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   651
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   652
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   653
 VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   654
 – if m is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   655
 – if m is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   656
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   657
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   658
	vgGetMatrix(VGfloat * m)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   659
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   660
	OPENVG_TRACE("vgGetMatrix m=0x%x", m);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   661
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   662
	TGuestOpenVg::vgGetMatrix(m);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   663
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   664
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   665
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   666
 Read pixel values from a rectangular portion of an image, performs format conversion
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   667
 if necessary, and stores the resulting pixels into memory.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   668
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   669
 Pixel values are written starting at the address given by the pointer data; adjacent
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   670
 scanlines are separated by dataStride bytes. Negative or zero values of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   671
 dataStride are allowed. The region to be read is given by x, y, width, and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   672
 height, which must define a positive region. Pixels that fall outside the bounds
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   673
 of the image are ignored.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   674
 Pixel values in memory are formatted according to the dataFormat parameter, which
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   675
 must contain a value from the VGImageFormat enumeration. If dataFormat
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   676
 specifies a premultiplied format (VG_sRGBA_8888_PRE or VG_lRGBA_8888_PRE),
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   677
 color channel values of a pixel that are greater than their corresponding alpha value are
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   678
 clamped to the range [0, alpha]. The data pointer alignment and the pixel layout in
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   679
 memory are as described in the vgImageSubData section.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   680
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   681
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   682
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   683
   – if image is not a valid image handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   684
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   685
   – if image is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   686
   VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   687
   – if dataFormat is not a valid value from the VGImageFormat enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   688
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   689
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   690
   – if data is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   691
   – if data is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   692
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   693
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   694
	vgGetImageSubData(VGImage image,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   695
		void * data,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   696
		VGint dataStride,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   697
		VGImageFormat dataFormat,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   698
		VGint x, VGint y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   699
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   700
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   701
	OPENVG_TRACE("vgGetImageSubData image=0x%x, data=0x%x, dataStride=%d, dataFormat=0x%x, x=%d, y=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   702
			image, data, dataStride, dataFormat, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   703
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   704
	TGuestOpenVg::vgGetImageSubData(image, data, dataStride, dataFormat, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   705
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   706
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   707
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   708
 Copy pixel data from the drawing surface without the creation of a VGImage object.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   709
 Pixel values are written starting at the address given by the pointer data; adjacent
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   710
 scanlines are separated by dataStride bytes. Negative or zero values of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   711
 dataStride are allowed. The region to be read is given by x, y, width, and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   712
 height, which must define a positive region.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   713
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   714
 Pixel values in memory are formatted according to the dataFormat parameter, which
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   715
 must contain a value from the VGImageFormat enumeration. The data pointer
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   716
 alignment and the pixel layout in memory is as described for vgImageSubData.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   717
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   718
 Pixels whose source lies outside of the bounds of the drawing surface are
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   719
 ignored. Pixel format conversion is applied as needed. The scissoring region
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   720
 does not affect the reading of pixels.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   721
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   722
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   723
   VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   724
   – if dataFormat is not a valid value from the VGImageFormat enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   725
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   726
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   727
   – if data is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   728
   – if data is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   729
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   730
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   731
	vgReadPixels(void * data, VGint dataStride,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   732
		VGImageFormat dataFormat,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   733
		VGint sx, VGint sy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   734
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   735
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   736
	OPENVG_TRACE("vgReadPixels data=0x%x, dataStride=%d, dataFormat=0x%x, sx=%d, sy=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   737
			data, dataStride, dataFormat, sx, sy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   738
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   739
	TGuestOpenVg::vgReadPixels(data, dataStride, dataFormat, sx, sy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   740
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   741
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   742
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   743
 Returns an axis-aligned bounding box that tightly bounds the interior of the given
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   744
 path. Stroking parameters are ignored. If path is empty, minX and minY are set to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   745
 and width and height are set to -1. If path contains a single point, minX and minY
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   746
 are set to the coordinates of the point and width and height are set to 0.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   747
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   748
 The VG_PATH_CAPABILITY_PATH_BOUNDS capability must be enabled for path.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   749
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   750
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   751
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   752
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   753
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   754
   – if minX, minY, width, or height is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   755
   – if minX, minY, width, or height is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   756
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   757
   – if VG_PATH_CAPABILITY_PATH_BOUNDS is not enabled for path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   758
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   759
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   760
	vgPathBounds(VGPath path,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   761
		VGfloat * minX,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   762
		VGfloat * minY,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   763
		VGfloat * width,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   764
		VGfloat * height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   765
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   766
	OPENVG_TRACE("vgPathBounds path=0x%x, minX=0x%x, minY=0x%x, width=0x%x, height=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   767
			path, minX, minY, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   768
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   769
	TGuestOpenVg::vgPathBounds(path, minX, minY, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   770
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   771
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   772
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   773
 The vgPathTransformedBounds function returns an axis-aligned bounding box
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   774
 that is guaranteed to enclose the geometry of the given path following
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   775
 transformation by the current path-user-to-surface transform. The returned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   776
 bounding box is not guaranteed to fit tightly around the path geometry. If path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   777
 is empty, minX and minY are set to 0 and width and height are set to -1. If
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   778
 path contains a single point, minX and minY are set to the transformed
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   779
 coordinates of the point and width and height are set to 0.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   780
 The VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS capability must be
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   781
 enabled for path.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   782
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   783
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   784
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   785
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   786
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   787
   – if minX, minY, width, or height is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   788
   – if minX, minY, width, or height is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   789
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   790
   – if VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS is not enabled
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   791
     for path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   792
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   793
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   794
	vgPathTransformedBounds(VGPath path,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   795
		VGfloat * minX,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   796
		VGfloat * minY,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   797
		VGfloat * width,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   798
		VGfloat * height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   799
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   800
	OPENVG_TRACE("vgPathTransformedBounds path=0x%x, minX=0x%x, minY=0x%x, width=0x%x, height=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   801
					path, minX, minY, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   802
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   803
	TGuestOpenVg::vgPathTransformedBounds(path, minX, minY, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   804
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   805
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   806
////////////////////////////////////////////////////////////////////////////////////////////
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   807
//Syncing methods
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   808
////////////////////////////////////////////////////////////////////////////////////////////
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   809
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   810
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   811
 Ensures that all outstanding requests on the current context will complete in finite time.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   812
 vgFlush may return prior to the actual completion of all requests.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   813
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   814
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   815
	vgFlush(void)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   816
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   817
	// ToDo comment
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   818
	OPENVG_TRACE("vgFlush");
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   819
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   820
	MVgContext* vgContext = CVghwUtils::VgContext();
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   821
	if (vgContext)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   822
		{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   823
		vgContext->ExecuteVgFlushCommand();
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   824
		}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   825
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   826
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   827
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   828
 The vgFinish function forces all outstanding requests on the current context to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   829
 complete, returning only when the last request has completed.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   830
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   831
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   832
	vgFinish(void)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   833
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   834
	// ToDo comment
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   835
	OPENVG_TRACE("vgFinish");
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   836
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   837
	MVgContext* vgContext = CVghwUtils::VgContext();
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   838
	if (vgContext)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   839
		{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   840
		vgContext->ExecuteVgFinishCommand();
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   841
		}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   842
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   843
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   844
////////////////////////////////////////////////////////////////////////////////////////////
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   845
//Functions not returning value (possible to buffer)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   846
////////////////////////////////////////////////////////////////////////////////////////////
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   847
/* Getters and Setters */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   848
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   849
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   850
 The vgSet functions set the value of a parameter on the current context.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   851
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   852
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   853
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   854
   – if paramType is not a valid value from the VGParamType enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   855
   – if paramType refers to a vector parameter in vgSetf or vgSeti
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   856
   – if value is not a legal enumerated value for the given parameter in vgSetf or
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   857
     vgSeti
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   858
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   859
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   860
   vgSetf (VGParamType type, VGfloat value)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   861
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   862
	OPENVG_TRACE("vgSetf type=0x%x, value=%f", type, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   863
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   864
	TGuestOpenVg::vgSetf(type, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   865
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   866
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   867
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   868
	vgSeti (VGParamType type, VGint value)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   869
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   870
	OPENVG_TRACE("vgSeti type=0x%x, value=%d", type, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   871
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   872
	TGuestOpenVg::vgSeti(type, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   873
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   874
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   875
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   876
 The vgSet functions set the value of a parameter on the current context.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   877
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   878
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   879
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   880
   – if paramType is not a valid value from the VGParamType enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   881
   – if paramType refers to a scalar parameter in vgSetfv or vgSetiv and count is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   882
     not equal to 1
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   883
   – if values[i] is not a legal enumerated value for the given parameter in vgSetfv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   884
     or vgSetiv for 0 <= i < count
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   885
   – if values is NULL in vgSetfv or vgSetiv and count is greater than 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   886
   – if values is not properly aligned in vgSetfv or vgSetiv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   887
   – if count is less than 0 in vgSetfv or vgSetiv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   888
   – if count is not a valid value for the given parameter
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   889
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   890
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   891
	vgSetfv(VGParamType type, VGint count,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   892
		const VGfloat * values)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   893
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   894
	OPENVG_TRACE("vgSetfv type=0x%x, count=%d, values=0x%x", type, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   895
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   896
	TGuestOpenVg::vgSetfv(type, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   897
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   898
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   899
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   900
	vgSetiv(VGParamType type, VGint count,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   901
		const VGint * values)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   902
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   903
	OPENVG_TRACE("vgSetiv type=0x%x, count=%d, values=0x%x", type, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   904
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   905
	TGuestOpenVg::vgSetiv(type, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   906
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   907
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   908
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   909
 For vgSetParameterf and vgSetParameteri.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   910
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   911
 The vgSetParameter functions set the value of a parameter on a given VGHandlebased
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   912
 object.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   913
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   914
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   915
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   916
   – if object is not a valid handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   917
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   918
   – if paramType is not a valid value from the appropriate enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   919
   – if paramType refers to a vector parameter in vgSetParameterf or
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   920
     vgSetParameteri
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   921
   – if value is not a legal enumerated value for the given parameter in
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   922
     vgSetParameterf or vgSetParameteri
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   923
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   924
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   925
	vgSetParameterf(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   926
		VGint paramType,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   927
		VGfloat value)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   928
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   929
	OPENVG_TRACE("vgSetParameterf object=0x%x, paramType=0x%x, value=%f -->", object, paramType, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   930
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   931
	TGuestOpenVg::vgSetParameterf(object, paramType, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   932
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   933
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   934
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   935
	vgSetParameteri(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   936
		VGint paramType,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   937
		VGint value)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   938
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   939
	OPENVG_TRACE("vgSetParameteri object=0x%x, paramType=0x%x, value=0x%x", object, paramType, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   940
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   941
	TGuestOpenVg::vgSetParameteri(object, paramType, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   942
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   943
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   944
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   945
 For vgSetParameterfv and vgSetParameteriv.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   946
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   947
 The vgSetParameter functions set the value of a parameter on a given VGHandlebased
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   948
 object.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   949
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   950
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   951
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   952
   – if object is not a valid handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   953
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   954
   – if paramType is not a valid value from the appropriate enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   955
   – if paramType refers to a scalar parameter in vgSetParameterfv or
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   956
     vgSetParameteriv and count is not equal to 1
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   957
   – if values[i] is not a legal enumerated value for the given parameter
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   958
     in vgSetParameterfv or vgSetParameteriv for 0 <= i < count
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   959
   – if values is NULL in vgSetParameterfv or vgSetParameteriv and count is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   960
     greater than 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   961
   – if values is not properly aligned in vgSetParameterfv or vgSetParameteriv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   962
   – if count is less than 0 in vgSetParameterfv or vgSetParameteriv
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   963
   – if count is not a valid value for the given parameter
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   964
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   965
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   966
	vgSetParameterfv(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   967
		VGint paramType,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   968
		VGint count,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   969
		const VGfloat * values)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   970
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   971
	OPENVG_TRACE("vgSetParameterfv object=0x%x, paramType=%d, count=%d, values=0x%x", object, paramType, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   972
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   973
	TGuestOpenVg::vgSetParameterfv(object, paramType, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   974
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   975
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   976
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   977
	vgSetParameteriv(VGHandle object,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   978
		VGint paramType,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   979
		VGint count,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   980
		const VGint * values)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   981
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   982
	OPENVG_TRACE("vgSetParameteriv object=0x%x, paramType=%d, count=%d, values=0x%x", object, paramType, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   983
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   984
	TGuestOpenVg::vgSetParameteriv(object, paramType, count, values);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   985
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   986
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   987
/* Matrix Manipulation */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   988
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   989
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   990
 Sets the current matrix M to the identity matrix:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   991
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   992
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   993
	vgLoadIdentity(void)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   994
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   995
	OPENVG_TRACE("vgLoadIdentity");
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   996
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   997
	TGuestOpenVg::vgLoadIdentity();
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   998
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
   999
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1000
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1001
 Loads an arbitrary set of matrix values into the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1002
 matrix. Nine matrix values are read from m, in the order:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1003
   { sx, shy, w0, shx, sy, w1, tx, ty, w2 }
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1004
 However, if the targeted matrix is affine (i.e., the matrix mode is not
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1005
 VG_MATRIX_IMAGE_USER_TO_SURFACE), the values { w0, w1, w2 } are ignored and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1006
 replaced by the values { 0, 0, 1 }.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1007
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1008
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1009
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1010
   – if m is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1011
   – if m is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1012
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1013
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1014
	vgLoadMatrix(const VGfloat * m)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1015
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1016
	OPENVG_TRACE("vgLoadMatrix m=0x%x", m);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1017
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1018
	TGuestOpenVg::vgLoadMatrix(m);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1019
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1020
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1021
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1022
 Right-multiplies the current matrix M by a given matrix:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1023
   Nine matrix values are read from m in the order:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1024
   { sx, shy, w0, shx, sy, w1, tx, ty, w2 }
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1025
 and the current matrix is multiplied by the resulting matrix. However, if the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1026
 targeted matrix is affine (i.e., the matrix mode is not
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1027
 VG_MATRIX_IMAGE_USER_TO_SURFACE), the values { w0, w1, w2 } are ignored
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1028
 and replaced by the values { 0, 0, 1 } prior to multiplication.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1029
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1030
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1031
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1032
   – if m is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1033
   – if m is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1034
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1035
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1036
	vgMultMatrix(const VGfloat * m)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1037
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1038
	OPENVG_TRACE("vgMultMatrix m=0x%x", m);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1039
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1040
	TGuestOpenVg::vgMultMatrix(m);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1041
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1042
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1043
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1044
 Modifies the current transformation by appending a  translation. This is equivalent
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1045
 to right-multiplying the current matrix M by a translation matrix:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1046
    [ 1  0  tx ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1047
    [ 0  1  ty ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1048
    [ 0  0  1  ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1049
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1050
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1051
	vgTranslate(VGfloat tx, VGfloat ty)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1052
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1053
	OPENVG_TRACE("vgTranslate tx=%f, ty=%f", tx, ty);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1054
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1055
	TGuestOpenVg::vgTranslate(tx, ty);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1056
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1057
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1058
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1059
 Modifies the current transformation by appending a scale. This is equivalent to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1060
 right-multiplying the current matrix M by a scale matrix:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1061
    [ sx  0   0 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1062
    [ 0   sy  0 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1063
    [ 0   0   1 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1064
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1065
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1066
	vgScale(VGfloat sx, VGfloat sy)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1067
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1068
	OPENVG_TRACE("vgScale sx=%f, sy=%f", sx, sy);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1069
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1070
	TGuestOpenVg::vgScale(sx, sy);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1071
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1072
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1073
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1074
 Modifies the current transformation by appending a shear. This is equivalent to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1075
 right-multiplying the current matrix M by a shear matrix:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1076
   [  1  shx  0 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1077
   [ shy  1   0 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1078
   [  0   0   1 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1079
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1080
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1081
	vgShear(VGfloat shx, VGfloat shy)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1082
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1083
	OPENVG_TRACE("vgShear shx=%f, shy=%f", shx, shy);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1084
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1085
	TGuestOpenVg::vgShear(shx, shy);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1086
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1087
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1088
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1089
 Modifies the current transformation by appending a counterclockwise rotation by a given
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1090
 angle (expressed in degrees) about the origin. This is equivalent to right-multiplying
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1091
 the current matrix M by the following matrix (using the symbol a to represent the value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1092
 of the angle parameter):
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1093
   [ cos(a) -sin(a)  0 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1094
   [ sin(a)  cos(a)  0 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1095
   [  0       0      1 ]
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1096
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1097
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1098
	vgRotate(VGfloat angle)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1099
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1100
	OPENVG_TRACE("vgRotate angle=%f");
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1101
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1102
	TGuestOpenVg::vgRotate(angle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1103
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1104
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1105
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1106
 Modifies the drawing surface mask values according to a given operation, possibly
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1107
 using coverage values taken from a mask layer or bitmap image given by the mask
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1108
 parameter. If no mask is configured for the current drawing surface, vgMask has
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1109
 no effect.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1110
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1111
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1112
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1113
   – if operation is not VG_CLEAR_MASK or VG_FILL_MASK, and mask is not a
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1114
     valid mask layer or image handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1115
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1116
   – if mask is a VGImage that is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1117
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1118
   – if operation is not a valid value from the VGMaskOperation
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1119
     enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1120
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1121
   – if mask is a VGMaskLayer and is not compatible with the current surface
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1122
     mask
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1123
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1124
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1125
	vgMask(VGHandle mask, VGMaskOperation operation,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1126
		VGint x, VGint y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1127
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1128
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1129
	OPENVG_TRACE("vgMask mask=0x%x, operation=0x%x, x=%d, y=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1130
			mask, operation, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1131
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1132
	TGuestOpenVg::vgMask(mask, operation, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1133
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1134
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1135
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1136
 Modifies the current surface mask by applying the given operation to the set of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1137
 coverage values associated with the rendering of the given path. If paintModes
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1138
 contains VG_FILL_PATH, the path is filled; if it contains VG_STROKE_PATH, the path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1139
 is stroked. If both are present, the mask operation is performed in two passes,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1140
 first on the filled path geometry, then on the stroked path geometry.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1141
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1142
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1143
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1144
   – if path is not a valid path handle
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1145
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1146
   – if paintModes is not a valid bitwise OR of values from the VGPaintMode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1147
     enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1148
   – if operation is not a valid value from the VGMaskOperation enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1149
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1150
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1151
	vgRenderToMask(VGPath path,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1152
		VGbitfield paintModes,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1153
		VGMaskOperation operation)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1154
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1155
	OPENVG_TRACE("vgRenderToMask path=0x%x, paintModes=0x%x, operation=0x%x", path, paintModes, operation);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1156
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1157
	TGuestOpenVg::vgRenderToMask(path, paintModes, operation);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1158
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1159
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1160
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1161
 Deallocate the resources associated with a mask layer. Following the call,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1162
 the maskLayer handle is no longer valid in the current context.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1163
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1164
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1165
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1166
   – if maskLayer is not a valid mask handle
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1167
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1168
EXPORT_C void vgDestroyMaskLayer(VGMaskLayer maskLayer)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1169
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1170
	OPENVG_TRACE("vgDestroyMaskLayer maskLayer=0x%x", maskLayer);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1171
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1172
	TGuestOpenVg::vgDestroyMaskLayer(maskLayer);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1173
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1174
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1175
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1176
 Set the values of a given maskLayer within a given rectangular region to a given
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1177
 value. The floating-point value value must be between 0 and 1. The value is rounded
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1178
 to the closest available value supported by the mask layer. If two values are equally
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1179
 close, the larger value is used.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1180
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1181
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1182
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1183
   – if maskLayer is not a valid mask layer handle, or is not shared with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1184
     current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1185
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1186
   – if value is less than 0 or greater than 1
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1187
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1188
   – if x or y is less than 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1189
   – if x + width is greater than the width of the mask
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1190
   – if y + height is greater than the height of the mask
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1191
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1192
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1193
	vgFillMaskLayer(VGMaskLayer maskLayer,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1194
		VGint x, VGint y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1195
		VGint width, VGint height,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1196
		VGfloat value)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1197
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1198
	OPENVG_TRACE("vgFillMaskLayer maskLayer=0x%x, x=%d, y=%d, width=%d, height=%d, value=%f",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1199
			maskLayer, x, y, width, height, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1200
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1201
	TGuestOpenVg::vgFillMaskLayer(maskLayer, x, y, width, height, value);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1202
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1203
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1204
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1205
 Copies a portion of the current surface mask into a VGMaskLayer object. The source
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1206
 region starts at (sx, sy) in the surface mask, and the destination region starts
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1207
 at (dx, dy) in the destination maskLayer. The copied region is clipped to the given
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1208
 width and height and the bounds of the source and destination. If the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1209
 does not contain a surface mask, vgCopyMask does nothing.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1210
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1211
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1212
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1213
   – if maskLayer is not a valid mask layer handle
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1214
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1215
   – if width or height are less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1216
   – if maskLayer is not compatible with the current surface mask
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1217
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1218
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1219
	vgCopyMask(VGMaskLayer maskLayer,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1220
		VGint sx, VGint sy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1221
		VGint dx, VGint dy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1222
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1223
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1224
	OPENVG_TRACE("vgCopyMask maskLayer=0x%x, sx=%d, sy=%d, dx=%d, dy=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1225
			maskLayer, sx, sy, dx, dy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1226
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1227
	TGuestOpenVg::vgCopyMask(maskLayer, sx, sy, dx, dy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1228
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1229
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1230
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1231
 Fills the portion of the drawing surface intersecting the rectangle extending from
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1232
 pixel (x, y) and having the given width and height with a constant color value, taken
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1233
 from the VG_CLEAR_COLOR parameter. The color value is expressed in non-premultiplied
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1234
 sRGBA (sRGB color plus alpha)format. Values outside the [0, 1] range are interpreted
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1235
 as the nearest endpoint of the range. The color is converted to the destination color
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1236
 space in the same manner as if a rectangular path were being filled. Clipping and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1237
 scissoring take place in the usual fashion, but antialiasing, masking, and blending
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1238
 do not occur.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1239
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1240
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1241
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1242
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1243
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1244
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1245
	vgClear(VGint x, VGint y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1246
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1247
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1248
	OPENVG_TRACE("vgClear x=%d, y=%d, width=%d, height=%d", x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1249
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1250
	TGuestOpenVg::vgClear(x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1251
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1252
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1253
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1254
/* Paths */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1255
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1256
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1257
 Remove all segment command and coordinate data associated with a path. The handle
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1258
 continues to be valid for use in the future, and the path format and datatype retain
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1259
 their existing values. The capabilities argument is a bitwise OR of the desired
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1260
 VGPathCapabilities values. Bits of capabilities that do not correspond to values from
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1261
 VGPathCapabilities have no effect. Using vgClearPath may be more efficient than
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1262
 destroying and re-creating a path for short-lived paths.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1263
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1264
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1265
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1266
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1267
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1268
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1269
	vgClearPath(VGPath path, VGbitfield capabilities)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1270
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1271
	OPENVG_TRACE("vgClearPath path=0x%x, capabilities=0x%x", path, capabilities);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1272
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1273
	TGuestOpenVg::vgClearPath(path, capabilities);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1274
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1275
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1276
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1277
 Release any resources associated with path, and makes the handle invalid in all
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1278
 contexts that shared it.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1279
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1280
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1281
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1282
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1283
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1284
EXPORT_C void vgDestroyPath(VGPath path)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1285
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1286
	OPENVG_TRACE("vgDestroyPath path=0x%x", path);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1287
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1288
	TGuestOpenVg::vgDestroyPath(path);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1289
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1290
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1291
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1292
 Requests the set of capabilities specified in the capabilities argument to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1293
 be disabled for the given path. The capabilities argument is a bitwise OR of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1294
 the VGPathCapabilities values whose removal is requested. Attempting to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1295
 remove a capability that is already disabled has no effect. Bits of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1296
 capabilities that do not correspond to values from VGPathCapabilities have
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1297
 no effect.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1298
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1299
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1300
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1301
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1302
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1303
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1304
	vgRemovePathCapabilities(VGPath path,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1305
		VGbitfield capabilities)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1306
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1307
	OPENVG_TRACE("vgRemovePathCapabilities path=0x%x, capabilities=0x%x", path, capabilities);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1308
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1309
	TGuestOpenVg::vgRemovePathCapabilities(path, capabilities);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1310
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1311
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1312
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1313
 Appends a copy of all path segments from srcPath onto the end of the existing
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1314
 data in dstPath. It is legal for srcPath and dstPath to be handles to the same
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1315
 path object, in which case the contents of the path are duplicated. If srcPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1316
 and dstPath are handles to distinct path objects, the contents of srcPath will
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1317
 not be affected by the call.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1318
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1319
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1320
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1321
   – if either dstPath or srcPath is not a valid path handle, or is not shared
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1322
     with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1323
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1324
   – if VG_PATH_CAPABILITY_APPEND_FROM is not enabled for srcPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1325
   – if VG_PATH_CAPABILITY_APPEND_TO is not enabled for dstPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1326
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1327
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1328
	vgAppendPath(VGPath dstPath, VGPath srcPath)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1329
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1330
	OPENVG_TRACE("vgAppendPath dstPath=0x%x, srcPath=0x%x", dstPath, srcPath);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1331
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1332
	TGuestOpenVg::vgAppendPath(dstPath, srcPath);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1333
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1334
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1335
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1336
 Appends data taken from pathData to the given path dstPath. The data are formatted
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1337
 using the path format of dstPath (as returned by querying the path’s VG_PATH_FORMAT
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1338
 parameter using vgGetParameteri). The numSegments parameter gives the total number
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1339
 of entries in the pathSegments array, and must be greater than 0. Legal values for
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1340
 the pathSegments array are the values from the VGPathCommand enumeration as well as
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1341
 VG_CLOSE_PATH and (VG_CLOSE_PATH | VG_RELATIVE) (which are synonymous).
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1342
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1343
 The pathData pointer must be aligned on a 1-, 2-, or 4-byte boundary (as defined in
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1344
 the “Bytes” column of Open VG spec Table 7) depending on the size of the coordinate
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1345
 datatype (as returned by querying the path’s VG_PATH_DATATYPE parameter using
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1346
 vgGetParameteri). The VG_PATH_CAPABILITY_APPEND_TO capability must be enabled for
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1347
 path.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1348
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1349
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1350
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1351
   – if dstPath is not a valid path handle, or is not shared with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1352
     context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1353
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1354
   – if VG_PATH_CAPABILITY_APPEND_TO is not enabled for dstPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1355
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1356
   – if pathSegments or pathData is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1357
   – if pathData is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1358
   – if numSegments is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1359
   – if pathSegments contains an illegal command
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1360
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1361
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1362
	vgAppendPathData(VGPath dstPath,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1363
		VGint numSegments,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1364
		const VGubyte * pathSegments,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1365
		const void * pathData)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1366
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1367
	OPENVG_TRACE("vgAppendPathData dstPath=0x%x, numSegments=%d, pathSegments=0x%x, pathData=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1368
			dstPath, numSegments, pathSegments, pathData);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1369
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1370
	TGuestOpenVg::vgAppendPathData(dstPath, numSegments, pathSegments, pathData);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1371
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1372
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1373
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1374
 Modifies the coordinate data for a contiguous range of segments of dstPath, starting
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1375
 at startIndex (where 0 is the index of the first path segment) and having length
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1376
 numSegments. The data in pathData must be formatted in exactly the same manner as the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1377
 original coordinate data for the given segment range, unless the path has been
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1378
 transformed using vgTransformPath or interpolated using vgInterpolatePath. In these
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1379
 cases, the path will have been subject to the segment promotion rules specified in
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1380
 those functions.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1381
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1382
 The pathData pointer must be aligned on a 1-, 2-, or 4-byte boundary
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1383
 depending on the size of the coordinate datatype (as returned by querying the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1384
 path’s VG_PATH_DATATYPE parameter using vgGetParameteri). The
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1385
 VG_PATH_CAPABILITY_MODIFY capability must be enabled for path.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1386
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1387
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1388
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1389
   – if dstPath is not a valid path handle, or is not shared with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1390
     context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1391
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1392
   – if VG_PATH_CAPABILITY_MODIFY is not enabled for dstPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1393
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1394
   – if pathData is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1395
   – if pathData is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1396
   – if startIndex is less than 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1397
   – if numSegments is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1398
   – if startIndex + numSegments is greater than the number of segments in the path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1399
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1400
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1401
	vgModifyPathCoords(VGPath dstPath,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1402
		VGint startIndex,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1403
		VGint numSegments,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1404
		const void * pathData)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1405
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1406
	OPENVG_TRACE("vgModifyPathCoords dstPath=0x%x, startIndex=%d, numSegments=%d, pathData=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1407
			dstPath, startIndex, numSegments, pathData);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1408
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1409
	TGuestOpenVg::vgModifyPathCoords(dstPath, startIndex, numSegments, pathData);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1410
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1411
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1412
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1413
 Appends a transformed copy of srcPath to the current contents of dstPath.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1414
 The appended path is equivalent to the results of applying the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1415
 pathuser-to-surface transformation (VG_MATRIX_PATH_USER_TO_SURFACE) to srcPath.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1416
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1417
 It is legal for srcPath and dstPath to be handles to the same path object, in
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1418
 which case the transformed path will be appended to the existing path. If
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1419
 srcPath and dstPath are handles to distinct path objects, the contents of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1420
 srcPath will not be affected by the call.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1421
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1422
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1423
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1424
   – if either dstPath or srcPath is not a valid path handle, or is not shared with
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1425
     the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1426
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1427
   – if VG_PATH_CAPABILITY_TRANSFORM_FROM is not enabled for srcPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1428
   – if VG_PATH_CAPABILITY_TRANSFORM_TO is not enabled for dstPath
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1429
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1430
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1431
	vgTransformPath(VGPath dstPath, VGPath srcPath)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1432
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1433
	OPENVG_TRACE("vgTransformPath dstPath=0x%x, srcPath=0x%x", dstPath, srcPath);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1434
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1435
	TGuestOpenVg::vgTransformPath(dstPath, srcPath);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1436
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1437
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1438
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1439
 Returns the point lying a given distance along a given portion of a path and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1440
 the unit-length tangent vector at that point. Only the subpath consisting of the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1441
 numSegments path segments beginning with startSegment (where the initial path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1442
 segment has index 0) is used. For the remainder of this section we refer only to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1443
 this subpath when discussing paths.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1444
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1445
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1446
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1447
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1448
   VG_PATH_CAPABILITY_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1449
   – If x and y are both non-NULL, and the VG_PATH_CAPABILITY_POINT_ALONG_PATH is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1450
     not enabled for path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1451
   – If tangentX and tangentY are both non-NULL, and the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1452
     VG_PATH_CAPABILITY_TANGENT_ALONG_PATH capability is not enabled for path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1453
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1454
   – if startSegment is less than 0 or greater than the index of the final path
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1455
     segment
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1456
   – if numSegments is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1457
   – if (startSegment + numSegments – 1) is less than 0 or greater than the index
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1458
     of the final path segment
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1459
   – if x, y, tangentX or tangentY is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1460
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1461
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1462
	vgPointAlongPath(VGPath path,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1463
		VGint startSegment,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1464
		VGint numSegments,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1465
		VGfloat distance,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1466
		VGfloat * x, VGfloat * y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1467
		VGfloat * tangentX,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1468
		VGfloat * tangentY)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1469
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1470
	OPENVG_TRACE("vgPointAlongPath path=0x%x, startSeg=%d, numSegs=%d, distance=%f, x=0x%x, y=0x%x, tangentX=0x%x, tangentY=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1471
			path, startSegment, numSegments, distance, x, y, tangentX, tangentY);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1472
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1473
	TGuestOpenVg::vgPointAlongPath(path, startSegment, numSegments, distance, x, y, tangentX, tangentY);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1474
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1475
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1476
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1477
 Performs filling and stroking. The paintModes argument is a bitwise OR of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1478
 values from the VGPaintMode enumeration, determining whether the path is to be
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1479
 filled (VG_FILL_PATH), stroked (VG_STROKE_PATH), or both (VG_FILL_PATH |
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1480
 VG_STROKE_PATH). If both filling and stroking are to be performed, the path is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1481
 first filled, then stroked.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1482
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1483
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1484
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1485
   – if path is not a valid path handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1486
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1487
   – if paintModes is not a valid bitwise OR of values from the VGPaintMode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1488
     enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1489
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1490
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1491
	vgDrawPath(VGPath path, VGbitfield paintModes)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1492
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1493
	OPENVG_TRACE("vgDrawPath path=0x%x paintModes=0x%x", path, paintModes);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1494
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1495
	TGuestOpenVg::vgDrawPath(path, paintModes);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1496
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1497
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1498
/* Paint */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1499
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1500
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1501
 Deallocates the resources associated with a paint object. Following the call, the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1502
 paint handle is no longer valid in any of the contexts that shared it. If the paint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1503
 object is currently active in a drawing context, the context continues to access it
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1504
 until it is replaced or the context is destroyed.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1505
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1506
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1507
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1508
   – if paint is not a valid paint handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1509
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1510
EXPORT_C void vgDestroyPaint(VGPaint paint)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1511
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1512
	OPENVG_TRACE("vgDestroyPaint paint=0x%x", paint);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1513
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1514
	TGuestOpenVg::vgDestroyPaint(paint);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1515
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1516
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1517
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1518
 Set paint definitions on the current context. The paintModes argument is a
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1519
 bitwise OR of values from the VGPaintMode enumeration, determining whether
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1520
 the paint object is to be used for filling (VG_FILL_PATH), stroking
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1521
 (VG_STROKE_PATH), or both (VG_FILL_PATH | VG_STROKE_PATH). The current paint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1522
 replaces the previously set paint object, if any, for the given paint mode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1523
 or modes. If paint is equal to VG_INVALID_HANDLE, the previously set paint
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1524
 object for the given mode (if present) is removed and the paint settings are
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1525
 restored to their default values.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1526
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1527
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1528
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1529
   – if paint is neither a valid paint handle nor equal to VG_INVALID_HANDLE,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1530
     or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1531
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1532
   – if paintModes is not a valid bitwise OR of values from the VGPaintMode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1533
     enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1534
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1535
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1536
	vgSetPaint(VGPaint paint, VGbitfield paintModes)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1537
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1538
	OPENVG_TRACE("vgSetPaint paint=0x%x, paintModes=0x%x", paint, paintModes);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1539
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1540
	TGuestOpenVg::vgSetPaint(paint, paintModes);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1541
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1542
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1543
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1544
 As a shorthand, the vgSetColor function allows the VG_PAINT_COLOR parameter of a
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1545
 given paint object to be set using a 32-bit non-premultiplied sRGBA_8888
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1546
 representation. The rgba parameter is a VGuint with 8 bits of red starting at the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1547
 most significant bit, followed by 8 bits each of green, blue, and alpha. Each color
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1548
 or alpha channel value is conceptually divided by 255. So as to obtain a value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1549
 between 0 and 1.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1550
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1551
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1552
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1553
   – if paint is not a valid paint handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1554
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1555
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1556
	vgSetColor(VGPaint paint, VGuint rgba)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1557
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1558
	OPENVG_TRACE("vgSetColor paint=0x%x, rgba=0x%x", paint, rgba);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1559
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1560
	TGuestOpenVg::vgSetColor(paint, rgba);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1561
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1562
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1563
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1564
 Replaces any previous pattern image defined on the given paint object for the given
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1565
 set of paint modes with a new pattern image. A value of VG_INVALID_HANDLE for the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1566
 pattern parameter removes the current pattern image from the paint object.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1567
 If the current paint object has its VG_PAINT_TYPE parameter set to VG_PAINT_TYPE_PATTERN,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1568
 but no pattern image is set, the paint object behaves as if VG_PAINT_TYPE were set to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1569
 VG_PAINT_TYPE_COLOR. While an image is set as the paint pattern for any paint object, it
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1570
 may not be used as a rendering target. Conversely, an image that is currently a rendering
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1571
 target may not be set as a paint pattern.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1572
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1573
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1574
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1575
   – if paint is not a valid paint handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1576
   – if pattern is neither a valid image handle nor equal to VG_INVALID_HANDLE, or is not
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1577
     shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1578
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1579
   – if pattern is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1580
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1581
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1582
	vgPaintPattern(VGPaint paint, VGImage pattern)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1583
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1584
	OPENVG_TRACE("vgPaintPattern paint=0x%x, pattern=0x%x", paint, pattern);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1585
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1586
	TGuestOpenVg::vgPaintPattern(paint, pattern);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1587
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1588
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1589
/* Images */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1590
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1591
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1592
 Deallocates the resources associated with an image. Following the call, the image
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1593
 handle is no longer valid in any context that shared it. If the image is currently
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1594
 in use as a rendering target, is the ancestor of another image (see vgChildImage),
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1595
 is set as a paint pattern image on a VGPaint object, or is set as a glyph an a
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1596
 VGFont object, its definition remains available to those consumers as long as they
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1597
 remain valid, but the handle may no longer be used. When those uses cease, the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1598
 image’s resources will automatically be deallocated.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1599
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1600
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1601
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1602
   – if image is not a valid image handle, or is not shared with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1603
	 context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1604
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1605
EXPORT_C void vgDestroyImage(VGImage image)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1606
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1607
	OPENVG_TRACE("vgDestroyImage image=0x%x -->", image);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1608
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1609
	TGuestOpenVg::vgDestroyImage(image);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1610
	OPENVG_TRACE("vgDestroyImage <--");
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1611
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1612
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1613
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1614
 Fills a given rectangle of an image with the color specified by the VG_CLEAR_COLOR parameter.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1615
 The rectangle to be cleared is given by x, y, width, and height, which must define a positive
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1616
 region. The rectangle is clipped to the bounds of the image.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1617
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1618
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1619
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1620
   – if image is not a valid image handle, or is not shared with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1621
     context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1622
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1623
   – if image is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1624
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1625
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1626
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1627
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1628
	vgClearImage(VGImage image,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1629
		VGint x, VGint y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1630
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1631
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1632
	OPENVG_TRACE("vgClearImage image=0x%x, x=%d, y=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1633
			image, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1634
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1635
	TGuestOpenVg::vgClearImage(image, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1636
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1637
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1638
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1639
 Read pixel values from memory, perform format conversion if necessary, and store
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1640
 the resulting pixels into a rectangular portion of an image.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1641
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1642
 Pixel values are read starting at the address given by the pointer data; adjacent
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1643
 scanlines are separated by dataStride bytes. Negative or zero values of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1644
 dataStride are allowed. The region to be written is given by x, y, width, and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1645
 height, which must define a positive region. Pixels that fall outside the bounds
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1646
 of the image are ignored.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1647
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1648
 Pixel values in memory are formatted according to the dataFormat parameter, which
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1649
 must contain a value from the VGImageFormat enumeration. The data pointer must
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1650
 be aligned according to the number of bytes of the pixel format specified by
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1651
 dataFormat, unless dataFormat is equal to VG_BW_1, VG_A_1, or VG_A_4, in
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1652
 which case 1 byte alignment is sufficient. Each pixel is converted into the format of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1653
 the destination image as it is written.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1654
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1655
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1656
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1657
   – if image is not a valid image handle, or is not shared with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1658
     context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1659
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1660
   – if image is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1661
   VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1662
   – if dataFormat is not a valid value from the VGImageFormat enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1663
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1664
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1665
   – if data is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1666
   – if data is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1667
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1668
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1669
	vgImageSubData(VGImage image,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1670
		const void * data,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1671
		VGint dataStride,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1672
		VGImageFormat dataFormat,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1673
		VGint x, VGint y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1674
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1675
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1676
	OPENVG_TRACE("vgImageSubData image=0x%x, data=0x%x, dataStride=%d, dataFormat=0x%x, x=%d, y=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1677
			image, data, dataStride, dataFormat, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1678
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1679
	TGuestOpenVg::vgImageSubData(image, data, dataStride, dataFormat, x, y, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1680
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1681
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1682
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1683
 Copies pixels between images. The source image pixel (sx + i, sy + j) is copied
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1684
 to the destination image pixel (dx + i, dy + j), for 0 <= i < width and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1685
 0 <= j < height. Pixels whose source or destination lie outside of the bounds
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1686
 of the respective image are ignored. Pixel format conversion is applied as needed.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1687
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1688
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1689
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1690
   – if either dst or src is not a valid image handle, or is not shared with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1691
     current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1692
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1693
   – if either dst or src is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1694
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1695
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1696
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1697
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1698
	vgCopyImage(VGImage dst, VGint dx, VGint dy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1699
		VGImage src, VGint sx, VGint sy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1700
		VGint width, VGint height,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1701
		VGboolean dither)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1702
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1703
	OPENVG_TRACE("vgCopyImage dst=0x%x, dx=%d, dy=%d, src=0x%x, sx=%d, sy=%d, width=%d, height=%d, dither=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1704
			dst, dx, dy, src, sx, sy, width, height, dither);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1705
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1706
	TGuestOpenVg::vgCopyImage(dst, dx, dy, src, sx, sy, width, height, dither);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1707
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1708
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1709
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1710
 Draw an image to the current drawing surface. The current image-user-to-surface
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1711
 transformation Ti is applied to the image, so that the image pixel centered at
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1712
 (px + 0.5, py + 0.5) is mapped to the point (Ti)(px + 0.5, py + 0.5). In practice,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1713
 backwards mapping may be used. That is, a sample located at (x, y) in the surface
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1714
 coordinate system is colored according to an interpolated image pixel value at the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1715
 point (Ti)-1(x, y) in the image coordinate system. If Ti is non-invertible (or nearly
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1716
 so, within the limits of numerical accuracy), no drawing occurs.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1717
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1718
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1719
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1720
   – if image is not a valid image handle, or is not shared with the current
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1721
     context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1722
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1723
   – if image is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1724
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1725
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1726
	vgDrawImage(VGImage image)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1727
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1728
	OPENVG_TRACE("vgDrawImage image=0x%x", image);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1729
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1730
	TGuestOpenVg::vgDrawImage(image);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1731
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1732
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1733
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1734
 Copies pixel data from the image src onto the drawing surface. The image pixel
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1735
 (sx + i, sy + j) is copied to the drawing surface pixel (dx + i, dy + j), for
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1736
 0 <= i < width and 0 <= j < height. Pixels whose source lies outside of the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1737
 bounds of src or whose destination lies outside the bounds of the drawing surface
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1738
 are ignored. Pixel format conversion is applied as needed. Scissoring takes place
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1739
 normally. Transformations, masking, and blending are not applied.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1740
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1741
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1742
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1743
   – if src is not a valid image handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1744
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1745
   – if src is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1746
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1747
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1748
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1749
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1750
	vgSetPixels(VGint dx, VGint dy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1751
		VGImage src, VGint sx, VGint sy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1752
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1753
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1754
	OPENVG_TRACE("vgSetPixels dx=%d, dy=%d, src==0x%x, sx=%d, sy=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1755
			dx, dy, src, sx, sy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1756
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1757
	TGuestOpenVg::vgSetPixels(dx, dy, src, sx, sy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1758
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1759
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1760
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1761
 Copy pixel data to the drawing surface without the creation of a VGImage object. The pixel
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1762
 values to be drawn are taken from the data pointer at the time of the vgWritePixels call,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1763
 so future changes to the data have no effect. The effects of changes to the data by another
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1764
 thread at the time of the call to vgWritePixels are undefined.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1765
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1766
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1767
   VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1768
   – if dataFormat is not a valid value from the VGImageFormat enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1769
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1770
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1771
   – if data is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1772
   – if data is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1773
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1774
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1775
	vgWritePixels(const void * data, VGint dataStride,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1776
		VGImageFormat dataFormat,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1777
		VGint dx, VGint dy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1778
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1779
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1780
	OPENVG_TRACE("vgWritePixels data=0x%x, dataStride=%d, dataFormat=0x%x, dx=%d, dy=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1781
			data, dataStride, dataFormat, dx, dy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1782
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1783
	TGuestOpenVg::vgWritePixels(data, dataStride, dataFormat, dx, dy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1784
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1785
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1786
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1787
 Retrieves pixel data from the drawing surface into the image dst. The drawing surface
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1788
 pixel (sx + i, sy + j) is copied to pixel (dx + i, dy + j) of the image dst, for
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1789
 0 <= i < width and 0 <= j < height. Pixels whose source lies outside of the bounds of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1790
 the drawing surface or whose destination lies outside the bounds of dst are ignored.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1791
 Pixel format conversion is applied as needed. The scissoring region does not affect
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1792
 the reading of pixels.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1793
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1794
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1795
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1796
   – if dst is not a valid image handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1797
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1798
   – if dst is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1799
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1800
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1801
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1802
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1803
	vgGetPixels(VGImage dst, VGint dx, VGint dy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1804
		VGint sx, VGint sy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1805
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1806
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1807
	OPENVG_TRACE("vgGetPixels dst=0x%x, dx=%d, dy=%d, sx=%d, sy=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1808
			dst, dx, dy, sx, sy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1809
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1810
	TGuestOpenVg::vgGetPixels(dst, dx, dy, sx, sy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1811
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1812
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1813
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1814
 Copy pixels from one region of the drawing surface to another. Copies between
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1815
 overlapping regions are allowed and always produce consistent results identical to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1816
 copying the entire source region to a scratch buffer followed by copying the scratch
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1817
 buffer into the destination region. The drawing surface pixel (sx + i, sy + j) is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1818
 copied to pixel (dx + i, dy + j) for 0 <= i < width and 0 <= j < height. Pixels whose
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1819
 source or destination lies outside of the bounds of the drawing surface are ignored.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1820
 Transformations, masking, and blending are not applied. Scissoring is applied to the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1821
 destination, but does not affect the reading of pixels.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1822
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1823
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1824
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1825
   – if width or height is less than or equal to 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1826
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1827
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1828
	vgCopyPixels(VGint dx, VGint dy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1829
		VGint sx, VGint sy,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1830
		VGint width, VGint height)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1831
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1832
	OPENVG_TRACE("vgCopyPixels dx=%d, dy=%d, sx=%d, sy=%d, width=%d, height=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1833
			dx, dy, sx, sy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1834
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1835
	TGuestOpenVg::vgCopyPixels(dx, dy, sx, sy, width, height);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1836
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1837
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1838
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1839
 Destroys the VGFont object pointed to by the font argument.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1840
 Note that vgDestroyFont will not destroy underlying objects that were used to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1841
 define glyphs in the font. It is the responsibility of an application to destroy all
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1842
 VGPath or VGImage objects that were used in a VGFont, if they are no longer in
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1843
 use.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1844
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1845
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1846
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1847
   – if font is not a valid font handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1848
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1849
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1850
	vgDestroyFont(VGFont font)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1851
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1852
	OPENVG_TRACE("vgDestroyFont font=0x%x", font);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1853
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1854
	TGuestOpenVg::vgDestroyFont(font);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1855
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1856
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1857
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1858
 Creates a new glyph and assigns the given path to a glyph associated with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1859
 glyphIndex in a font object. The glyphOrigin argument defines the coordinates of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1860
 the glyph origin within the path, and the escapement parameter determines the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1861
 advance width for this glyph. Both glyphOrigin and escapement coordinates are
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1862
 defined in the same coordinate system as the path. For glyphs that have no
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1863
 visual representation (e.g., the <space> character), a value of VG_INVALID_HANDLE
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1864
 is used for path. The reference count for the path is incremented.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1865
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1866
 The path object may define either an original glyph outline, or an outline that
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1867
 has been scaled and hinted to a particular size (in surface coordinate units); this
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1868
 is defined by the isHinted parameter, which can be used by implementation
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1869
 for text-specific optimizations (e.g., heuristic auto-hinting of unhinted outlines).
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1870
 When isHinted is equal to VG_TRUE, the implementation will never apply
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1871
 auto-hinting; otherwise, auto hinting will be applied at the implementation's
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1872
 discretion.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1873
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1874
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1875
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1876
   – if font is not a valid font handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1877
   – if path is not a valid font handle or VG_INVALID_HANDLE, or is not shared
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1878
     with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1879
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1880
   – if the pointer to glyphOrigin or escapement is NULL or is not properly
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1881
     aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1882
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1883
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1884
	vgSetGlyphToPath(VGFont font,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1885
		VGuint glyphIndex,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1886
		VGPath path,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1887
		VGboolean isHinted,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1888
		const VGfloat glyphOrigin [2],
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1889
		const VGfloat escapement[2])
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1890
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1891
	OPENVG_TRACE("vgSetGlyphToPath font=0x%x, glyphIndex=%u, path=0x%x, isHinted=%d, glyphOrigin=0x%x, escapement=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1892
			font, glyphIndex, path, isHinted, glyphOrigin, escapement);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1893
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1894
	TGuestOpenVg::vgSetGlyphToPath(font, glyphIndex, path, isHinted, glyphOrigin, escapement);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1895
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1896
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1897
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1898
 Creates a new glyph and assigns the given image into a glyph associated with
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1899
 the glyphIndex in a font object. The glyphOrigin argument defines the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1900
 coordinates of the glyph origin within the image, and the escapement parameter
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1901
 determines the advance width for this glyph. Both glyphOrigin and escapement
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1902
 coordinates are defined in the image coordinate system. Applying transformations
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1903
 to an image (other than translations mapped to pixel grid in surface coordinate
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1904
 system) should be avoided as much as possible. For glyphs that have no visual
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1905
 representation (e.g., the <space> character), a value of VG_INVALID_HANDLE is
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1906
 used for image. The reference count for the image is incremented.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1907
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1908
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1909
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1910
   – if font is not a valid font handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1911
   – if image is not a valid image handle or VG_INVALID_HANDLE, or is not
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1912
     shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1913
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1914
   – if the pointer to glyphOrigin or escapement is NULL or is not properly
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1915
     aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1916
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1917
   – if image is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1918
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1919
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1920
	vgSetGlyphToImage(VGFont font,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1921
		VGuint glyphIndex,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1922
		VGImage image,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1923
		const VGfloat glyphOrigin [2],
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1924
		const VGfloat escapement[2])
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1925
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1926
	OPENVG_TRACE("vgSetGlyphToImage font=0x%x, glyphIndex=%d, image=0x%x, glyphOrigin=0x%x, escapement=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1927
			font, glyphIndex, image, (void*)glyphOrigin, (void*)escapement);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1928
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1929
	TGuestOpenVg::vgSetGlyphToImage(font, glyphIndex, image, glyphOrigin, escapement);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1930
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1931
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1932
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1933
 Deletes the glyph defined by a glyphIndex parameter from a font. The reference count
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1934
 for the VGPath or VGImage object to which the glyph was previously set is decremented,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1935
 and the object's resources are released if the count has fallen to 0.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1936
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1937
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1938
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1939
   – if font is not a valid font handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1940
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1941
   – if glyphIndex is not defined for the font
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1942
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1943
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1944
	vgClearGlyph(VGFont font,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1945
		VGuint glyphIndex)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1946
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1947
	OPENVG_TRACE("vgClearGlyph font=0x%x, glyphIndex=%u", font, glyphIndex);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1948
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1949
	TGuestOpenVg::vgClearGlyph(font, glyphIndex);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1950
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1951
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1952
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1953
 Renders a glyph defined by the glyphIndex using the given font object. The
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1954
 user space position of the glyph (the point where the glyph origin will be
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1955
 placed) is determined by value of VG_GLYPH_ORIGIN. vgDrawGlyph calculates the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1956
 new text origin by translating the glyph origin by the escapement vector of
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1957
 the glyph defined by glyphIndex. Following the call, the VG_GLYPH_ORIGIN
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1958
 parameter will be updated with the new origin.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1959
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1960
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1961
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1962
   – if font is not a valid font handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1963
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1964
   – if glyphIndex has not been defined for a given font object
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1965
   – if paintModes is not a valid bitwise OR of values from the VGPaintMode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1966
     enumeration, or 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1967
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1968
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1969
	vgDrawGlyph(VGFont font,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1970
		VGuint glyphIndex,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1971
		VGbitfield paintModes,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1972
		VGboolean allowAutoHinting)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1973
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1974
	OPENVG_TRACE("vgDrawGlyph font=0x%x, glyphIndex=%u, paintModes=0x%x, allowAutoHinting=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1975
			font, glyphIndex, paintModes, allowAutoHinting);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1976
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1977
	TGuestOpenVg::vgDrawGlyph(font, glyphIndex, paintModes, allowAutoHinting);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1978
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1979
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1980
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1981
 Renders a sequence of glyphs defined by the array pointed to by glyphIndices
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1982
 using the given font object. The values in the adjustments_x and adjustments_y
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1983
 arrays define positional adjustment values for each pair of glyphs defined by
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1984
 the glyphIndices array. The glyphCount parameter defines the number of elements
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1985
 in the glyphIndices and adjustments_x and adjustments_y arrays. The adjustment
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1986
 values defined in these arrays may represent kerning or other positional adjustments
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1987
 required for each pair of glyphs. If no adjustments for glyph positioning in a
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1988
 particular axis are required (all horizontal and/or vertical adjustments are zero),
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1989
 NULL pointers may be passed for either or both of adjustment_x and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1990
 adjustment_y. The adjustments values should be defined in the same
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1991
 coordinate system as the font glyphs; if the glyphs are defined by path objects
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1992
 with path data scaled (e.g., by a factor of 1/units-per-EM), the values in the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1993
 adjustment_x and adjustment_y arrays are scaled using the same scale factor.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1994
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1995
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1996
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1997
   – if font is not a valid font handle, or is not shared with the current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1998
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  1999
   – if glyphCount is zero or a negative value
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2000
   – if the pointer to the glyphIndices array is NULL or is not properly
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2001
     aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2002
   – if a pointer to either of the adjustments_x or adjustments_y arrays are
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2003
     non-NULL and are not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2004
   – if any of the glyphIndices has not been defined in a given font object
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2005
   – if paintModes is not a valid bitwise OR of values from the VGPaintMode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2006
     enumeration, or 0
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2007
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2008
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2009
	vgDrawGlyphs(VGFont font,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2010
		VGint glyphCount,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2011
		const VGuint * glyphIndices,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2012
		const VGfloat * adjustments_x,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2013
		const VGfloat * adjustments_y,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2014
		VGbitfield paintModes,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2015
		VGboolean allowAutoHinting)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2016
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2017
	OPENVG_TRACE("vgDrawGlyphs font=0x%x, glyphCount=%d, glyphIndices=0x%x, adjustments_y=0x%x, "
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2018
			"adjustments_x=0x%x, paintModes=0x%x, allowAutoHinting=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2019
			font, glyphCount, (void*)glyphIndices, (void*)adjustments_x, (void*)adjustments_y, paintModes, allowAutoHinting);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2020
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2021
	TGuestOpenVg::vgDrawGlyphs(font, glyphCount, glyphIndices, adjustments_x, adjustments_y, paintModes, allowAutoHinting);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2022
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2023
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2024
/* Image Filters */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2025
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2026
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2027
 Computes a linear combination of color and alpha values (Rsrc, Gsrc, Bsrc,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2028
 ALPHAsrc) from the normalized source image src at each pixel.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2029
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2030
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2031
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2032
   – if either dst or src is not a valid image handle, or is not shared with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2033
     current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2034
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2035
   – if either dst or src is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2036
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2037
   – if src and dst overlap
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2038
   – if matrix is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2039
   – if matrix is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2040
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2041
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2042
	vgColorMatrix(VGImage dst, VGImage src,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2043
		const VGfloat * matrix)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2044
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2045
	OPENVG_TRACE("vgColorMatrix dst=0x%x, src=0x%x, matrix=0x%x", dst, src, matrix);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2046
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2047
	TGuestOpenVg::vgColorMatrix(dst, src, matrix);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2048
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2049
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2050
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2051
 Applies a user-supplied convolution kernel to a normalized source image src. The
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2052
 dimensions of the kernel are given by kernelWidth and kernelHeight; the kernel values
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2053
 are specified as kernelWidth*kernelHeight VGshorts in column-major order. That is,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2054
 the kernel entry (i, j) is located at position i*kernelHeight + j in the input sequence.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2055
 The shiftX and shiftY parameters specify a translation between the source and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2056
 destination images. The result of the convolution is multiplied by a scale factor, and
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2057
 a bias is added.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2058
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2059
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2060
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2061
   – if either dst or src is not a valid image handle, or is not shared with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2062
     current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2063
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2064
   – if either dst or src is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2065
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2066
   – if src and dst overlap
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2067
   – if kernelWidth or kernelHeight is less than or equal to 0 or greater than
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2068
     VG_MAX_KERNEL_SIZE
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2069
   – if kernel is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2070
   – if kernel is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2071
   – if tilingMode is not one of the values from the VGTilingMode enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2072
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2073
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2074
	vgConvolve(VGImage dst, VGImage src,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2075
		VGint kernelWidth, VGint kernelHeight,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2076
		VGint shiftX, VGint shiftY,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2077
		const VGshort * kernel,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2078
		VGfloat scale,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2079
		VGfloat bias,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2080
		VGTilingMode tilingMode)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2081
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2082
	OPENVG_TRACE("vgConvolve dst=0x%x, src=0x%x, kW=%d, kH=%d, shX=%d, shY=%d, kernel=0x%x, scale=%f, bias=%f, tiling=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2083
			dst, src, kernelWidth, kernelHeight, shiftX, shiftY, kernel, scale, bias, tilingMode);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2084
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2085
	TGuestOpenVg::vgConvolve(dst, src, kernelWidth, kernelHeight, shiftX, shiftY, kernel, scale, bias, tilingMode);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2086
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2087
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2088
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2089
 Applies a user-supplied separable convolution kernel to a normalized source image src.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2090
 A separable kernel is a two-dimensional kernel in which each entry kij is equal to a
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2091
 product kxi * kyj of elements from two one dimensional kernels, one horizontal and one
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2092
 vertical.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2093
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2094
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2095
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2096
   – if either dst or src is not a valid image handle, or is not shared with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2097
     current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2098
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2099
   – if either dst or src is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2100
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2101
   – if src and dst overlap
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2102
   – if kernelWidth or kernelHeight is less than or equal to 0 or greater than
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2103
     VG_MAX_SEPARABLE_KERNEL_SIZE
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2104
   – if kernelX or kernelY is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2105
   – if kernelX or kernelY is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2106
   – if tilingMode is not one of the values from the VGTilingMode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2107
     enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2108
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2109
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2110
	vgSeparableConvolve(VGImage dst, VGImage src,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2111
		VGint kernelWidth,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2112
		VGint kernelHeight,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2113
		VGint shiftX, VGint shiftY,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2114
		const VGshort * kernelX,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2115
		const VGshort * kernelY,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2116
		VGfloat scale,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2117
		VGfloat bias,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2118
		VGTilingMode tilingMode)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2119
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2120
	OPENVG_TRACE("vgSeparableConvolve dst=0x%x, src=0x%x, kW=%d, kH=%d, shX=%d, shY=%d, kX=0x%x, kY=0x%x, scale=%f, bias=%f, tiling=0x%x",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2121
			dst, src, kernelWidth, kernelHeight, shiftX, shiftY, kernelX, kernelY, scale, bias, tilingMode);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2122
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2123
	TGuestOpenVg::vgSeparableConvolve(dst, src, kernelWidth, kernelHeight, shiftX, shiftY, kernelX, kernelY, scale, bias, tilingMode);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2124
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2125
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2126
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2127
 Computes the convolution of a normalized source image src with a separable kernel
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2128
 defined in each dimension by the Gaussian function G(x, s).
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2129
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2130
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2131
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2132
   – if either dst or src is not a valid image handle, or is not shared with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2133
     current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2134
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2135
   – if either dst or src is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2136
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2137
   – if src and dst overlap
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2138
   – if stdDeviationX or stdDeviationY is less than or equal to 0 or greater
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2139
     than VG_MAX_GAUSSIAN_STD_DEVIATION
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2140
   – if tilingMode is not one of the values from the VGTilingMode
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2141
     enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2142
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2143
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2144
	vgGaussianBlur(VGImage dst, VGImage src,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2145
		VGfloat stdDeviationX,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2146
		VGfloat stdDeviationY,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2147
		VGTilingMode tilingMode)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2148
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2149
	OPENVG_TRACE("vgGaussianBlur dst=0x%x, src=0x%x, stdDeviationX=%f, stdDeviationY=%f, tilingMode=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2150
			dst, src, stdDeviationX, stdDeviationY, tilingMode);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2151
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2152
	TGuestOpenVg::vgGaussianBlur(dst, src, stdDeviationX, stdDeviationY, tilingMode);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2153
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2154
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2155
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2156
 Passes each image channel of the normalized source image src through a separate lookup
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2157
 table.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2158
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2159
 Each channel of the normalized source pixel is used as an index into the lookup table for
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2160
 that channel by multiplying the normalized value by 255 and rounding to obtain an 8-bit
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2161
 integral value. Each LUT parameter should contain 256 VGubyte entries. The
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2162
 outputs of the lookup tables are concatenated to form an RGBA_8888 pixel
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2163
 value, which is interpreted as lRGBA_8888, lRGBA_8888_PRE, sRGBA_8888,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2164
 or sRGBA_8888_PRE, depending on the values of outputLinear and  outputPremultiplied.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2165
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2166
 The resulting pixels are converted into the destination format using the normal
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2167
 pixel format conversion rules.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2168
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2169
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2170
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2171
   – if either dst or src is not a valid image handle, or is not shared with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2172
     current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2173
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2174
   – if either dst or src is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2175
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2176
   – if src and dst overlap
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2177
   – if any pointer parameter is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2178
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2179
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2180
	vgLookup(VGImage dst, VGImage src,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2181
		const VGubyte * redLUT,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2182
		const VGubyte * greenLUT,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2183
		const VGubyte * blueLUT,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2184
		const VGubyte * alphaLUT,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2185
		VGboolean outputLinear,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2186
		VGboolean outputPremultiplied)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2187
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2188
	OPENVG_TRACE("vgLookup dst=0x%x, src=0x%x, redLUT=0x%x, greenLUT=0x%x, blueLUT=0x%x, alphaLUT=0x%x, opLin=%d, opPremul=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2189
			dst, src, redLUT, greenLUT, blueLUT, alphaLUT, outputLinear, outputPremultiplied);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2190
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2191
	TGuestOpenVg::vgLookup(dst, src, redLUT, greenLUT, blueLUT, alphaLUT,  outputLinear, outputPremultiplied);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2192
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2193
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2194
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2195
 Passes a single image channel of the normalized source image src, selected by the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2196
 sourceChannel parameter, through a combined lookup table that produces whole pixel
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2197
 values. Each normalized source channel value is multiplied by 255 and rounded to
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2198
 obtain an 8 bit integral value.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2199
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2200
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2201
   VG_BAD_HANDLE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2202
   – if either dst or src is not a valid image handle, or is not shared with the
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2203
     current context
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2204
   VG_IMAGE_IN_USE_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2205
   – if either dst or src is currently a rendering target
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2206
   VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2207
   – if src and dst overlap
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2208
   – if src is in an RGB pixel format and sourceChannel is not one of VG_RED,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2209
     VG_GREEN, VG_BLUE or VG_ALPHA from the VGImageChannel enumeration
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2210
   – if lookupTable is NULL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2211
   – if lookupTable is not properly aligned
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2212
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2213
EXPORT_C void
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2214
	vgLookupSingle(VGImage dst, VGImage src,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2215
		const VGuint * lookupTable,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2216
		VGImageChannel sourceChannel,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2217
		VGboolean outputLinear,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2218
		VGboolean outputPremultiplied)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2219
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2220
	OPENVG_TRACE("vgLookupSingle dst=0x%x, src=0x%x, lookupTable=0x%x, sourceChannel=0x%x, opLin=%d, opPremul=%d",
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2221
			dst, src, lookupTable, sourceChannel, outputLinear, outputPremultiplied);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2222
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2223
	TGuestOpenVg::vgLookupSingle(dst, src, lookupTable, sourceChannel, outputLinear, outputPremultiplied);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2224
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2225
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2226
// guest support for OpenVG extension #4, KHR_EGL_image - vgCreateEGLImageTargetKHR(VGeglImageKHR image)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2227
/*
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2228
 Creates an EGLImage target VGImage object from the provided EGLImage
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2229
 <image>.  <image> should be of type EGLImageKHR, cast into the type
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2230
 VGeglImageKHR.  Assuming no errors are generated in this function,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2231
 the resulting VGImage will be an EGLImage target of the specified
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2232
 EGLImage <image>.  As a side-effect of the referencing operation,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2233
 all of the pixel data in the <buffer> used as the EGLImage source
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2234
 resource (i.e., the <buffer> parameter passed to the CreateImageKHR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2235
 command that returned <image>) will become undefined.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2236
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2237
 ERRORS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2238
      VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2239
      - if the OpenVG implementation is not able to create a VGImage
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2240
        compatible with the provided VGeglImageKHR for an implementation-
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2241
        dependent reason (this could be caused by, but not limited to,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2242
        reasons such as unsupported pixel formats, anti-aliasing quality,
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2243
        etc.).
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2244
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2245
      VG_ILLEGAL_ARGUMENT_ERROR
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2246
      - if <image> is not a valid VGeglImageKHR.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2247
 */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2248
VGImage	vgCreateEGLImageTargetKHR(VGeglImageKHR image)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2249
	{
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2250
	OPENVG_TRACE("vgCreateEGLImageTargetKHR image=0x%x -->", image);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2251
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2252
	VGImage imageHandle = TGuestOpenVg::vgCreateEGLImageTargetKHR(image);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2253
	OPENVG_TRACE("vgCreateEGLImageTargetKHR imageHandle=0x%x <--", imageHandle);
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2254
	return imageHandle;
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2255
	}
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2256
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2257
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2258
} /* extern "C" */
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2259
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 14
diff changeset
  2260
// end of file openvg.cpp