The OpenVX Specification  dba1aa3
Object: Remap

Detailed Description

Defines the Remap Object Interface.

Typedefs

typedef struct _vx_remap * vx_remap
 The remap table Object. A remap table contains per-pixel mapping of output pixels to input pixels.
 

Enumerations

enum  vx_remap_attribute_e {
  VX_REMAP_SOURCE_WIDTH = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_REMAP << 8)) + 0x0,
  VX_REMAP_SOURCE_HEIGHT = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_REMAP << 8)) + 0x1,
  VX_REMAP_DESTINATION_WIDTH = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_REMAP << 8)) + 0x2,
  VX_REMAP_DESTINATION_HEIGHT = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_REMAP << 8)) + 0x3
}
 The remap object attributes. More...
 

Functions

vx_status VX_API_CALL vxCopyRemapPatch (vx_remap remap, const vx_rectangle_t *rect, vx_size user_stride_y, void *user_ptr, vx_enum user_coordinate_type, vx_enum usage, vx_enum user_mem_type)
 Allows the application to copy a rectangular patch from/into a remap object. More...
 
vx_remap VX_API_CALL 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. More...
 
vx_remap VX_API_CALL vxCreateVirtualRemap (vx_graph graph, vx_uint32 src_width, vx_uint32 src_height, vx_uint32 dst_width, vx_uint32 dst_height)
 Creates an opaque reference to a remap table object without direct user access. More...
 
vx_status VX_API_CALL vxMapRemapPatch (vx_remap remap, const vx_rectangle_t *rect, vx_map_id *map_id, vx_size *stride_y, void **ptr, vx_enum coordinate_type, vx_enum usage, vx_enum mem_type)
 Allows the application to get direct access to a rectangular patch of a remap object. More...
 
vx_status VX_API_CALL vxQueryRemap (vx_remap table, vx_enum attribute, void *ptr, vx_size size)
 Queries attributes from a Remap table. More...
 
vx_status VX_API_CALL vxReleaseRemap (vx_remap *table)
 Releases a reference to a remap table object. The object may not be garbage collected until its total reference count is zero. More...
 
vx_status VX_API_CALL vxUnmapRemapPatch (vx_remap remap, vx_map_id map_id)
 Unmap and commit potential changes to a remap object patch that was previously mapped. More...
 

Enumeration Type Documentation

The remap object attributes.

Enumerator
VX_REMAP_SOURCE_WIDTH 

The source width. Read-only. Use a vx_uint32 parameter.

VX_REMAP_SOURCE_HEIGHT 

The source height. Read-only. Use a vx_uint32 parameter.

VX_REMAP_DESTINATION_WIDTH 

The destination width. Read-only. Use a vx_uint32 parameter.

VX_REMAP_DESTINATION_HEIGHT 

The destination height. Read-only. Use a vx_uint32 parameter.

Definition at line 1131 of file vx_types.h.

Function Documentation

vx_remap VX_API_CALL 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.

Parameters
[in]contextThe reference to the overall context.
[in]src_widthWidth of the source image in pixel.
[in]src_heightHeight of the source image in pixels.
[in]dst_widthWidth of the destination image in pixels.
[in]dst_heightHeight of the destination image in pixels.
Returns
A remap reference vx_remap. Any possible errors preventing a successful creation should be checked using vxGetStatus.
vx_remap VX_API_CALL vxCreateVirtualRemap ( vx_graph  graph,
vx_uint32  src_width,
vx_uint32  src_height,
vx_uint32  dst_width,
vx_uint32  dst_height 
)

Creates an opaque reference to a remap table object without direct user access.

Parameters
[in]graphThe reference to the parent graph.
[in]src_widthWidth of the source image in pixel.
[in]src_heightHeight of the source image in pixels.
[in]dst_widthWidth of the destination image in pixels.
[in]dst_heightHeight of the destination image in pixels.
See also
vxCreateRemap
Returns
A remap reference vx_remap. Any possible errors preventing a successful creation should be checked using vxGetStatus.
vx_status VX_API_CALL vxReleaseRemap ( vx_remap table)

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

Parameters
[in]tableThe pointer to the remap table to release.
Postcondition
After returning from this function the reference is zeroed.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEtable is not a valid vx_remap reference.
vx_status VX_API_CALL vxMapRemapPatch ( vx_remap  remap,
const vx_rectangle_t rect,
vx_map_id map_id,
vx_size stride_y,
void **  ptr,
vx_enum  coordinate_type,
vx_enum  usage,
vx_enum  mem_type 
)

Allows the application to get direct access to a rectangular patch of a remap object.

The patch is specified within the destination dimensions and its data provide the corresponding coordinate within the source dimensions. The patch is mapped as a 2D array of elements of the type associated with the coordinate_type parameter (i.e., vx_coordinates2df_t for VX_TYPE_COORDINATES2DF). The memory layout of the mapped 2D array follows a row-major order where rows are compact (without any gap between elements), and where the potential padding after each lines is determined by (* stride_y).

Parameters
[in]remapThe reference to the remap object that contains the patch to map.
[in]rectThe coordinates of remap patch. The patch must be specified within the bounds of the remap destination dimensions (VX_REMAP_DESTINATION_WIDTH x VX_REMAP_DESTINATION_HEIGHT). (start_x, start_y) gives the coordinate of the topleft element inside the patch, while (end_x, end_y) gives the coordinate of the bottomright element out of the patch.
[out]map_idThe address of a vx_map_id variable where the function returns a map identifier.
  • (*map_id) must eventually be provided as the map_id parameter of a call to vxUnmapRemapPatch.
