Template Function nvcv::cuda::CreateInterpolationWrapNHWC

Function Documentation

template<typename T, NVCVBorderType B, NVCVInterpolationType I, class = Require<HasTypeTraits<T>>>
__host__ auto nvcv::cuda::CreateInterpolationWrapNHWC(const TensorDataStridedCuda &tensor, T borderValue = {}, float scaleX = {}, float scaleY = {})

Factory function to create an NHWC interpolation wrap given a tensor data.

The output InterpolationWrap wraps an NHWC 4D tensor allowing to access data per batch (N), per row (H), per column (W) and per channel (C) of the input tensor interpolation-border aware in rows (or height H) and columns (or width W). The input tensor data must have either NHWC or HWC layout, where the channel C is of type T, e.g. T=uchar for each channel of either RGB8 or RGBA8. The active dimensions are H (second) and W (third).

Template Parameters:
  • T – Type of the values to be accessed in the interpolation wrap.

  • B – Border extension to be used when accessing H and W, one of NVCVBorderType

  • I – Interpolation to be used when accessing H and W, one of NVCVInterpolationType

Parameters:
  • tensor[in] Reference to the tensor that will be wrapped.

  • borderValue[in] Border value to be used when accessing outside elements in constant border type

  • scaleX[in] Scale X value to be used when interpolation elements with area type

  • scaleY[in] Scale Y value to be used when interpolation elements with area type

Returns:

Interpolation wrap useful to access tensor data interpolation-border aware in H and W in CUDA kernels.