Template Class BorderWrap< TW, NVCV_BORDER_CONSTANT, ActiveDimensions… >

Inheritance Relationships

Base Type

Class Documentation

template<class TW, bool... ActiveDimensions>
class BorderWrap<TW, NVCV_BORDER_CONSTANT, ActiveDimensions...> : public nvcv::cuda::detail::BorderWrapImpl<TW, NVCV_BORDER_CONSTANT, ActiveDimensions...>

Border wrapper class specialized for NVCV_BORDER_CONSTANT.

Template Parameters:
  • TW – It is a TensorWrap class with any dimension and type.

  • ActiveDimensions – Flags to inform active (true) or inactive (false) dimensions.

Public Functions

BorderWrap() = default
template<typename... Args> inline explicit __host__ __device__ BorderWrap (TensorWrapper tensorWrap, ValueType borderValue, Args... tensorShape)

Constructs a BorderWrap by wrapping a tensorWrap.

Parameters:
  • tensorWrap[in] A TensorWrap or FullTensorWrap object to be wrapped.

  • borderValue[in] The border value to be used when accessing outside the tensor.

  • tensorShape0..D[in] Each shape from first to last dimension of the TensorWrap. This may be empty in case of wrapping a FullTensorWrap.

inline explicit __host__ BorderWrap(const TensorDataStridedCuda &tensor, ValueType borderValue = {})

Constructs a BorderWrap by wrapping a tensor.

Parameters:
  • tensor[in] A TensorDataStridedCuda object to be wrapped.

  • borderValue[in] The border value to be used when accessing outside the tensor.

inline __host__ __device__ ValueType borderValue () const

Get the border value of this border wrap.

Returns:

The border value.

template<typename DimType, class = Require<std::is_same_v<int, BaseType<DimType>>>> inline const __host__ __device__ ValueType & operator[] (DimType c) const

Subscript operator for read-only access.

Parameters:

c[in] N-D coordinate (from last to first dimension) to be accessed.

Returns:

Accessed const reference.

template<typename... Args> inline __host__ __device__ ValueType * ptr (Args... c) const

Get a read-only or read-and-write proxy (as pointer) at the Dth dimension.

Note

This method may return a nullptr pointer when accessing outside the wrapped TensorWrap since this border wrap is for constant border and there is no pointer representation for the constant border value.

Parameters:

c0..D[in] Each coordinate from first to last dimension.

Returns:

The (const) pointer to the beginning at the Dth dimension.