1 #ifndef DYNAMIC_DEPTH_INCLUDES_XMPMETA_XMP_WRITER_H_ // NOLINT 2 #define DYNAMIC_DEPTH_INCLUDES_XMPMETA_XMP_WRITER_H_ // NOLINT 3 4 #include <iostream> 5 #include <memory> 6 #include <string> 7 8 #include "base/port.h" 9 #include "xmpmeta/xmp_data.h" 10 11 namespace dynamic_depth { 12 namespace xmpmeta { 13 14 // Creates a new XmpData object and initializes the boilerplate for the 15 // standard XMP section. 16 // The extended section is initialized only if create_extended is true. 17 std::unique_ptr<XmpData> CreateXmpData(bool create_extended); 18 19 // Writes XMP data to an existing JPEG image file. 20 // This is equivalent to writeXMPMeta in geo/lightfield/metadata/XmpUtil.java. 21 // If the extended section is not null, this will modify the given XmpData by 22 // setting a property in the standard section that links it with the 23 // extended section. 24 bool WriteLeftEyeAndXmpMeta(const string& left_data, const string& filename, 25 const XmpData& xmp_data); 26 27 // Same as above, but allows the caller to manage their own istream and ostream. 28 // filename is written to only if metadata serialization is successful. 29 // Assumes the caller will take care of opening and closing the 30 // output_jpeg_stream (if it is associated with a file), as well as 31 // initialization of the input_jpeg_stream. This is nearly equivalent to 32 // writeXMPMeta in kgeo/lightfield/metadata/XmpUtil.java. 33 bool WriteLeftEyeAndXmpMeta(const XmpData& xmp_data, 34 std::istream* input_jpeg_stream, 35 std::ostream* output_jpeg_stream); 36 37 } // namespace xmpmeta 38 } // namespace dynamic_depth 39 40 #endif // DYNAMIC_DEPTH_INCLUDES_XMPMETA_XMP_WRITER_H_ // NOLINT 41