Template Class TensorDataAccessStridedImageImpl
Defined in File TensorDataAccess.hpp
Inheritance Relationships
Base Type
public nvcv::detail::TensorDataAccessStridedImpl< ShapeInfo >
(Template Class TensorDataAccessStridedImpl)
Derived Types
public nvcv::detail::TensorDataAccessStridedImagePlanarImpl< TensorShapeInfoImagePlanar >
(Template Class TensorDataAccessStridedImagePlanarImpl)public nvcv::detail::TensorDataAccessStridedImagePlanarImpl< ShapeInfo >
(Template Class TensorDataAccessStridedImagePlanarImpl)
Class Documentation
-
template<typename ShapeInfo>
class TensorDataAccessStridedImageImpl : public nvcv::detail::TensorDataAccessStridedImpl<ShapeInfo> Provides specialized access methods for strided tensor data representing images.
This class is an extension of TensorDataAccessStridedImpl and offers specific utilities for accessing the data in image tensors using a strided memory layout. It provides methods to retrieve the number of columns, rows, channels, and other image-specific properties. Furthermore, it provides utility methods to compute strides and access specific rows, channels, etc.
- Template Parameters:
ShapeInfo – The type that contains shape information for the image tensor.
Subclassed by nvcv::detail::TensorDataAccessStridedImagePlanarImpl< TensorShapeInfoImagePlanar >, nvcv::detail::TensorDataAccessStridedImagePlanarImpl< ShapeInfo >
Public Functions
-
inline TensorDataAccessStridedImageImpl(const TensorDataStrided &tdata, const ShapeInfo &infoShape)
Constructor that initializes the object with the given tensor data and shape information.
- Parameters:
tdata – The strided tensor data.
infoShape – The shape information of the tensor.
-
inline int32_t numCols() const
Returns the number of columns in the image tensor.
- Returns:
The number of columns.
-
inline int32_t numRows() const
Returns the number of rows in the image tensor.
- Returns:
The number of rows.
-
inline int32_t numChannels() const
Returns the number of channels in the image tensor.
- Returns:
The number of channels.
-
inline Size2D size() const
Returns the size (width and height) of the image tensor.
- Returns:
The size of the image.
-
inline int64_t chStride() const
Computes the stride for the channel dimension.
- Returns:
The channel stride, or 0 if the channel dimension is not present.
-
inline int64_t colStride() const
Computes the stride for the column (or width) dimension.
- Returns:
The column stride, or 0 if the width dimension is not present.
-
inline int64_t rowStride() const
Computes the stride for the row (or height) dimension.
- Returns:
The row stride, or 0 if the height dimension is not present.
-
inline int64_t depthStride() const
Computes the stride for the depth dimension.
- Returns:
The depth stride, or 0 if the depth dimension is not present.
-
inline Byte *rowData(int y) const
Retrieves a pointer to the data of a specific row.
- Parameters:
y – The row index.
- Returns:
A pointer to the row’s data.
-
inline Byte *rowData(int y, Byte *base) const
Retrieves a pointer to the data of a specific row, relative to a given base pointer.
- Parameters:
y – The row index.
base – The base pointer from which to compute the row’s data address.
- Returns:
A pointer to the row’s data.
Protected Functions
-
inline TensorDataAccessStridedImageImpl(const TensorDataAccessStridedImageImpl &that, const ShapeInfo &infoShape)