summaryrefslogtreecommitdiff
path: root/internal/dynamic_depth/element.h
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2018-11-15 15:49:02 -0800
committerEino-Ville Talvala <etalvala@google.com>2018-11-15 16:07:24 -0800
commit09f199a694ef5b956cabc368e40ab5ca11c64044 (patch)
tree456d184a3817c8b6524a90fc2da60893a2fc1895 /internal/dynamic_depth/element.h
parent2d25fc4f6a7e7453f877958a2f3f59b6cc588ca4 (diff)
downloaddynamic_depth-09f199a694ef5b956cabc368e40ab5ca11c64044.tar.gz
Initial commit of libdynamic_depth
Dynamic depth is a standard for embedding depth maps and other similar extensions into standard image files like JPEG. Test: m libdynamic_depth Bug: 109735087 Bug: 119211681 Change-Id: I0103b7d47e60dc8e3a3b277456903d76f727926f
Diffstat (limited to 'internal/dynamic_depth/element.h')
-rw-r--r--internal/dynamic_depth/element.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/dynamic_depth/element.h b/internal/dynamic_depth/element.h
new file mode 100644
index 0000000..e68829d
--- /dev/null
+++ b/internal/dynamic_depth/element.h
@@ -0,0 +1,34 @@
+#ifndef DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_ // NOLINT
+#define DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_ // NOLINT
+
+#include <unordered_map>
+
+#include "xmpmeta/xml/deserializer.h"
+#include "xmpmeta/xml/serializer.h"
+
+namespace photos_editing_formats {
+namespace dynamic_depth {
+
+/**
+ * An interface for an element in the Dynamic Depth spec.
+ */
+class Element {
+ public:
+ virtual ~Element() {}
+
+ // Appends child elements' namespaces' and their respective hrefs to the
+ // given collection, and any parent nodes' names to prefix_names.
+ // Key: Name of the namespace.
+ // Value: Full namespace URL.
+ // Example: ("Image", "http://ns.google.com/photos/dd/1.0/image/")
+ virtual void GetNamespaces(
+ std::unordered_map<string, string>* ns_name_href_map) = 0;
+
+ // Serializes this element.
+ virtual bool Serialize(xml::Serializer* serializer) const = 0;
+};
+
+} // namespace dynamic_depth
+} // namespace photos_editing_formats
+
+#endif // DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_ // NOLINT