Template Class BorderVarShapeWrap< T, NVCV_BORDER_CONSTANT >

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class BorderVarShapeWrap<T, NVCV_BORDER_CONSTANT> : public nvcv::cuda::detail::BorderIWImpl<T, NVCV_BORDER_CONSTANT>

Border var-shape wrapper class specialized for NVCV_BORDER_CONSTANT.

Template Parameters:

T – Type (it can be const) of each element inside the image batch var-shape wrapper.

Public Types

using ImageBatchWrapper = IW
using ValueType = typename ImageBatchWrapper::ValueType

Public Functions

BorderVarShapeWrap() = default
inline explicit __host__ __device__ BorderVarShapeWrap (ImageBatchWrapper imageBatchWrap, ValueType borderValue={})

Constructs a BorderVarShapeWrap by wrapping an imageBatchWrap.

Parameters:
  • imageBatchWrap[in] An ImageBatchVarShapeWrap object to be wrapped.

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

inline explicit __host__ BorderVarShapeWrap(const ImageBatchVarShapeDataStridedCuda &images, ValueType borderValue = {})

Constructs a BorderVarShapeWrap by wrapping images.

Parameters:
  • images[in] An ImageBatchVarShapeDataStridedCuda with image batch information.

  • 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.

inline const __host__ __device__ ValueType & operator[] (int4 c) const

Subscript operator for read-only or read-and-write access (depending on value type).

Parameters:

c[in] 4D coordinate (w sample, z plane, y row and x column) to be accessed.

Returns:

Accessed const reference.

inline const __host__ __device__ ValueType & operator[] (int3 c) const

Subscript operator for read-only or read-and-write access (depending on value type, considering plane=0).

Parameters:

c[in] 3D coordinate (z sample, y row and x column) to be accessed.

Returns:

Accessed const reference.

inline __host__ __device__ ValueType * ptr (int s, int p, int y, int x) const

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

Note

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

Parameters:
  • s[in] Sample image index in the list.

  • p[in] Plane index in the selected image.

  • y[in] Row index in the selected image.

  • x[in] Column index in the selected image.

Returns:

The (const) pointer to the beginning of the given coordinates.

inline __host__ __device__ ValueType * ptr (int s, int y, int x) const

Get a read-only or read-and-write proxy (as pointer) at the given coordinates (considering plane=0).

Note

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

Parameters:
  • s[in] Sample image index in the list.

  • y[in] Row index in the selected image.

  • x[in] Column index in the selected image.

Returns:

The (const) pointer to the beginning of the given coordinates.

inline const __host__ __device__ ImageBatchWrapper & imageBatchWrap () const

Public Static Attributes

static constexpr NVCVBorderType kBorderType
static constexpr int kNumDimensions