diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-21 22:41:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-21 22:41:52 +0100 |
| commit | 47f25009bcbc765e397bcb471dd361a511c99daf (patch) | |
| tree | 356ac924524183047a84e34674985b3a00c5ca24 /src/lib/format.h | |
| parent | afc495f722f89fea0bcc579046d1a5d362e36f69 (diff) | |
| parent | e8d8a27c7f6861b031b3250b0ad50d04c41a7721 (diff) | |
Untested merge of master.
Diffstat (limited to 'src/lib/format.h')
| -rw-r--r-- | src/lib/format.h | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/lib/format.h b/src/lib/format.h index 7958ca534..f240c89fc 100644 --- a/src/lib/format.h +++ b/src/lib/format.h @@ -38,16 +38,8 @@ 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<const Film> f) const = 0; - - /** @return the ratio as a floating point number */ - virtual float ratio_as_float (boost::shared_ptr<const Film> f) const = 0; - - /** @return the ratio of the container (including any padding) as a floating point number */ - float container_ratio_as_float () const; + /** @return the ratio of the container (including any padding) */ + float container_ratio () const; int dcp_padding (boost::shared_ptr<const Film>) const; @@ -84,6 +76,9 @@ public: static void setup_formats (); protected: + /** @return the ratio */ + virtual float ratio (boost::shared_ptr<const Film> 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. @@ -107,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 Film>) const { + float ratio (boost::shared_ptr<const Film>) const { return _ratio; } - float ratio_as_float (boost::shared_ptr<const Film>) 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 @@ -130,8 +120,7 @@ class VariableFormat : public Format public: VariableFormat (libdcp::Size, std::string, std::string, std::string); - int ratio_as_integer (boost::shared_ptr<const Film> f) const; - float ratio_as_float (boost::shared_ptr<const Film> f) const; + float ratio (boost::shared_ptr<const Film> f) const; std::string name () const; }; |
