Merge master into direct-mxf.
[dcpomatic.git] / src / lib / format.cc
index 088a16059d7f68ac4432f029afacd0ab0b966cb5..016c21fdea09fb60d45636f91d2ee9b5d888879b 100644 (file)
@@ -35,6 +35,7 @@ using std::setprecision;
 using std::stringstream;
 using std::vector;
 using boost::shared_ptr;
+using libdcp::Size;
 
 vector<Format const *> Format::_formats;
 
@@ -147,6 +148,9 @@ FixedFormat::FixedFormat (int r, libdcp::Size dcp, string id, string n, string d
 
 }
 
+/** @return Number of pixels (int the DCP image) to pad either side of the film
+ *  (so there are dcp_padding() pixels on the left and dcp_padding() on the right)
+ */
 int
 Format::dcp_padding (shared_ptr<const Film> f) const
 {
@@ -160,6 +164,12 @@ Format::dcp_padding (shared_ptr<const Film> f) const
        return p;
 }
 
+float
+Format::container_ratio_as_float () const
+{
+       return static_cast<float> (_dcp_size.width) / _dcp_size.height;
+}
+
 VariableFormat::VariableFormat (libdcp::Size dcp, string id, string n, string d)
        : Format (dcp, id, n, d)
 {