Message ID | 20190402171309.6447-3-jacopo@jmondi.org |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Jacopo, Thanks for your patch. On 2019-04-02 19:12:58 +0200, Jacopo Mondi wrote: > Add a simple Size structure that contains an image width and height. > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> > --- > src/libcamera/geometry.cpp | 29 +++++++++++++++++++++++++++++ > src/libcamera/include/geometry.h | 15 +++++++++++++++ > 2 files changed, 44 insertions(+) > > diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp > index f76001d94562..d0c63c353ab3 100644 > --- a/src/libcamera/geometry.cpp > +++ b/src/libcamera/geometry.cpp > @@ -105,4 +105,33 @@ const std::string Rectangle::toString() const > * \brief The maximum image height > */ > > +/** > + * \struct Size > + * \brief Describe a two-dimensional size > + * > + * The Size structure defines a two-dimensional size with integer precision. > + */ > + > +/** > + * \fn Size::Size() > + * \brief Construct a Size with width and height set to 0 > + */ > + > +/** > + * \fn Size::Size(unsigned int width, unsigned int height) > + * \brief Construct a Size with given \a width and \a height > + * \param width The Size width > + * \param height The Size height > + */ > + > +/** > + * \var Size::width > + * \brief The Size width > + */ > + > +/** > + * \var Size::height > + * \brief The Size height > + */ > + > } /* namespace libcamera */ > diff --git a/src/libcamera/include/geometry.h b/src/libcamera/include/geometry.h > index 567a54299b24..315168a5fbbd 100644 > --- a/src/libcamera/include/geometry.h > +++ b/src/libcamera/include/geometry.h > @@ -40,6 +40,21 @@ struct SizeRange { > unsigned int maxHeight; > }; > > +struct Size { > + Size() > + : Size(0, 0) > + { > + } > + > + Size(unsigned int w, unsigned int h) > + : width(w), height(h) > + { > + } > + > + unsigned int width; > + unsigned int height; > +}; > + > } /* namespace libcamera */ > > #endif /* __LIBCAMERA_GEOMETRY_H__ */ > -- > 2.21.0 > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index f76001d94562..d0c63c353ab3 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -105,4 +105,33 @@ const std::string Rectangle::toString() const * \brief The maximum image height */ +/** + * \struct Size + * \brief Describe a two-dimensional size + * + * The Size structure defines a two-dimensional size with integer precision. + */ + +/** + * \fn Size::Size() + * \brief Construct a Size with width and height set to 0 + */ + +/** + * \fn Size::Size(unsigned int width, unsigned int height) + * \brief Construct a Size with given \a width and \a height + * \param width The Size width + * \param height The Size height + */ + +/** + * \var Size::width + * \brief The Size width + */ + +/** + * \var Size::height + * \brief The Size height + */ + } /* namespace libcamera */ diff --git a/src/libcamera/include/geometry.h b/src/libcamera/include/geometry.h index 567a54299b24..315168a5fbbd 100644 --- a/src/libcamera/include/geometry.h +++ b/src/libcamera/include/geometry.h @@ -40,6 +40,21 @@ struct SizeRange { unsigned int maxHeight; }; +struct Size { + Size() + : Size(0, 0) + { + } + + Size(unsigned int w, unsigned int h) + : width(w), height(h) + { + } + + unsigned int width; + unsigned int height; +}; + } /* namespace libcamera */ #endif /* __LIBCAMERA_GEOMETRY_H__ */