OpenVX XML Schema Extension  r29754
 All Functions Typedefs Enumerations Enumerator Groups Pages
Extension: XML API

The Khronos Extension for OpenVX XML Import and Export Support. More...

Macros

#define VX_MAX_REFERENCE_NAME   (64)
 Defines the maximum number of characters in a reference name string.
 

Typedefs

typedef struct _vx_import * vx_import
 An abstract handle to an import object.
 

Enumerations

enum  vx_ext_import_reference_attribute_e { VX_REF_ATTRIBUTE_NAME = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_REFERENCE << 8)) + 0x2 }
 Extended reference attribute list. This extension adds new attributes that can be queried by the vxQueryReference function. More...
 
enum  vx_ext_import_type_e { VX_TYPE_IMPORT = 0x814 }
 The Object Type Enumeration for Imports. More...
 
enum  vx_ext_import_types_e { VX_IMPORT_TYPE_XML = 0 }
 The import type enumeration. More...
 
enum  vx_import_attribute_e {
  VX_IMPORT_ATTRIBUTE_COUNT = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_IMPORT << 8)) + 0x0,
  VX_IMPORT_ATTRIBUTE_TYPE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_IMPORT << 8)) + 0x1
}
 The import attributes list. More...
 

Functions

vx_status vxExportToXML (vx_context context, vx_char xmlfile[])
 Exports all objects in the context to an XML file which uses the OpenVX XML Schema.
 
vx_import vxImportFromXML (vx_context context, vx_char xmlfile[])
 Imports all framework and data objects from an XML file into the given context.
 
vx_status vxSetReferenceName (vx_reference ref, const vx_char *name)
 Name a referenceThis function is used to associate a name to a reference. This name can be used by the OpenVX implementation in log messages and any other reporting mechanisms. It is also intended to be used by vxGetImportReferenceByName to retrieve a named reference from a vx_import object.
 
vx_reference vxGetImportReferenceByName (vx_import import, const vx_char *name)
 Used to retrieve a reference by name from the import when the name is known beforehand. If multiple references have the same name, then any one of them may be returned.
 
vx_reference vxGetImportReferenceByIndex (vx_import import, vx_uint32 index)
 Used to retrieve a reference by the index from the import.
 
vx_status vxQueryImport (vx_import import, vx_enum attribute, void *ptr, vx_size size)
 Used to query the import about its properties.
 
vx_status vxReleaseImport (vx_import *import)
 Releases a reference to an import object. Also internally releases its references to its imported objects. These imported objects may not be garbage collected until their total reference counts are zero.
 
vx_status vxReleaseReference (vx_reference *ref)
 Releases a reference. The object may not be garbage collected until its total reference count is zero.
 

Detailed Description

The Khronos Extension for OpenVX XML Import and Export Support.

Macro Definition Documentation

#define VX_MAX_REFERENCE_NAME   (64)

Defines the maximum number of characters in a reference name string.

See Also
vxSetReferenceName
vxGetImportReferenceByName

Definition at line 43 of file vx_khr_xml.h.

Enumeration Type Documentation

Extended reference attribute list. This extension adds new attributes that can be queried by the vxQueryReference function.

Enumerator:
VX_REF_ATTRIBUTE_NAME 

Used to query the reference for its name. Use a *vx_char parameter.

Definition at line 50 of file vx_khr_xml.h.

The Object Type Enumeration for Imports.

Enumerator:
VX_TYPE_IMPORT 

A vx_import

Definition at line 58 of file vx_khr_xml.h.

The import type enumeration.

See Also
VX_IMPORT_ATTRIBUTE_TYPE
Enumerator:
VX_IMPORT_TYPE_XML 

The XML import type.

Definition at line 66 of file vx_khr_xml.h.

The import attributes list.

See Also
vxQueryImport
Enumerator:
VX_IMPORT_ATTRIBUTE_COUNT 

Returns the number of references in the import object. Use a vx_uint32 parameter.

VX_IMPORT_ATTRIBUTE_TYPE 

Returns the type of import. Use a vx_ext_import_types_e parameter.

Definition at line 74 of file vx_khr_xml.h.

Function Documentation

