24 #ifndef _OPENVX_API_H_
25 #define _OPENVX_API_H_
34 #if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
35 #if defined(VX_BUILDING)
37 #define VX_API __attribute__((dllexport))
39 #define VX_API __declspec(dllexport)
43 #define VX_API __attribute__((dllimport))
45 #define VX_API __declspec(dllimport)
50 #define VX_API __attribute__((visibility("default")))
1728 #define vxFormatArrayPointer(ptr, index, stride) \
1729 (&(((vx_uint8*)(ptr))[(index) * (stride)]))
1739 #define vxArrayItem(type, ptr, index, stride) \
1740 (*(type *)(vxFormatArrayPointer((ptr), (index), (stride))))
struct _vx_image * vx_image
An opaque reference to an image.
vx_image vxCreateImageFromHandle(vx_context context, vx_df_image color, vx_imagepatch_addressing_t addrs[], void *ptrs[], vx_enum import_type)
Creates a reference to an image object that was externally allocated.
vx_context vxCreateContext()
Creates a vx_context.
struct _vx_delay * vx_delay
The delay object. This is like a ring buffer of objects that is maintained by the OpenVX implementati...
vx_status vxAgeDelay(vx_delay delay)
Ages the internal delay ring by one. This means that once this API is called the reference from index...
vx_bool
A Boolean value. This allows 0 to be FALSE, as it is in C, and any non-zero to be TRUE...
vx_status vxRemoveKernel(vx_kernel kernel)
Removes a non-finalized vx_kernel from the vx_context. Once a vx_kernel has been finalized it cannot ...
vx_status vxAccessArrayRange(vx_array arr, vx_size start, vx_size end, vx_size *stride, void **ptr, vx_enum usage)
Grants access to a sub-range of an Array.
vx_status vxAddParameterToGraph(vx_graph graph, vx_parameter parameter)
Adds the given parameter extracted from a vx_node to the graph.
vx_status vxQueryImage(vx_image image, vx_enum attribute, void *ptr, vx_size size)
Retrieves various attributes of an image.
vx_status vxQueryKernel(vx_kernel kernel, vx_enum attribute, void *ptr, vx_size size)
This allows the client to query the kernel to get information about the number of parameters...
vx_status vxReleaseMatrix(vx_matrix *mat)
Releases a reference to a matrix object. The object may not be garbage collected until its total refe...
vx_status vxReleaseParameter(vx_parameter *param)
Releases a reference to a parameter object. The object may not be garbage collected until its total r...
vx_status vxSetNodeAttribute(vx_node node, vx_enum attribute, void *ptr, vx_size size)
Allows a user to set attribute of a node before Graph Validation.
vx_remap vxCreateRemap(vx_context context, vx_uint32 src_width, vx_uint32 src_height, vx_uint32 dst_width, vx_uint32 dst_height)
Creates a remap table object.
vx_status(* vx_kernel_f)(vx_node node, vx_reference *parameters, vx_uint32 num)
The pointer to the Host side kernel.
vx_status vxQueryReference(vx_reference ref, vx_enum attribute, void *ptr, vx_size size)
Queries any reference type for some basic information (count, type).
vx_matrix vxCreateMatrix(vx_context c, vx_enum data_type, vx_size columns, vx_size rows)
Creates a reference to a matrix object.
vx_status vxCommitImagePatch(vx_image image, vx_rectangle_t *rect, vx_uint32 plane_index, vx_imagepatch_addressing_t *addr, void *ptr)
This allows the User to commit a rectangular patch (subset) of an image from a single plane...
vx_status vxReleaseLUT(vx_lut *lut)
Releases a reference to a LUT object. The object may not be garbage collected until its total referen...
struct _vx_array * vx_array
The Array Object. Array is a strongly-typed container for other data structures.
void vxAddLogEntry(vx_reference ref, vx_status status, const char *message,...)
Adds a line to the log.
vx_status vxQueryDelay(vx_delay delay, vx_enum attribute, void *ptr, vx_size size)
Queries a vx_delay object attribute.
vx_enum vxRegisterUserStruct(vx_context context, vx_size size)
Registers user-defined structures to the context.
void vxRemoveNode(vx_node *node)
Removes a Node from its parent Graph and releases it.
int16_t vx_int16
A 16-bit signed value.
vx_reference vxGetReferenceFromDelay(vx_delay delay, vx_int32 index)
Retrieves a reference from a delay object.
size_t vx_size
A wrapper of size_t to keep the naming convention uniform.
vx_status vxTruncateArray(vx_array arr, vx_size new_num_items)
Truncates an Array (remove items from the end).
vx_status vxReleaseImage(vx_image *image)
Releases a reference to an image object. The object may not be garbage collected until its total refe...
vx_kernel vxGetKernelByEnum(vx_context context, vx_enum kernel)
Obtains a reference to the kernel using the vx_kernel_e enumeration.
int32_t vx_enum
Sets the standard enumeration type size to be a fixed quantity.
struct _vx_threshold * vx_threshold
The Threshold Object. A thresholding object contains the types and limit values of the thresholding r...
vx_image vxGetPyramidLevel(vx_pyramid pyr, vx_uint32 index)
Retrieves a level of the pyramid as a vx_image, which can be used elsewhere in OpenVX.
struct _vx_distribution * vx_distribution
The Distribution object. This has a user-defined number of bins over a user-defined range (within a u...
vx_parameter vxGetParameterByIndex(vx_node node, vx_uint32 index)
Retrieves a vx_parameter from a vx_node.
vx_status vxAccessScalarValue(vx_scalar ref, void *ptr)
Gets the scalar value out of a reference.
vx_status vxQueryDistribution(vx_distribution distribution, vx_enum attribute, void *ptr, vx_size size)
Queries a Distribution object.
vx_convolution vxCreateConvolution(vx_context context, vx_size columns, vx_size rows)
Creates a reference to a convolution matrix object.
void * vxFormatImagePatchAddress2d(void *ptr, vx_uint32 x, vx_uint32 y, vx_imagepatch_addressing_t *addr)
Accesses a specific pixel at a 2d coordinate in an image patch.
void(* vx_log_callback_f)(vx_context context, vx_reference ref, vx_status status, vx_char string[])
The log callback function.
vx_image vxCreateImageFromROI(vx_image img, vx_rectangle_t *rect)
Creates an image from another image given a rectangle. This second reference refers to the data in th...
struct _vx_parameter * vx_parameter
An opaque reference to a single parameter.
int32_t vx_int32
A 32-bit signed value.
vx_status vxQueryNode(vx_node node, vx_enum attribute, void *ptr, vx_size size)
Allows a user to query information out of a node.
The addressing image patch structure is used by the Host only to address pixels in an image patch...
vx_context vxGetContext(vx_reference reference)
Retrieves the context from any reference from within a context.
vx_status vxCommitDistribution(vx_distribution distribution, void *ptr)
Sets the Distribution back to the memory. The memory must be a vx_uint32 array of a value at least as...
vx_status vxCommitMatrix(vx_matrix mat, void *array)
Sets the matrix data (copy)
vx_status vxSetImageAttribute(vx_image image, vx_enum attribute, void *out, vx_size size)
Allows setting attributes on the image.
vx_status(* vx_kernel_output_validate_f)(vx_node node, vx_uint32 index, vx_meta_format meta)
The user-defined kernel node output parameter validation function. The function only needs to fill in...
vx_kernel vxAddKernel(vx_context context, vx_char name[VX_MAX_KERNEL_NAME], vx_enum enumeration, vx_kernel_f func_ptr, vx_uint32 numParams, vx_kernel_input_validate_f input, vx_kernel_output_validate_f output, vx_kernel_initialize_f init, vx_kernel_deinitialize_f deinit)
Allows users to add custom kernels to the known kernel database in OpenVX at run-time. This would primarily be used by the module function vxPublishKernels.
char vx_char
An 8 bit ASCII character.
float vx_float32
A 32-bit float value.
vx_pyramid vxCreatePyramid(vx_context context, vx_size levels, vx_float32 scale, vx_uint32 width, vx_uint32 height, vx_df_image format)
Creates a reference to a pyramid object of the supplied number of levels.
vx_status vxReleaseKernel(vx_kernel *kernel)
Release the reference to the kernel. The object may not be garbage collected until its total referenc...
vx_pyramid vxCreateVirtualPyramid(vx_graph graph, vx_size levels, vx_float32 scale, vx_uint32 width, vx_uint32 height, vx_df_image format)
Creates a reference to a virtual pyramid object of the supplied number of levels. ...
vx_status vxReleaseDelay(vx_delay *delay)
Releases a reference to a delay object. The object may not be garbage collected until its total refer...
vx_status vxCommitArrayRange(vx_array arr, vx_size start, vx_size end, void *ptr)
Commits data back to the Array object.
vx_status vxReleaseScalar(vx_scalar *scalar)
Releases a reference to a scalar object. The object may not be garbage collected until its total refe...
vx_status vxReleaseRemap(vx_remap *table)
Releases a reference to a remap table object. The object may not be garbage collected until its total...
vx_enum vx_status
A formal status type with known fixed size.
vx_status vxScheduleGraph(vx_graph graph)
Schedules a graph for future execution.
struct _vx_context * vx_context
An opaque reference to the implementation context.
struct _vx_meta_format * vx_meta_format
This structure is used to extract meta data from a validation function. If the data object between no...
vx_status vxReleaseConvolution(vx_convolution *conv)
Releases the reference to a convolution matrix. The object may not be garbage collected until its tot...
vx_status vxGetValidRegionImage(vx_image image, vx_rectangle_t *rect)
Retrieves the valid region of the image as a rectangle.
struct _vx_reference * vx_reference
A generic opaque reference to any object within OpenVX.
vx_status vxCommitConvolutionCoefficients(vx_convolution conv, vx_int16 *array)
Sets the convolution data (copy),.
vx_nodecomplete_f vxRetrieveNodeCallback(vx_node node)
Retrieves the current node callback function pointer set on the node.
vx_status vxReleaseGraph(vx_graph *graph)
Releases a reference to a graph. The object may not be garbage collected until its total reference co...
vx_status vxReleaseArray(vx_array *arr)
Releases a reference of an Array object. The object may not be garbage collected until its total refe...
vx_array vxCreateArray(vx_context context, vx_enum item_type, vx_size capacity)
Creates a reference to an Array object.
vx_status vxAddArrayItems(vx_array arr, vx_size count, void *ptr, vx_size stride)
Adds items to the Array.
vx_status vxGetStatus(vx_reference reference)
Provides a generic API to return status values from Object constructors if they fail.
vx_size vxComputeImagePatchSize(vx_image image, vx_rectangle_t *rect, vx_uint32 plane_index)
This computes the size needed to retrieve an image patch from an image.
vx_status vxQueryConvolution(vx_convolution conv, vx_enum attribute, void *ptr, vx_size size)
Queries an attribute on the convolution matrix object.
uint32_t vx_df_image
Used to hold a VX_DF_IMAGE code to describe the pixel format and color space.
vx_status vxQueryRemap(vx_remap r, vx_enum attribute, void *ptr, vx_size size)
Queries attributes from a Remap table.
vx_status vxReleaseContext(vx_context *context)
Releases the OpenVX object context.
vx_status vxProcessGraph(vx_graph graph)
This function causes the synchronous processing of a graph. If the graph has not been verified...
void vxRegisterLogCallback(vx_context context, vx_log_callback_f callback, vx_bool reentrant)
Registers a callback facility to the OpenVX implementation to receive error logs. ...
vx_parameter vxGetGraphParameterByIndex(vx_graph graph, vx_uint32 index)
Retrieves a vx_parameter from a vx_graph.
vx_bool vxIsGraphVerified(vx_graph graph)
Returns a Boolean to indicate the state of graph verification.
void * vxFormatImagePatchAddress1d(void *ptr, vx_uint32 index, vx_imagepatch_addressing_t *addr)
Accesses a specific indexed pixel in an image patch.
vx_status vxQueryArray(vx_array arr, vx_enum attribute, void *ptr, vx_size size)
Queries the Array for some specific information.
vx_status vxQueryScalar(vx_scalar scalar, vx_enum attribute, void *ptr, vx_size size)
Queries attributes from a scalar.
vx_status vxSetGraphAttribute(vx_graph graph, vx_enum attribute, void *ptr, vx_size size)
Allows the set to attributes on the Graph.
vx_status(* vx_kernel_initialize_f)(vx_node node, vx_reference *parameters, vx_uint32 num)
The pointer to the kernel initializer. If the host code requires a call to initialize data once all t...
vx_status vxAccessConvolutionCoefficients(vx_convolution conv, vx_int16 *array)
Gets the convolution data (copy).
struct _vx_pyramid * vx_pyramid
The Image Pyramid object. A set of scaled images.
vx_node vxCreateGenericNode(vx_graph graph, vx_kernel kernel)
Creates a reference to a node object for a given kernel.
vx_status vxSetMetaFormatAttribute(vx_meta_format meta, vx_enum attribute, void *ptr, vx_size size)
Allows a user to set the attributes of a vx_meta_format object in a kernel output validator...
struct _vx_kernel * vx_kernel
An opaque reference to the descriptor of a kernel.
vx_status vxAssignNodeCallback(vx_node node, vx_nodecomplete_f callback)
Assigns a callback to a node. If a callback already exists in this node, this function must return an...
vx_status vxAccessImagePatch(vx_image image, vx_rectangle_t *rect, vx_uint32 plane_index, vx_imagepatch_addressing_t *addr, void **ptr, vx_enum usage)
Allows the User to extract a rectangular patch (subset) of an image from a single plane...
vx_status vxQueryContext(vx_context context, vx_enum attribute, void *ptr, vx_size size)
Queries the context for some specific information.
vx_status vxWaitGraph(vx_graph graph)
Waits for a specific graph to complete.
vx_status vxFinalizeKernel(vx_kernel kernel)
This API is called after all parameters have been added to the kernel and the kernel is ready to be u...
The rectangle data structure that is shared with the users.
vx_status vxCommitLUT(vx_lut lut, void *ptr)
Commits the Lookup Table.
vx_status(* vx_kernel_deinitialize_f)(vx_node node, vx_reference *parameters, vx_uint32 num)
The pointer to the kernel deinitializer. If the host code requires a call to deinitialize data during...
vx_status vxAddParameterToKernel(vx_kernel kernel, vx_uint32 index, vx_enum dir, vx_enum data_type, vx_enum state)
Allows users to set the signatures of the custom kernel.
vx_status vxQueryMatrix(vx_matrix mat, vx_enum attribute, void *ptr, vx_size size)
Queries an attribute on the matrix object.
vx_status vxSetConvolutionAttribute(vx_convolution conv, vx_enum attribute, void *ptr, vx_size size)
Sets attributes on the convolution object.
vx_status vxHint(vx_context context, vx_reference reference, vx_enum hint)
Provides a generic API to give platform-specific hints to the implementation.
vx_kernel vxGetKernelByName(vx_context context, vx_char *name)
Obtains a reference to a kernel using a string to specify the name.
vx_status vxReleasePyramid(vx_pyramid *pyr)
Releases a reference to a pyramid object. The object may not be garbage collected until its total ref...
vx_status vxCommitScalarValue(vx_scalar ref, void *ptr)
Sets the scalar value in a reference.
vx_status vxGetRemapPoint(vx_remap table, vx_uint32 dst_x, vx_uint32 dst_y, vx_float32 *src_x, vx_float32 *src_y)
Retrieves the source pixel point from a destination pixel.
vx_status vxQueryLUT(vx_lut lut, vx_enum attribute, void *ptr, vx_size size)
Queries attributes from a LUT.
vx_status vxSetKernelAttribute(vx_kernel kernel, vx_enum attribute, void *ptr, vx_size size)
Sets kernel attributes.
struct _vx_convolution * vx_convolution
The Convolution Object. A user-defined convolution kernel of MxM elements.
vx_status vxSetRemapPoint(vx_remap table, vx_uint32 dst_x, vx_uint32 dst_y, vx_float32 src_x, vx_float32 src_y)
Assigns a destination pixel mapping to the source pixel.
vx_status vxQueryThreshold(vx_threshold thresh, vx_enum attribute, void *ptr, vx_size size)
Queries an attribute on the threshold object.
#define VX_MAX_KERNEL_NAME
Defines the maximum string length of a kernel name to be added to OpenVX.
vx_status vxReleaseThreshold(vx_threshold *thresh)
Releases a reference to a threshold object. The object may not be garbage collected until its total r...
struct _vx_remap * vx_remap
The remap table Object. A remap table contains per-pixel mapping of output pixels to input pixels...
vx_array vxCreateVirtualArray(vx_graph graph, vx_enum item_type, vx_size capacity)
Creates an opaque reference to a virtual Array with no direct user access.
uint32_t vx_uint32
A 32-bit unsigned value.
vx_status vxAccessLUT(vx_lut lut, void **ptr, vx_enum usage)
Gets direct access to the LUT table data.
vx_distribution vxCreateDistribution(vx_context context, vx_size numBins, vx_size offset, vx_size range)
Creates a reference to a 1D Distribution with a start offset, valid range, and number of equally weig...
vx_parameter vxGetKernelParameterByIndex(vx_kernel kernel, vx_uint32 index)
Retrieves a vx_parameter from a vx_kernel.
vx_status vxDirective(vx_context context, vx_reference reference, vx_enum directive)
Provides a generic API to give platform-specific directives to the implementations.
vx_threshold vxCreateThreshold(vx_context c, vx_enum thresh_type, vx_enum data_type)
Creates a reference to a threshold object of a given type.
vx_lut vxCreateLUT(vx_context context, vx_enum data_type, vx_size count)
Creates LUT object of a given type.
vx_status vxSetThresholdAttribute(vx_threshold thresh, vx_enum attribute, void *ptr, vx_size size)
Sets attributes on the threshold object.
vx_action(* vx_nodecomplete_f)(vx_node node)
A callback to the client after a particular node has completed.
vx_graph vxCreateGraph(vx_context context)
Creates an empty graph.
vx_status vxSetContextAttribute(vx_context context, vx_enum attribute, void *ptr, vx_size size)
Sets an attribute on the context.
struct _vx_graph * vx_graph
An opaque reference to a graph.
vx_status vxReleaseDistribution(vx_distribution *distribution)
Releases a reference to a distribution object. The object may not be garbage collected until its tota...
vx_status vxVerifyGraph(vx_graph graph)
Verifies the state of the graph before it is executed. This is useful to catch programmer errors and ...
vx_status vxSetGraphParameterByIndex(vx_graph graph, vx_uint32 index, vx_reference value)
Sets a reference to the parameter on the graph. The implementation must set this parameter on the ori...
vx_status(* vx_kernel_input_validate_f)(vx_node node, vx_uint32 index)
The user-defined kernel node input parameter validation function.
struct _vx_node * vx_node
An opaque reference to a kernel node.
vx_image vxCreateImage(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image color)
Creates an opaque reference to an image buffer.
vx_status vxSetParameterByIndex(vx_node node, vx_uint32 index, vx_reference value)
Sets the specified parameter data for a kernel on the node.
vx_status vxQueryParameter(vx_parameter param, vx_enum attribute, void *ptr, vx_size size)
Allows the client to query a parameter to determine its meta-information.
vx_delay vxCreateDelay(vx_context context, vx_reference exemplar, vx_size count)
Creates a Delay object.
struct _vx_matrix * vx_matrix
The Matrix Object. An MxN matrix of some unit type.
struct _vx_scalar * vx_scalar
An opaque reference to a scalar.
vx_status vxAccessMatrix(vx_matrix mat, void *array)
Gets the matrix data (copy).
vx_scalar vxCreateScalar(vx_context context, vx_enum data_type, void *ptr)
Creates a reference to a scalar object. Also see Node Parameters.
vx_image vxCreateVirtualImage(vx_graph graph, vx_uint32 width, vx_uint32 height, vx_df_image color)
Creates an opaque reference to an image buffer with no direct user access. This function allows setti...
vx_status vxReleaseNode(vx_node *node)
Releases a reference to a Node object. The object may not be garbage collected until its total refere...
vx_status vxQueryPyramid(vx_pyramid pyr, vx_enum attribute, void *ptr, vx_size size)
Queries an attribute from an image pyramid.
vx_status vxQueryGraph(vx_graph graph, vx_enum attribute, void *ptr, vx_size size)
Allows the user to query attributes of the Graph.
vx_status vxSetParameterByReference(vx_parameter parameter, vx_reference value)
Associates a parameter reference and a data reference with a kernel on a node.
struct _vx_lut * vx_lut
The Look-Up Table (LUT) Object.
vx_status vxAccessDistribution(vx_distribution distribution, void **ptr, vx_enum usage)
Gets direct access to a Distribution in memory.
vx_status vxLoadKernels(vx_context context, vx_char *module)
Loads one or more kernels into the OpenVX context. This is the interface by which OpenVX is extensibl...
vx_image vxCreateUniformImage(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image color, void *value)
Creates a reference to an image object that has a singular, uniform value in all pixels.