diff options
-rw-r--r-- | include/libcamera/geometry.h | 6 | ||||
-rw-r--r-- | src/libcamera/geometry.cpp | 14 |
2 files changed, 19 insertions, 1 deletions
diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index b2a8e5b0..03962d7d 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -67,7 +67,9 @@ static inline bool operator>=(const Size &lhs, const Size &rhs) return !(lhs < rhs); } -struct SizeRange { +class SizeRange +{ +public: SizeRange() { } @@ -90,6 +92,8 @@ struct SizeRange { { } + std::string toString() const; + Size min; Size max; unsigned int hStep; diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index 1ea10293..e598f6ad 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -267,6 +267,20 @@ bool operator<(const Size &lhs, const Size &rhs) */ /** + * \brief Assemble and return a string describing the size range + * \return A string describing the SizeRange + */ +std::string SizeRange::toString() const +{ + std::stringstream ss; + + ss << "(" << min.toString() << ")-(" << max.toString() << ")/(+" + << hStep << ",+" << vStep << ")"; + + return ss.str(); +} + +/** * \brief Compare size ranges for equality * \return True if the two size ranges are equal, false otherwise */ |