[out]stride_yThe address of a vx_size variable where the function returns the difference between the address of the first element of two successive lines in the mapped remap patch. The stride value follows the following rule : (*stride_y) >= sizeof(<ELEMENT_TYPE>) * (rect->end_x - rect->start_x)
[out]ptrThe address of a pointer where the function returns where remap patch data can be accessed. (*ptr) is the address of the the top-left element of the remap patch. The returned (*ptr) address is only valid between the call to this function and the corresponding call to vxUnmapRemapPatch.
[in]coordinate_typeThis declares the type of the source coordinate data that the application wants to access in the remap patch. It must be VX_TYPE_COORDINATES2DF.
[in]usageThis declares the access mode for the remap patch, using the vx_accessor_e enumeration.
  • VX_READ_ONLY: after the function call, the content of the memory location pointed by (*ptr) contains the remap patch data. Writing into this memory location is forbidden and its behavior is undefined.
  • VX_READ_AND_WRITE: after the function call, the content of the memory location pointed by (*ptr) contains the remap patch data; writing into this memory is allowed for the location of elements only and will result in a modification of the written elements in the remap object once the patch is unmapped. Writing into a gap between element lines (when (*stride_y) > sizeof(<ELEMENT_TYPE>) * (rect->end_x - rect->start_x)) is forbidden and its behavior is undefined.
  • VX_WRITE_ONLY: after the function call, the memory location pointed by (*ptr) contains undefined data; writing each element of the patch is required prior to unmapping. Elements not written by the application before unmap will become undefined after unmap, even if they were well defined before map. Like for VX_READ_AND_WRITE, writing into a gap between element lines is forbidden and its behavior is undefined.
[in]mem_typeA vx_memory_type_e enumeration that specifies the type of the memory where the remap patch is requested to be mapped.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEremap is not a valid vx_remap reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.
Postcondition
vxUnmapRemapPatch with same (*map_id) value.
vx_status VX_API_CALL vxUnmapRemapPatch ( vx_remap  remap,
vx_map_id  map_id 
)

Unmap and commit potential changes to a remap object patch that was previously mapped.

Unmapping a remap patch invalidates the memory location from which the patch could be accessed by the application. Accessing this memory location after the unmap function completes has an undefined behavior.

Parameters
[in]remapThe reference to the remap object to unmap.
[out]map_idThe unique map identifier that was returned by vxMapRemapPatch .
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEremap is not a valid vx_remap reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.
Precondition
vxMapRemapPatch with same map_id value
vx_status VX_API_CALL vxCopyRemapPatch ( vx_remap  remap,
const vx_rectangle_t rect,
vx_size  user_stride_y,
void *  user_ptr,
vx_enum  user_coordinate_type,
vx_enum  usage,
vx_enum  user_mem_type 
)

Allows the application to copy a rectangular patch from/into a remap object.

The patch is specified within the destination dimensions and its data provide the corresponding coordinate within the source dimensions. The patch in user memory is a 2D array of elements of the type associated with the coordinate_type parameter (i.e., vx_coordinates2df_t for VX_TYPE_COORDINATES2DF). The memory layout of this array follows a row-major order where rows are compact (without any gap between elements), and where the potential padding after each line is determined by the user_stride_y parameter.

Parameters
[in]remapThe reference to the remap object that is the source or the destination of the patch copy.
[in]rectThe coordinates of remap patch. The patch must be specified within the bounds of the remap destination dimensions (VX_REMAP_DESTINATION_WIDTH x VX_REMAP_DESTINATION_HEIGHT). (start_x, start_y) gives the coordinate of the topleft element inside the patch, while (end_x, end_y) gives the coordinate of the bottomright element out of the patch.
[in]user_stride_yThe difference between the address of the first element of two successive lines of the remap patch in user memory (pointed by user_ptr). The layout of the user memory must follow a row major order and user_stride_y must follow the following rule : user_stride_y >= sizeof(<ELEMENT_TYPE>) * (rect->end_x - rect->start_x).
[in]user_ptrThe address of the user memory location where to store the requested remap data if the copy was requested in read mode, or from where to get the remap data to store into the remap object if the copy was requested in write mode. user_ptr is the address of the the top-left element of the remap patch. The accessible user memory must be large enough to contain the specified patch with the specified layout: accessible memory in bytes >= (rect->end_y - rect->start_y) * user_stride_y.
[in]user_coordinate_typeThis declares the type of the source coordinate remap data in the user memory. It must be VX_TYPE_COORDINATES2DF.
[in]usageThis declares the effect of the copy with regard to the remap object using the vx_accessor_e enumeration. Only VX_READ_ONLY and VX_WRITE_ONLY are supported:
  • VX_READ_ONLY means that data is copied from the remap object into the user memory pointer by user_ptr. The potential padding after each line in user memory will stay unchanged.
  • VX_WRITE_ONLY means that data is copied into the remap object from the user memory.
[in]user_mem_typeA vx_memory_type_e enumeration that specifies the type of the memory pointer by user_ptr.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEremap is not a valid vx_remap reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.
vx_status VX_API_CALL vxQueryRemap ( vx_remap  table,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Queries attributes from a Remap table.

Parameters
[in]tableThe remap to query.
[in]attributeThe attribute to query. Use a vx_remap_attribute_e enumeration.
[out]ptrThe location at which to store the resulting value.
[in]sizeThe size in bytes of the container to which ptr points.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEtable is not a valid vx_remap reference.