diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/format.cc | 9 | ||||
| -rw-r--r-- | src/lib/format.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/format.cc b/src/lib/format.cc index 088a16059..6615e16e0 100644 --- a/src/lib/format.cc +++ b/src/lib/format.cc @@ -147,6 +147,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 +163,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) { diff --git a/src/lib/format.h b/src/lib/format.h index b4c691e56..783ff25ce 100644 --- a/src/lib/format.h +++ b/src/lib/format.h @@ -46,6 +46,9 @@ public: /** @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; + int dcp_padding (boost::shared_ptr<const Film> f) const; /** @return size in pixels of the images that we should |
