The OpenVX Specification  2b213f9
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
vx_import_export.h
1 /*
2  * Copyright (c) 2012-2016 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and/or associated documentation files (the
6  * "Materials"), to deal in the Materials without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Materials, and to
9  * permit persons to whom the Materials are furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16  * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17  * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18  * https://www.khronos.org/registry/
19  *
20  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27  */
28 
29 #ifndef _OPENVX_IMPORT_EXPORT_H_
30 #define _OPENVX_IMPORT_EXPORT_H_
31 
41 typedef struct _vx_import *vx_import;
42 
46 enum vx_ext_import_type_e
47 {
48  VX_TYPE_IMPORT = 0x815,
49 };
50 
54 typedef enum _vx_export_use_e {
56  VX_EXPORT_USE_APPLICATION_CREATE,
58  VX_EXPORT_USE_EXPORT_VALUES,
60  VX_EXPORT_USE_NO_EXPORT_VALUES
61 };
62 
75 VX_API_ENTRY vx_import VX_API_CALL vxImportObjectsFromMemory(
76  vx_context context,
77  vx_size numrefs,
78  vx_reference *refs,
79  const vx_enum * uses,
80  const vx_uint8 * ptr,
81  vx_size length);
82 
83 
94 VX_API_ENTRY vx_status VX_API_CALL vxExportObjectsToMemory(
95  vx_context context,
96  vx_size numrefs,
97  const vx_reference *refs,
98  const vx_enum * uses,
99  const vx_uint8 ** ptr,
100  vx_size * length);
101 
108 VX_API_ENTRY vx_status VX_API_CALL vxReleaseExportedMemory(
109  vx_context context,
110  const vx_uint8 ** ptr);
111 
116 VX_API_ENTRY vx_status VX_API_CALL vxReleaseImport(vx_import *import);
117 
118 
119 
124 VX_API_ENTRY vx_reference VX_API_CALL vxGetImportReferenceByName(vx_import import, const vx_char *name);
125 
129 typedef struct _vx_url_handle * vx_url_handle;
130 
134 typedef vx_url_handle (VX_CALLBACK * vx_url_create_f)(const vx_char * url);
135 
139 typedef vx_url_handle (VX_CALLBACK * vx_url_open_f)(const vx_char * url);
140 
144 typedef vx_status (VX_CALLBACK * vx_url_write_f)(vx_url_handle h, const
145 vx_uint8 * ptr, vx_size size);
146 
150 typedef vx_status (VX_CALLBACK * vx_url_read_f)(vx_url_handle h, vx_uint8 *
151 ptr, vx_size size, vx_size * bytes_read);
152 
156 typedef vx_status (VX_CALLBACK * vx_url_close_f)(vx_url_handle h);
157 
158 
171 VX_API_ENTRY vx_status VX_API_CALL vxExportObjectsToURL(
172  vx_context context,
173  vx_size numrefs,
174  const vx_reference *refs,
175  const vx_enum * uses,
176  const vx_char * url,
177  vx_url_create_f create_f,
178  vx_url_write_f write_f,
179  vx_url_close_f close_f);
180 
181 
194 VX_API_ENTRY vx_import VX_API_CALL vxImportObjectsFromURL(
195  vx_context context,
196  vx_size numrefs,
197  vx_reference *refs,
198  const vx_enum * uses,
199  const vx_char * url,
200  vx_url_open_f open_f,
201  vx_url_read_f read_f,
202  vx_url_close_f close_f);
203 /*==============================================================================*/
204 #endif
uint8_t vx_uint8
An 8-bit unsigned value.
Definition: vx_types.h:87
size_t vx_size
A wrapper of size_t to keep the naming convention uniform.
Definition: vx_types.h:165
int32_t vx_enum
Sets the standard enumeration type size to be a fixed quantity.
Definition: vx_types.h:160
char vx_char
An 8 bit ASCII character.
Definition: vx_types.h:82
vx_enum vx_status
A formal status type with known fixed size.
Definition: vx_types.h:428
struct _vx_context * vx_context
An opaque reference to the implementation context.
Definition: vx_types.h:226
struct _vx_reference * vx_reference
A generic opaque reference to any object within OpenVX.
Definition: vx_types.h:153
#define VX_API_CALL
Defines calling convention for OpenVX API.
Definition: vx_types.h:68
#define VX_CALLBACK
Defines calling convention for user callbacks.
Definition: vx_types.h:75