BorderWrapper< T, BorderType > Class Template Reference

BorderWrapper&lt; T, BorderType &gt; Class Template Reference#

4 min read time

Applies to Linux

rocCV: roccv::BorderWrapper< T, BorderType > Class Template Reference
roccv::BorderWrapper< T, BorderType > Class Template Reference

Wrapper class for ImageWrapper. This extends the descriptors by defining behaviors for when tensor coordinates go out of scope. More...

#include <border_wrapper.hpp>

Public Member Functions

__device__ __host__ const T at (int64_t n, int64_t h, int64_t w, int64_t c) const
 Returns a reference to the underlying data given image coordinates. If the coordinates fall out of bounds, a fallback reference based on the provided border type will be given instead. More...
 
__device__ __host__ int64_t batches () const
 Retrieves the number of batches in the image tensor. More...
 
 BorderWrapper (const Tensor &tensor, T border_value)
 Wraps an ImageWrapper and extends its capabilities to handle out of bounds coordinates. More...
 
 BorderWrapper (ImageWrapper< T > image_wrapper, T border_value)
 Constructs a BorderWrapper from an existing ImageWrapper. Extends its capabilities to handle out of bound coordinates. More...
 
__device__ __host__ int64_t channels () const
 Retries the number of channels in the image. More...
 
__device__ __host__ int64_t height () const
 Retrives the height of the images. More...
 
__device__ __host__ int64_t width () const
 Retrieves the width of the image. More...
 

Detailed Description

template<typename T, eBorderType BorderType>
class roccv::BorderWrapper< T, BorderType >

Wrapper class for ImageWrapper. This extends the descriptors by defining behaviors for when tensor coordinates go out of scope.

Template Parameters
TThe underlying data type of the tensor.
BorderTypeThe border type to use when coordinates are out of bounds.

Constructor & Destructor Documentation

◆ BorderWrapper() [1/2]

template<typename T , eBorderType BorderType>
roccv::BorderWrapper< T, BorderType >::BorderWrapper ( const Tensor tensor,
border_value 
)
inline

Wraps an ImageWrapper and extends its capabilities to handle out of bounds coordinates.

Parameters
tensorThe tensor to wrap.
border_valueThe fallback border color to use when using a constant border mode.

◆ BorderWrapper() [2/2]

template<typename T , eBorderType BorderType>
roccv::BorderWrapper< T, BorderType >::BorderWrapper ( ImageWrapper< T >  image_wrapper,
border_value 
)
inline

Constructs a BorderWrapper from an existing ImageWrapper. Extends its capabilities to handle out of bound coordinates.

Parameters
image_wrapperThe ImageWrapper to wrap around the BorderWrapper.
border_valueThe fallback border color to use when using a constant border mode.

Member Function Documentation

◆ at()

template<typename T , eBorderType BorderType>
__device__ __host__ const T roccv::BorderWrapper< T, BorderType >::at ( int64_t  n,
int64_t  h,
int64_t  w,
int64_t  c 
) const
inline

Returns a reference to the underlying data given image coordinates. If the coordinates fall out of bounds, a fallback reference based on the provided border type will be given instead.

Parameters
nThe batch index.
hThe height index.
wThe width index.
cThe channel index.
Returns
A reference to the underlying data or a fallback border value of type T.

◆ batches()

template<typename T , eBorderType BorderType>
__device__ __host__ int64_t roccv::BorderWrapper< T, BorderType >::batches ( ) const
inline

Retrieves the number of batches in the image tensor.

Returns
Number of batches.

◆ channels()

template<typename T , eBorderType BorderType>
__device__ __host__ int64_t roccv::BorderWrapper< T, BorderType >::channels ( ) const
inline

Retries the number of channels in the image.

Returns
Image channels.

◆ height()

template<typename T , eBorderType BorderType>
__device__ __host__ int64_t roccv::BorderWrapper< T, BorderType >::height ( ) const
inline

Retrives the height of the images.

Returns
Image height.

◆ width()

template<typename T , eBorderType BorderType>
__device__ __host__ int64_t roccv::BorderWrapper< T, BorderType >::width ( ) const
inline

Retrieves the width of the image.

Returns
Image width.

The documentation for this class was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/wrappers/border_wrapper.hpp