X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Futil.h;h=2f661d772b3457514c80da6416aaf69ca43d18da;hb=d03382e1ffd8b9094b03044daaca99336740c3c4;hp=6332ddc08f157a4f3ec50754f94b7a20408dc137;hpb=5b6d753439207fcb33b84690bcc22d142a7c3bfa;p=libdcp.git diff --git a/src/util.h b/src/util.h index 6332ddc0..2f661d77 100644 --- a/src/util.h +++ b/src/util.h @@ -27,14 +27,22 @@ #include #include #include +#include +#include +#include #include #include "types.h" +namespace xmlpp { + class Element; +} + namespace libdcp { class ARGBFrame; +class CertificateChain; class GammaLUT; -class XYZsRGBLUT; +class XYZFrame; struct Size { Size () @@ -46,6 +54,10 @@ struct Size { : width (w) , height (h) {} + + float ratio () const { + return float (width) / height; + } int width; int height; @@ -55,13 +67,24 @@ extern bool operator== (Size const & a, Size const & b); extern bool operator!= (Size const & a, Size const & b); extern std::string make_uuid (); -extern std::string make_digest (std::string filename); +extern std::string make_digest (std::string filename, boost::function *); extern std::string content_kind_to_string (ContentKind kind); extern ContentKind content_kind_from_string (std::string kind); extern bool empty_or_white_space (std::string s); -extern opj_image_t* decompress_j2k (uint8_t* data, int64_t size, int reduce); -extern boost::shared_ptr xyz_to_rgb (opj_image_t* xyz_frame, boost::shared_ptr, boost::shared_ptr); +extern boost::shared_ptr decompress_j2k (uint8_t* data, int64_t size, int reduce); + +extern void init (); +extern void sign (xmlpp::Element* parent, CertificateChain const & certificates, boost::filesystem::path signer_key, bool interop); +extern void add_signature_value (xmlpp::Element* parent, CertificateChain const & certificates, boost::filesystem::path signer_key, std::string const & ns); +extern void add_signer (xmlpp::Element* parent, CertificateChain const & certificates, std::string const & ns); + +extern int base64_decode (std::string const & in, unsigned char* out, int out_length); + +extern std::string tm_to_string (struct tm *); +extern std::string utc_offset_to_string (int); +extern std::string ptime_to_string (boost::posix_time::ptime); + } #endif