Template Class ImageBatchVarShapeWrapNHWC
Defined in File ImageBatchVarShapeWrap.hpp
Inheritance Relationships
Base Type
private nvcv::cuda::ImageBatchVarShapeWrap< T >
(Template Class ImageBatchVarShapeWrap)
Class Documentation
-
template<typename T>
class ImageBatchVarShapeWrapNHWC : private nvcv::cuda::ImageBatchVarShapeWrap<T> Image batch var-shape wrapper NHWC class to wrap ImageBatchVarShapeDataStridedCuda and number of channels.
This class handles number of channels as a separate run-time parameter instead of built-in
T
. It considers interleaved channels, where they appear in a packed sequence at the last dimension (thus NHWC). It also considers each image in the batch has a single plane.Note
The class ImageBatchVarShapeWrap can be used with its template parameter
T
type as a compound type, where its number of elements yield the number of channels.- Template Parameters:
T – Type (it can be const) of each element inside this wrapper.
Public Functions
-
ImageBatchVarShapeWrapNHWC() = default
-
inline __host__ ImageBatchVarShapeWrapNHWC(const ImageBatchVarShapeDataStridedCuda &images, int numChannels)
Constructs a ImageBatchVarShapeWrapNHWC by wrapping an
images
andnumChannels
arguments.- Parameters:
images – [in] Reference to the list of images that will be wrapped.
numChannels – [in] The number of (interleaved) channels inside the wrapper.
- inline __host__ __device__ const int & numChannels () const
- inline __host__ __device__ T & operator[] (int4 c) const
Subscript operator for either read-only or read-and-write access.
- Parameters:
c – [in] 4D coordinates (x sample, y row, z col, w channel) to be accessed.
- Returns:
Accessed reference.
- inline __host__ __device__ T & operator[] (int3 c) const
Subscript operator for either read-only or read-and-write access.
- Parameters:
c – [in] 3D coordinates (x sample, y row, z col) (first channel) to be accessed.
- Returns:
Accessed reference.
- inline __host__ __device__ T * ptr (int s, int y, int x, int c) const
Get either read-only or read-and-write proxy (as pointer) of the given coordinates.
- 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.
c – [in] Channel index in the image.
- Returns:
The pointer to the beginning of the given coordinates.
- inline __host__ __device__ T * ptr (int s, int y, int x) const
Get either read-only or read-and-write proxy (as pointer) of the given coordinates.
- 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 pointer to the beginning of the given coordinates.
- inline __host__ __device__ T * ptr (int s, int y) const
Get either read-only or read-and-write proxy (as pointer) of the given coordinates.
- 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 pointer to the beginning of the given coordinates.
- inline __host__ __device__ int height (int s, int p=0) const
Get height of plane
p
of images
sample.- Parameters:
s – [in] Sample image index in the list.
p – [in] Plane index in the image.
- Returns:
The height of the given image plane in batch.
- inline const __host__ __device__ NVCVImagePlaneStrided plane (int s, int p=0) const
Get plane
p
of images
sample.- Parameters:
s – [in] Sample image index in the list.
p – [in] Plane index in the image.
- Returns:
The plane of the given image sample in batch.
- inline __host__ __device__ int rowStride (int s, int p=0) const
Get row stride in bytes of plane
p
of images
sample.- Parameters:
s – [in] Sample image index in the list.
p – [in] Plane index in the image.
- Returns:
The row stride in bytes of the given image plane in batch.
- inline __host__ __device__ int width (int s, int p=0) const
Get width of plane
p
of images
sample.- Parameters:
s – [in] Sample image index in the list.
p – [in] Plane index in the image.
- Returns:
The width of the given image plane in batch.