@@ -17,8 +17,6 @@
#include <libcamera/base/class.h>
-#include <libcamera/geometry.h>
-
namespace libcamera {
class File;
@@ -14,6 +14,8 @@
#include <libcamera/base/log.h>
#include <libcamera/base/span.h>
+#include <libcamera/geometry.h>
+
#include "libcamera/internal/yaml_parser.h"
namespace libcamera {
@@ -12,6 +12,8 @@
#include <libcamera/base/log.h>
+#include "libcamera/internal/yaml_parser.h"
+
/**
* \file geometry.h
* \brief Data structures related to geometric objects
@@ -924,4 +926,31 @@ std::ostream &operator<<(std::ostream &out, const Rectangle &r)
return out;
}
+#ifndef __DOXYGEN__
+/*
+ * The YAML data shall be a list of two numerical values containing the x and y
+ * coordinates, in that order.
+ */
+template<>
+std::optional<Size>
+YamlObject::Accessor<Size>::get(const YamlObject &obj) const
+{
+ if (obj.type_ != Type::List)
+ return std::nullopt;
+
+ if (obj.list_.size() != 2)
+ return std::nullopt;
+
+ auto width = obj.list_[0].value->get<uint32_t>();
+ if (!width)
+ return std::nullopt;
+
+ auto height = obj.list_[1].value->get<uint32_t>();
+ if (!height)
+ return std::nullopt;
+
+ return Size(*width, *height);
+}
+#endif /* __DOXYGEN__ */
+
} /* namespace libcamera */
@@ -284,27 +284,6 @@ void YamlObject::Accessor<std::string>::set(YamlObject &obj, std::string value)
obj.value_ = std::move(value);
}
-template<>
-std::optional<Size>
-YamlObject::Accessor<Size>::get(const YamlObject &obj) const
-{
- if (obj.type_ != Type::List)
- return std::nullopt;
-
- if (obj.list_.size() != 2)
- return std::nullopt;
-
- auto width = obj.list_[0].value->get<uint32_t>();
- if (!width)
- return std::nullopt;
-
- auto height = obj.list_[1].value->get<uint32_t>();
- if (!height)
- return std::nullopt;
-
- return Size(*width, *height);
-}
-
template<typename T>
struct YamlObject::Accessor<std::vector<T>> {
std::optional<std::vector<T>> get(const YamlObject &obj) const
@@ -336,7 +315,6 @@ template struct YamlObject::Accessor<std::vector<uint16_t>>;
template struct YamlObject::Accessor<std::vector<int32_t>>;
template struct YamlObject::Accessor<std::vector<uint32_t>>;
template struct YamlObject::Accessor<std::vector<std::string>>;
-template struct YamlObject::Accessor<std::vector<Size>>;
#endif /* __DOXYGEN__ */
/**
@@ -14,6 +14,8 @@
#include <libcamera/base/file.h>
#include <libcamera/base/utils.h>
+#include <libcamera/geometry.h>
+
#include "libcamera/internal/yaml_parser.h"
#include "test.h"