summaryrefslogtreecommitdiff
path: root/includes/dynamic_depth/point_cloud.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/dynamic_depth/point_cloud.h')
-rw-r--r--includes/dynamic_depth/point_cloud.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/includes/dynamic_depth/point_cloud.h b/includes/dynamic_depth/point_cloud.h
index 3e53744..562e3f4 100644
--- a/includes/dynamic_depth/point_cloud.h
+++ b/includes/dynamic_depth/point_cloud.h
@@ -11,7 +11,6 @@
// Implements the Point Cloud element from the Dynamic Depth specification, with
// serialization and deserialization.
-namespace photos_editing_formats {
namespace dynamic_depth {
class PointCloud : public Element {
@@ -19,23 +18,26 @@ class PointCloud : public Element {
void GetNamespaces(
std::unordered_map<string, string>* ns_name_href_map) override;
- bool Serialize(xml::Serializer* serializer) const override;
+ bool Serialize(
+ ::dynamic_depth::xmpmeta::xml::Serializer* serializer) const override;
// Creates a Point Cloud from the given fields. Returns null if position is
- // empty or points.size() is not divisible by 3.
+ // empty or points.size() is not divisible by 4.
// The first two arguments are required fields, the rest are optional.
- // points is a list of (x, y, z) tuples, so it must have a size that is
- // evenly divisible by 3.
+ // points is a list of (x, y, z, c) tuples, so it must have a size that is
+ // evenly divisible by 4.
+ // The first three values are the point's XYZ coordinates, and the fourth
+ // is the confidence value. More details are available in the specification.
static std::unique_ptr<PointCloud> FromData(const std::vector<float>& points,
bool metric);
// Returns the deserialized PointCloud; null if parsing fails.
// The returned pointer is owned by the caller.
static std::unique_ptr<PointCloud> FromDeserializer(
- const xml::Deserializer& parent_deserializer);
+ const ::dynamic_depth::xmpmeta::xml::Deserializer& parent_deserializer);
// Getters.
- // Returns the number of (x, y, z) tuples, *not* the length of points_.
+ // Returns the number of (x, y, z, c) tuples, *not* the length of points_.
int GetPointCount() const;
const std::vector<float>& GetPoints() const;
bool GetMetric() const;
@@ -46,7 +48,8 @@ class PointCloud : public Element {
private:
PointCloud();
- bool ParseFields(const xml::Deserializer& deserializer);
+ bool ParseFields(
+ const ::dynamic_depth::xmpmeta::xml::Deserializer& deserializer);
// Required fields.
std::vector<float> points_;
@@ -56,6 +59,5 @@ class PointCloud : public Element {
};
} // namespace dynamic_depth
-} // namespace photos_editing_formats
-#endif // DYNAMIC_DEPTH_INCLUDES_DYNAMIC_DEPTH_POINT_CLOUD_H_ // NOLINT
+#endif // DYNAMIC_DEPTH_INCLUDES_DYNAMIC_DEPTH_POINT_CLOUD_H_ // NOLINT