Dynamically remaps pixels from an input image to an output image via a user-provided map image. More...
Functions | |
VPIStatus | vpiCreateDynamicRemap (uint64_t backends, VPIPayload *payload) |
Create a payload for Dynamic Remap algorithm. More... | |
VPIStatus | vpiSubmitDynamicRemap (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage input, VPIImage output, VPIImage map, VPIInterpolationType inputInterpolation, VPIInterpolationType mapInterpolation, VPIBorderExtension border, uint64_t flags) |
Submits a Dynamic Remap operation to the stream. More... | |
Dynamically remaps pixels from an input image to an output image via a user-provided map image.
It is dynamic since it allows for dynamic update of the map image, as a regular async stream ordered operation.
Refer to Dynamic Remap for more details and usage examples.
VPIStatus vpiCreateDynamicRemap | ( | uint64_t | backends, |
VPIPayload * | payload | ||
) |
#include <vpi/algo/DynamicRemap.h>
Create a payload for Dynamic Remap algorithm.
This function allocates all resources needed by the Dynamic Remap algorithm and ties the returned payload to the given stream.
[in] | backends | VPI backends that are eligible to execute the algorithm.
|
[out] | payload | Pointer to the payload variable that receives the created handle.
|
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | warpMap is NULL. |
VPI_ERROR_INVALID_ARGUMENT | backends refers to an invalid backend. |
VPI_ERROR_NOT_IMPLEMENTED | Algorithm is not supported by given backends. |
VPI_ERROR_INVALID_CONTEXT | Current context is destroyed. |
VPI_ERROR_OUT_OF_MEMORY | Cannot allocate required resources. |
VPI_ERROR_INVALID_OPERATION | Backend isn't enabled in current context. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiSubmitDynamicRemap | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | input, | ||
VPIImage | output, | ||
VPIImage | map, | ||
VPIInterpolationType | inputInterpolation, | ||
VPIInterpolationType | mapInterpolation, | ||
VPIBorderExtension | border, | ||
uint64_t | flags | ||
) |
#include <vpi/algo/DynamicRemap.h>
Submits a Dynamic Remap operation to the stream.
The dynamic remap copies values from input to output via a map, using two sampling steps: (1) a control-point value is sampled in the map; (2) a pixel value is sampled in the input. The following formula summarizes the two sampling steps: output(i, j) = input(map(i, j)); where each sampling step has its own interpolation.
[in] | stream | The stream where the operation will be queued in.
|
[in] | backend | Backend that will execute the algorithm.
|
[in] | payload | Payload created by vpiCreateDynamicRemap. |
[in] | input | Image to be remapped.
|
[out] | output | Stores the remapped image.
|
[out] | map | Stores the mapping of output coordinates into the input image.
|
[in] | inputInterpolation | Interpolation method to be used when fetching values from input. Valid values: |
[in] | mapInterpolation | Interpolation method to be used when fetching values from map. Valid values: |
[in] | border | What value to pick if remapped coordinates fall outside input image.
|
[in] | flags | Control flags.
|
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | input or map or output are NULL. |
VPI_ERROR_INVALID_ARGUMENT | payload is not generated using vpiCreateDynamicRemap. |
VPI_ERROR_INVALID_ARGUMENT | input and output must have the same format. |
VPI_ERROR_INVALID_ARGUMENT | border not supported. |
VPI_ERROR_INVALID_ARGUMENT | flags has an invalid combination. |
VPI_ERROR_INVALID_PAYLOAD_TYPE | payload is invalid. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream , input or output or map . |
VPI_SUCCESS | Operation executed successfully. |