[libcamera-devel] [PATCH v2 5/6] libcamera: formats: Expose std::map::value_type
Jacopo Mondi
jacopo at jmondi.org
Tue Jun 9 01:28:43 CEST 2020
In order to prepare to replace usage of custom map in pipeline handlers,
expose the formats map value_type type definition, to allow pipeline
handlers to use STL functions to iterate the class.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
include/libcamera/internal/formats.h | 2 ++
src/libcamera/formats.cpp | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h
index 914fdde27d0c..1361b55d63d2 100644
--- a/include/libcamera/internal/formats.h
+++ b/include/libcamera/internal/formats.h
@@ -22,6 +22,8 @@ template<typename T>
class ImageFormats
{
public:
+ using value_type = typename std::map<T, std::vector<SizeRange>>::value_type;
+
using iterator = typename std::map<T, std::vector<SizeRange>>::iterator;
using const_iterator = typename std::map<T, std::vector<SizeRange>>::const_iterator;
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 9f46f82c9059..5037c5928669 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -34,6 +34,11 @@ LOG_DEFINE_CATEGORY(Formats)
* Sizes are stored as a list of SizeRange.
*/
+/**
+ * \typedef ImageFormats::value_type
+ * \brief Value type of the entries in the formats map
+ */
+
/**
* \typedef ImageFormats::iterator
* \brief Iterator for the formats map
--
2.27.0
More information about the libcamera-devel
mailing list