Class TensorShapeInfoImage

Inheritance Relationships

Base Type

Derived Type

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.

inline int32_t numRows() const

Returns the number of rows in the tensor. (i.e nHwc)

Returns:

The number of rows.

inline const Size2D &size() const

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 and TensorLayoutInfo 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)

Protected Attributes

Size2D m_cacheSize
int m_cacheNumChannels