Size Operator

Note

The C++ API provides RAII wrappers around the C API. For detailed documentation including parameters, return values, and limitations, please refer to the corresponding C API documentation.

constexpr bool operator==(const NVCVSize2D &lhs, const Size2D &rhs)

Compares NVCVSize2D with Size2D for equality.

Parameters:
  • lhs – NVCVSize2D on the left side of comparison.

  • rhsSize2D on the right side of comparison.

Returns:

true if both width and height are equal, otherwise false.

constexpr bool operator!=(const NVCVSize2D &lhs, const Size2D &rhs)

Compares NVCVSize2D with Size2D for inequality.

Parameters:
  • lhs – NVCVSize2D on the left side of comparison.

  • rhsSize2D on the right side of comparison.

Returns:

true if width or height are not equal, otherwise false.

constexpr Size2D MaxSize(const Size2D &a, const Size2D &b)

Computes the maximum size in each dimension.

Parameters:
  • a – First size to compare.

  • b – Second size to compare.

Returns:

The size with w and h computed as a maximum of the respective fields in a and b.

inline std::ostream &operator<<(std::ostream &out, const nvcv::Size2D &size)

Overloads the stream insertion operator for Size2D.

This allows for easy printing of Size2D structures in the format “width x height”.

Parameters:
  • out – Output stream to which the size string will be written.

  • sizeSize2D structure to be output.

Returns:

Reference to the modified output stream.

struct Size2D : public NVCVSize2D
#include <Size.hpp>