Add AspectAdjust to subtitles.
[libdcp.git] / src / types.h
index 08613c79774fb8a01980c0ef74e390958b5aff0c..52b831f7b864016c25c01327d6f161da70bf8915 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 namespace dcp
 {
 
-namespace parse {
-       class AssetMap;
-}
+/** @struct Size
+ *  @brief The integer, two-dimensional size of something.
+ */
+struct Size
+{
+       Size ()
+               : width (0)
+               , height (0)
+       {}
+
+       Size (int w, int h)
+               : width (w)
+               , height (h)
+       {}
+
+       float ratio () const {
+               return float (width) / height;
+       }
+       
+       int width;
+       int height;
+};
 
 /** Identifier for a sound channel */
 enum Channel {
@@ -43,8 +62,12 @@ enum Channel {
        LFE = 3,       ///< low-frequency effects (sub)
        LS = 4,        ///< left surround
        RS = 5,        ///< right surround
-       CHANNEL_7 = 6, ///< channel 7; not sure what this should be called
-       CHANNEL_8 = 7  ///< channel 8; not sure what this should be called
+       HI = 6,
+       VI = 7,
+       LC = 8,
+       RC = 9,
+       BSL = 10,
+       BSR = 11
 };
 
 enum ContentKind
@@ -127,7 +150,8 @@ struct EqualityOptions
                , max_std_dev_pixel_error (0)
                , max_audio_sample_error (0)
                , cpl_annotation_texts_can_differ (false)
-               , mxf_names_can_differ (false)
+               , mxf_filenames_can_differ (false)
+               , reel_annotation_texts_can_differ (false)
                , reel_hashes_can_differ (false)
        {}
 
@@ -139,8 +163,10 @@ struct EqualityOptions
        int max_audio_sample_error;
        /** true if the <AnnotationText> nodes of CPLs are allowed to differ */
        bool cpl_annotation_texts_can_differ;
-       /** true if MXF filenames are allowed to differ */
-       bool mxf_names_can_differ;
+       /** true if MXF file leafnames are allowed to differ */
+       bool mxf_filenames_can_differ;
+       /** true if the <AnnotationText> nodes of Reels are allowed to differ */
+       bool reel_annotation_texts_can_differ;
        /** true if <Hash>es in Reels can differ */
        bool reel_hashes_can_differ;
 };
@@ -186,10 +212,12 @@ extern bool operator== (Colour const & a, Colour const & b);
 extern bool operator!= (Colour const & a, Colour const & b);
 extern std::ostream & operator<< (std::ostream & s, Colour const & c);
 
-typedef std::pair<std::string, boost::shared_ptr<const parse::AssetMap> > PathAssetMap;
-
 typedef boost::function<void (NoteType, std::string)> NoteHandler;
 
+/** Maximum absolute difference between dcp::SubtitleString::aspect_adjust values that
+ *  are considered equal.
+ */
+#define ASPECT_ADJUST_EPSILON (1e-3)
 
 }