• 04/03/2020
  • Public Content
Contents

Wrapping System Memory with OpenVX* Image

Consider the general interoperability flow:
  1. Map a resource to the CPU.
  2. Create an OpenVX image wrapping the memory:
    // populate the OpenVX structure specifying the image layout vx_imagepatch_addressing_t frameFormat; //dimension in x, in pixels frameFormat.dim_x =...; //dimension in y, in pixels frameFormat.dim_y = ..; //stride in x, in bytes frameFormat.stride_x = ...; //stride in y, in bytes frameFormat.stride_y = ...; void* frameData = ...; //creating input image, by wrapping the host side pointer vx_image im = vxCreateImageFromHandle( context, VX_DF_IMAGE_RGB, &frameFormat, &frameData, VX_MEMORY_TYPE_HOST);
  3. Use the buffer in the OpenVX.
  4. Upon completion of the OpenVX graphs that use the mapped resource bits, the OpenVX image should be destroyed and then the resource can be safely unmapped, returning data ownership to another API.
NOTE: While used by OpenVX*, the original resource (and its mapped data) cannot be used by application.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.