X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fformat.h;h=d45a3a10acc4bc6f6c3d2ebf64be445d9b6c0f07;hb=cd4a82d90677cec80e891ac190000cb70767446f;hp=305524628c50f848b4963292a5fb66addabaf8f6;hpb=0b6652b491ffe7544a6f4a14fe968615d4481594;p=dcpomatic.git diff --git a/src/lib/format.h b/src/lib/format.h index 305524628..d45a3a10a 100644 --- a/src/lib/format.h +++ b/src/lib/format.h @@ -31,26 +31,17 @@ class Film; class Format { public: - Format (libdcp::Size dcp, std::string id, std::string n, std::string d, std::string e) + Format (libdcp::Size dcp, std::string id, std::string n, std::string d) : _dcp_size (dcp) , _id (id) , _nickname (n) , _dci_name (d) - , _description (e) {} - /** @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) 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 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 @@ -76,19 +67,15 @@ public: return _dci_name; } - std::string description () const { - return _description; - } - - std::string as_metadata () const; - static Format const * from_nickname (std::string n); - static Format const * from_metadata (std::string m); static Format const * from_id (std::string i); static std::vector all (); 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. @@ -99,7 +86,6 @@ protected: /** nickname (e.g. Flat, Scope) */ std::string _nickname; std::string _dci_name; - std::string _description; private: /** all available formats */ @@ -113,31 +99,25 @@ private: class FixedFormat : public Format { public: - FixedFormat (int, libdcp::Size, std::string, 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 { public: - VariableFormat (libdcp::Size, std::string, std::string, std::string, std::string); + 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; };