X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fformat.h;h=f240c89fc85db4b76ee45f34291e8294dfdbd5b4;hb=47f25009bcbc765e397bcb471dd361a511c99daf;hp=b4c691e56fea19e45b023782d4b255feb77b53dd;hpb=d1b20374b1bd02b2929c9c3080c006874b525ef5;p=dcpomatic.git diff --git a/src/lib/format.h b/src/lib/format.h index b4c691e56..f240c89fc 100644 --- a/src/lib/format.h +++ b/src/lib/format.h @@ -38,15 +38,10 @@ public: , _dci_name (d) {} - /** @return the aspect ratio multiplied by 100 - * (e.g. 239 for Cinemascope 2.39:1) - */ - virtual int ratio_as_integer (boost::shared_ptr f) const = 0; - - /** @return the ratio as a floating point number */ - virtual float ratio_as_float (boost::shared_ptr f) const = 0; + /** @return the ratio of the container (including any padding) */ + float container_ratio () const; - int dcp_padding (boost::shared_ptr f) const; + int dcp_padding (boost::shared_ptr) const; /** @return size in pixels of the images that we should * put in a DCP for this ratio. This size will not correspond @@ -81,6 +76,9 @@ public: static void setup_formats (); protected: + /** @return the ratio */ + virtual float ratio (boost::shared_ptr f) const = 0; + /** libdcp::Size in pixels of the images that we should * put in a DCP for this ratio. This size will not correspond * to the ratio when we are doing things like 16:9 in a Flat frame. @@ -104,22 +102,17 @@ private: class FixedFormat : public Format { public: - FixedFormat (int, libdcp::Size, std::string, std::string, std::string); + FixedFormat (float, libdcp::Size, std::string, std::string, std::string); - int ratio_as_integer (boost::shared_ptr) const { + float ratio (boost::shared_ptr) const { return _ratio; } - float ratio_as_float (boost::shared_ptr) const { - return _ratio / 100.0; - } - std::string name () const; private: - /** Ratio expressed as the actual ratio multiplied by 100 */ - int _ratio; + float _ratio; }; class VariableFormat : public Format @@ -127,8 +120,7 @@ class VariableFormat : public Format public: VariableFormat (libdcp::Size, std::string, std::string, std::string); - int ratio_as_integer (boost::shared_ptr f) const; - float ratio_as_float (boost::shared_ptr f) const; + float ratio (boost::shared_ptr f) const; std::string name () const; };