diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-04-17 00:36:04 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-04-18 18:13:14 +0300 |
commit | 889b70d62d1b2fa974951866cb8bbebe66fce3a7 (patch) | |
tree | e4c5b8247a68b266cae227f3d82349f8ce0c703b /src/libcamera/utils.cpp | |
parent | 2059b857e1fcccbdd2f3575436d0a9e36f1f2134 (diff) |
libcamera: utils: Add set_overlap() function
The new set_overlap() function counts the number of overlapping elements
in the intersection of two sorted ranges defined by their beginning and
ending iterators.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/utils.cpp')
-rw-r--r-- | src/libcamera/utils.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp index cd0fd761..e38f3268 100644 --- a/src/libcamera/utils.cpp +++ b/src/libcamera/utils.cpp @@ -68,6 +68,18 @@ char *secure_getenv(const char *name) * \brief Constructs an object of type T and wraps it in a std::unique_ptr. */ +/** + * \fn libcamera::utils::set_overlap(InputIt1 first1, InputIt1 last1, + * InputIt2 first2, InputIt2 last2) + * \brief Count the number of elements in the intersection of two ranges + * + * Count the number of elements in the intersection of the sorted ranges [\a + * first1, \a last1) and [\a first1, \a last2). Elements are compared using + * operator< and the ranges must be sorted with respect to the same. + * + * \return The number of elements in the intersection of the two ranges + */ + } /* namespace utils */ } /* namespace libcamera */ |