Wrapper class for ImageWrapper. This extends the descriptors by defining behaviors for when tensor coordinates go out of scope.
More...
#include <border_wrapper.hpp>
|
__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...
|
|
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
-
T | The underlying data type of the tensor. |
BorderType | The border type to use when coordinates are out of bounds. |
◆ BorderWrapper() [1/2]
template<typename T , eBorderType BorderType>
Wraps an ImageWrapper and extends its capabilities to handle out of bounds coordinates.
- Parameters
-
tensor | The tensor to wrap. |
border_value | The fallback border color to use when using a constant border mode. |
◆ BorderWrapper() [2/2]
template<typename T , eBorderType BorderType>
Constructs a BorderWrapper from an existing ImageWrapper. Extends its capabilities to handle out of bound coordinates.
- Parameters
-
image_wrapper | The ImageWrapper to wrap around the BorderWrapper. |
border_value | The fallback border color to use when using a constant border mode. |
◆ 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
-
n | The batch index. |
h | The height index. |
w | The width index. |
c | The channel index. |
- Returns
- A reference to the underlying data or a fallback border value of type T.
◆ batches()
template<typename T , eBorderType BorderType>
Retrieves the number of batches in the image tensor.
- Returns
- Number of batches.
◆ channels()
template<typename T , eBorderType BorderType>
Retries the number of channels in the image.
- Returns
- Image channels.
◆ height()
template<typename T , eBorderType BorderType>
Retrives the height of the images.
- Returns
- Image height.
◆ width()
template<typename T , eBorderType BorderType>
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