VPI - Vision Programming Interface

3.1 Release


Changes the dimensions of the input image while stretching/squeezing it. More...


VPIStatus vpiSubmitRescale (VPIStream stream, uint64_t backend, VPIImage input, VPIImage output, VPIInterpolationType interpolationType, VPIBorderExtension border, uint64_t flags)
 Changes the size and scale of a 2D image. More...

Detailed Description

Changes the dimensions of the input image while stretching/squeezing it.

Refer to Rescale for more details and usage examples.

Function Documentation

◆ vpiSubmitRescale()

VPIStatus vpiSubmitRescale ( VPIStream  stream,
uint64_t  backend,
VPIImage  input,
VPIImage  output,
VPIInterpolationType  interpolationType,
VPIBorderExtension  border,
uint64_t  flags 

#include <vpi/algo/Rescale.h>

Changes the size and scale of a 2D image.

[in]streamThe stream where the operation will be queued in.
  • Must not be NULL.
  • Stream must have enabled the backends that will execute the algorithm.
[in]backendVPI backend that will execute the algorithm.
[in]inputInput image to be rescaled.
[out]outputOutput image with the desired resulting dimensions.
  • Must not be NULL.
  • Image must have enabled the backends that will execute the algorithm.
  • Dimensions must be >= 1x1. On VIC, valid range is >= 16x16 and <= 16384x16384.
  • On VIC, when using YUV formats with chroma-subsampling of 4:2:0, 4:2:2 or 4:2:2R, the image dimensions must be even.
  • On VIC, scale factor (output/input) must be between 1/16.0f and 16.0f.
  • On VIC, input and output formats can be different. Accepted formats are the same as input, provided that the following constraints are met:
    • No bit depth conversion is allowed, i.e., Y8 to Y16, Y16 to NV12, etc.
    • No conversion from/to Y16_ER, except when only changing layout. Example: Y16_ER_BL to Y16_ER is allowed, but Y16_ER_BL to Y16 or Y16_BL isn't.
  • On other backends, input and output formats must be the same.
[in]interpolationTypeInterpolation method to be used.
[in]borderBorder extension to be used when sampling pixels outside the image border.
[in]flagsControl flags.
  • Valid values are a combination of one or more of the following flags:
    • 0: default, negation of all other flags.
    • VPI_PRECISE : precise, but potentially slower implementation.
Return values
VPI_ERROR_INVALID_ARGUMENTinput or output dimensions are outside valid range.
VPI_ERROR_INVALID_ARGUMENTflags has some unsupported flag(s).
VPI_ERROR_INVALID_ARGUMENTborder not supported.
VPI_ERROR_INVALID_ARGUMENTinterpolationType not supported.
VPI_ERROR_INVALID_ARGUMENTbackend is invalid or unknown.
VPI_ERROR_INVALID_ARGUMENTinput and output formats are not compatible.
VPI_ERROR_INVALID_IMAGE_FORMATinput or output format not supported.
VPI_ERROR_NOT_IMPLEMENTEDRescale algorithm is not supported by given backend.
VPI_ERROR_INVALID_OPERATIONBackend hardware not available.
VPI_ERROR_INVALID_OPERATIONThe needed backends aren't enabled in stream, input or output.
VPI_SUCCESSOperation executed successfully.