The OpenVX Specification  a73e458
Object: LUT

Detailed Description

Defines the Look-Up Table Interface.

A lookup table is an array that simplifies run-time computation by replacing computation with a simpler array indexing operation.

Modules

 The Look-Up Table (LUT) attribute list.
 The Look-Up Table (LUT) attribute list.
 

Typedefs

typedef struct _vx_lut * vx_lut
 The Look-Up Table (LUT) Object.
 

Functions

vx_status VX_API_CALL vxCopyLUT (vx_lut lut, void *user_ptr, vx_enum usage, vx_enum user_mem_type)
 Allows the application to copy from/into a LUT object [R00953]. More...
 
vx_lut VX_API_CALL vxCreateLUT (vx_context context, vx_enum data_type, vx_size count)
 Creates LUT object of a given type [R00933]. The value of VX_LUT_OFFSET is equal to 0 for data_type = VX_TYPE_UINT8, and (vx_uint32)(count/2) for VX_TYPE_INT16 [R00934]. More...
 
vx_status VX_API_CALL vxMapLUT (vx_lut lut, vx_map_id *map_id, void **ptr, vx_enum usage, vx_enum mem_type, vx_bitfield flags)
 Allows the application to get direct access to LUT object [R00962]. More...
 
vx_status VX_API_CALL vxQueryLUT (vx_lut lut, vx_enum attribute, void *ptr, vx_size size)
 Queries attributes from a LUT [R00947]. More...
 
vx_status VX_API_CALL vxReleaseLUT (vx_lut *lut)
 Releases a reference to a LUT object [R00943]. The object may not be garbage collected until its total reference count is zero. More...
 
vx_status VX_API_CALL vxUnmapLUT (vx_lut lut, vx_map_id map_id)
 Unmap and commit potential changes to LUT object that was previously mapped [R00977]. Unmapping a LUT invalidates the memory location from which the LUT data could be accessed by the application. Accessing this memory location after the unmap function completes has implementation-dependent behavior. More...
 

Function Documentation

◆ vxCreateLUT()

vx_lut VX_API_CALL vxCreateLUT ( vx_context  context,
vx_enum  data_type,
vx_size  count 
)

Creates LUT object of a given type [R00933]. The value of VX_LUT_OFFSET is equal to 0 for data_type = VX_TYPE_UINT8, and (vx_uint32)(count/2) for VX_TYPE_INT16 [R00934].

Parameters
[in]contextThe reference to the context [R00935].
[in]data_typeThe type of data stored in the LUT [R00936]. The data_type can be VX_TYPE_UINT8 or VX_TYPE_INT16 [R00937].
[in]countThe number of entries desired [R00938].
Note
If data_type is VX_TYPE_UINT8, count should be less than or equal to 256 [R00939]. If data_type is VX_TYPE_INT16, count should be less than or equal to 65536 [R00940].
Returns
An LUT reference vx_lut [R00941]. Any possible errors preventing a successful creation should be checked using vxGetStatus [R00942].

◆ vxReleaseLUT()

vx_status VX_API_CALL vxReleaseLUT ( vx_lut lut)

Releases a reference to a LUT object [R00943]. The object may not be garbage collected until its total reference count is zero.

Parameters
[in]lutThe pointer to the LUT to release [R00944].
Postcondition
After returning from this function the reference is zeroed [R00945].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00946].
VX_ERROR_INVALID_REFERENCElut is not a valid vx_lut reference.

◆ vxQueryLUT()

vx_status VX_API_CALL vxQueryLUT ( vx_lut  lut,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Queries attributes from a LUT [R00947].

Parameters
[in]lutThe LUT to query [R00948].
[in]attributeThe attribute to query. Use a The Look-Up Table (LUT) attribute list. value [R00949].
[out]ptrThe location at which to store the resulting value [R00950].
[in]sizeThe size in bytes of the container to which ptr points [R00951].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00952].
VX_ERROR_INVALID_REFERENCElut is not a valid vx_lut reference.

◆ vxCopyLUT()

vx_status VX_API_CALL vxCopyLUT ( vx_lut  lut,
void *  user_ptr,
vx_enum  usage,
vx_enum  user_mem_type 
)

