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>
This commit is contained in:
@@ -107,6 +107,15 @@ bool operator==(const Rectangle &lhs, const Rectangle &rhs)
|
||||
* \brief The Size height
|
||||
*/
|
||||
|
||||
/**
|
||||
* \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
|
||||
|
||||
Reference in New Issue
Block a user