summaryrefslogtreecommitdiff
path: root/includes/dynamic_depth/dynamic_depth.h
blob: 40a0db744148875ecc080794c230d3281180b696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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