Allows the application to copy from/into a LUT object [R00953].

Parameters
[in]lutThe reference to the LUT object that is the source or the destination of the copy [R00954].
[in]user_ptrThe address of the memory location where to store the requested data if the copy was requested in read mode, or from where to get the data to store into the LUT object if the copy was requested in write mode [R00955]. In the user memory, the LUT is represented as a array with elements of the type corresponding to VX_LUT_TYPE, and with a number of elements equal to the value returned via VX_LUT_COUNT [R00956]. The accessible memory must be large enough to contain this array: accessible memory in bytes >= sizeof(data_element) * count.
[in]usageThis declares the effect of the copy with regard to the LUT object using the The memory accessor hint flags. value. Only VX_READ_ONLY and VX_WRITE_ONLY are supported [R00957]:
  • VX_READ_ONLY means that data are copied from the LUT object into the user memory [R00958].
  • VX_WRITE_ONLY means that data are copied into the LUT object from the user memory [R00959].
[in]user_mem_typeA Memory import type constants. value that specifies the memory type of the memory referenced by the user_addr [R00960].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00961].
VX_ERROR_INVALID_REFERENCElut is not a valid vx_lut reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.

◆ vxMapLUT()

vx_status VX_API_CALL vxMapLUT ( vx_lut  lut,
vx_map_id map_id,
void **  ptr,
vx_enum  usage,
vx_enum  mem_type,
vx_bitfield  flags 
)

Allows the application to get direct access to LUT object [R00962].

Parameters
[in]lutThe reference to the LUT object to map [R00963].
[out]map_idThe address of a vx_map_id variable where the function returns a map identifier [R00964].
  • (*map_id) must eventually be provided as the map_id parameter of a call to vxUnmapLUT [R00965].
[out]ptrThe address of a pointer that the function sets to the address where the requested data can be accessed [R00966]. In the mapped memory area, the LUT data are structured as an array with elements of the type corresponding to VX_LUT_TYPE, with a number of elements equal to the value returned via VX_LUT_COUNT [R00967]. Accessing the memory out of the bound of this array is forbidden and has implementation-dependent behavior. The returned (*ptr) address is valid between the call to the function and the corresponding call to vxUnmapLUT [R00968].
[in]usageThis declares the access mode for the LUT [R00969].
  • VX_READ_ONLY: after the function call, the content of the memory location pointed by (*ptr) contains the LUT data [R00970]. Writing into this memory location is forbidden and its behavior is implementation-dependent.
  • VX_READ_AND_WRITE: after the function call, the content of the memory location pointed by (*ptr) contains the LUT data [R00971]; writing into this memory is allowed only for the location of entries and will result in a modification of the affected entries in the LUT object once the LUT is unmapped [R00972].
  • VX_WRITE_ONLY: after the function call, the data at memory location pointed by (*ptr) is implementation-dependent; writing each entry of LUT is required prior to unmapping. Entries not written by the application before unmap will become implementation-dependent after unmap, even if they were well defined before map.
[in]mem_typeA Memory import type constants. value that specifies the type of the memory where the LUT is requested to be mapped [R00973].
[in]flagsAn integer that allows passing options to the map operation [R00974]. Use 0 for this option [R00975].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00976].
VX_ERROR_INVALID_REFERENCElut is not a valid vx_lut reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.
Postcondition
vxUnmapLUT with same (*map_id) value.

◆ vxUnmapLUT()

vx_status VX_API_CALL vxUnmapLUT ( vx_lut  lut,
vx_map_id  map_id 
)

Unmap and commit potential changes to LUT object that was previously mapped [R00977]. Unmapping a LUT invalidates the memory location from which the LUT data could be accessed by the application. Accessing this memory location after the unmap function completes has implementation-dependent behavior.

Parameters
[in]lutThe reference to the LUT object to unmap [R00978].
[out]map_idThe unique map identifier that was returned when calling vxMapLUT [R00979].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00980].
VX_ERROR_INVALID_REFERENCElut is not a valid vx_lut reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.
Precondition
vxMapLUT returning the same map_id value [R00981].