diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2018-11-15 15:49:02 -0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2018-11-15 16:07:24 -0800 |
commit | 09f199a694ef5b956cabc368e40ab5ca11c64044 (patch) | |
tree | 456d184a3817c8b6524a90fc2da60893a2fc1895 /includes/dynamic_depth/dynamic_depth.h | |
parent | 2d25fc4f6a7e7453f877958a2f3f59b6cc588ca4 (diff) | |
download | dynamic_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 'includes/dynamic_depth/dynamic_depth.h')
-rw-r--r-- | includes/dynamic_depth/dynamic_depth.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/includes/dynamic_depth/dynamic_depth.h b/includes/dynamic_depth/dynamic_depth.h new file mode 100644 index 0000000..40a0db7 --- /dev/null +++ b/includes/dynamic_depth/dynamic_depth.h @@ -0,0 +1,34 @@ +#ifndef DYNAMIC_DEPTH_INCLUDES_DYNAMIC_DEPTH_DYNAMIC_DEPTH_H_ // NOLINT +#define DYNAMIC_DEPTH_INCLUDES_DYNAMIC_DEPTH_DYNAMIC_DEPTH_H_ // NOLINT + +#include "dynamic_depth/device.h" +#include "xmpmeta/xmp_writer.h" + +namespace photos_editing_formats { +namespace dynamic_depth { + +// Serialize a JPEG image, its Dynamic Depth metadata, and GContainer files +// if applicable. +bool WriteImageAndMetadataAndContainer(const string& out_filename, + const uint8_t* primary_image_bytes, + size_t primary_image_bytes_count, + Device* device); + +// Retrieves the contents of a Container:Item's associated file. The contents +// are populated into out_payload. +// As per the Dynamic Depth spec, file contents are base64-encoded if they're +// of an image/ mime type, and not if they're of a text/ mime type. Dynamic +// Depth elements that use Container:Item will haev handled this appropriately +// on item construction. +bool GetItemPayload(const string& input_image_filename, + const Container* container, const string& item_uri, + string* out_payload); + +// Convenience method for the aboove. +bool GetItemPayload(const string& input_image_filename, const Device* device, + const string& item_uri, string* out_payload); + +} // namespace dynamic_depth +} // namespace photos_editing_formats + +#endif // DYNAMIC_DEPTH_INCLUDES_DYNAMIC_DEPTH_DYNAMIC_DEPTH_H_ // NOLINT |