libcamera: geometry: Add toString to Rectangle
Add toString() helpers to pretty print out the sizes of a Rectangle. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
* geometry.cpp - Geometry-related structures
|
||||
*/
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "geometry.h"
|
||||
|
||||
/**
|
||||
@@ -46,6 +48,20 @@ namespace libcamera {
|
||||
* \brief The distance between the top and bottom sides
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Assemble and return a string describing the rectangle
|
||||
*
|
||||
* \return A string describing the Rectangle
|
||||
*/
|
||||
const std::string Rectangle::toString() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
ss << "(" << x << "x" << y << ")/" << w << "x" << h;
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* \struct SizeRange
|
||||
* \brief Describe a range of image sizes
|
||||
|
||||
Reference in New Issue
Block a user