Class TensorShapeInfoImage
Defined in File TensorShapeInfo.hpp
Inheritance Relationships
Base Type
public nvcv::detail::TensorShapeInfoImpl< TensorLayoutInfoImage >
(Template Class TensorShapeInfoImpl)
Derived Type
public nvcv::TensorShapeInfoImagePlanar
(Class TensorShapeInfoImagePlanar)
Class Documentation
-
class TensorShapeInfoImage : public nvcv::detail::TensorShapeInfoImpl<TensorLayoutInfoImage>
This class provides detailed information about the shape of an image tensor.
It inherits from TensorShapeInfoImpl and is specialized for the image tensor layout type, offering additional functionality tailored to image tensors, such as retrieving the number of channels, rows, columns, and the overall size.
Subclassed by nvcv::TensorShapeInfoImagePlanar
Public Functions
-
inline int32_t numChannels() const
Returns the number of channels in the tensor. (i.e nhwC)
- Returns:
The number of channels.
-
inline int32_t numCols() const
Returns the number of columns in the tensor. (i.e nhWc)
- Returns:
The number of columns.
Public Static Functions
-
static inline bool IsCompatible(const TensorShape &tshape)
Checks if the provided tensor shape is compatible with this class. A tensor shape is considered compatible if both
TensorShapeInfo
andTensorLayoutInfo
deem it compatible.- Parameters:
tshape – The tensor shape to check.
- Returns:
True if the tensor shape is compatible, false otherwise.
-
static inline Optional<TensorShapeInfoImage> Create(const TensorShape &tshape)
Creates a
TensorShapeInfoImage
object for the provided tensor shape if it is compatible.- Parameters:
tshape – The tensor shape to create the
TensorShapeInfoImage
for.- Returns:
A
TensorShapeInfoImage
object for the provided tensor shape if it is compatible, NullOpt otherwise.
Protected Functions
-
inline TensorShapeInfoImage(const TensorShape &tshape)
-
inline TensorShapeInfoImage(const TensorShape &shape, const TensorLayoutInfoImage &infoLayout)
-
inline int32_t numChannels() const