diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-04-30 21:16:28 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-04-30 22:18:42 +0300 |
commit | a2dddf7c26df3307b9d4554c25387a00687a6234 (patch) | |
tree | be4004bb072d39d471ee790069e3f74d1cd5bbe0 /src/libcamera/geometry.cpp | |
parent | baad55d00975f8931d51c333def20472457dc943 (diff) |
libcamera: Use the Size class through libcamera
Several of our structures include width and height fields that model a
size while we have a Size class for that purpose. Use the Size class
through libcamera, and give it a toString() method like other geometry
and format classes.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/geometry.cpp')
-rw-r--r-- | src/libcamera/geometry.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index c8aa05f5..97c367bc 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -108,6 +108,15 @@ bool operator==(const Rectangle &lhs, const Rectangle &rhs) */ /** + * \brief Assemble and return a string describing the size + * \return A string describing the size + */ +const std::string Size::toString() const +{ + return std::to_string(width) + "x" + std::to_string(height); +} + +/** * \brief Compare sizes for equality * \return True if the two sizes are equal, false otherwise */ |