vx_status vxExportToXML ( vx_context  context,
vx_char  xmlfile[] 
)

Exports all objects in the context to an XML file which uses the OpenVX XML Schema.

Parameters
[in]contextThe context to export.
[in]xmlfileThe file name to write the XML into.
Note
The reference numbers contained in the xml file can appear in any order but should be inclusive from index number 0 to [number of references - 1]. For example, if there are 20 references in the xml file, none of the reference indices should be >= 20.
Returns
A vx_status_e enumeration.
See Also
https://www.khronos.org/registry/vx/schema/openvx-1-0.xsd
vx_import vxImportFromXML ( vx_context  context,
vx_char  xmlfile[] 
)

Imports all framework and data objects from an XML file into the given context.

Parameters
[in]contextThe context to import into.
[in]xmlfileThe XML file to read.
Note
The reference indices in the import object corresponds with the reference numbers in the XML file. It is assumed that the program has some means to know which references to use from imported list (either by name: vxGetImportReferenceByName, or by index from looking at the XML file (debug use case): vxGetImportReferenceByIndex). Alternativly, the program can use vxGetImportReferenceByIndex in a loop and query each one to understand what was imported. After all references of interest have been retrieved, this import obects should be released using vxReleaseImport.
Returns
vx_import object containing references to the imported objects in the context
See Also
https://www.khronos.org/registry/vx/schema/openvx-1-0.xsd
vx_status vxSetReferenceName ( vx_reference  ref,
const vx_char *  name 
)

Name a referenceThis function is used to associate a name to a reference. This name can be used by the OpenVX implementation in log messages and any other reporting mechanisms. It is also intended to be used by vxGetImportReferenceByName to retrieve a named reference from a vx_import object.

The OpenVX implementation will not check if the name is unique in the reference scope (context or graph). Several references can then have the same name.

Parameters
[in]refThe reference to name.
[in]namePointer to the '\0' terminated string that identifies the reference. The string is copied by the function so that it stays the property of the caller. NULL means that the reference is not named.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCEif reference is not valid.
vx_reference vxGetImportReferenceByName ( vx_import  import,
const vx_char *  name 
)

Used to retrieve a reference by name from the import when the name is known beforehand. If multiple references have the same name, then any one of them may be returned.

Parameters
[in]importThe reference to the import object.
[in]nameThe reference string name.
Returns
vx_reference
Return values
0Invalid import object or name does not match a reference in the import object.
*The reference matching the requested name.
Note
Use vxReleaseReference to release the reference before releasing the context.
Precondition
vxImportFromXML
vx_reference vxGetImportReferenceByIndex ( vx_import  import,
vx_uint32  index 
)

Used to retrieve a reference by the index from the import.

Parameters
[in]importThe reference to the import object.
[in]indexThe index of the reference in the import object to return.
Returns
vx_reference
Return values
0Invalid import object or index.
*The reference at the requested index number.
Note
Use vxQueryImport with VX_IMPORT_ATTRIBUTE_COUNT to retrieve the upper limit of references in the import.
Use vxReleaseReference to release the reference before releasing the context.
Precondition
vxImportFromXML
vx_status vxQueryImport ( vx_import  import,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Used to query the import about its properties.

Parameters
[in]importThe reference to the import object.
[in]attributeThe vx_import_attribute_e value to query for.
[out]ptrThe location at which the resulting value will be stored.
[in]sizeThe size of the container to which ptr points.
Returns
A vx_status_e enumeration.
Precondition
vxImportFromXML
vx_status vxReleaseImport ( vx_import import)

Releases a reference to an import object. Also internally releases its references to its imported objects. These imported objects may not be garbage collected until their total reference counts are zero.

Parameters
[in]importThe pointer to the import object to release.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCEIf import is not a vx_import.
Note
After returning from this function the reference will be zeroed.
Precondition
vxImportFromXML
vx_status vxReleaseReference ( vx_reference *  ref)

Releases a reference. The object may not be garbage collected until its total reference count is zero.

Parameters
[in]refThe pointer to the reference to release.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCEIf reference is not a vx_reference.
Note
After returning from this function the reference will be zeroed.
Precondition
vxGetImportReferenceByName or vxGetImportReferenceByIndex