summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-01-25 20:54:29 +0000
committerCarl Hetherington <cth@carlh.net>2013-01-25 20:54:29 +0000
commit9e92f4742708e8b1516623647ee458211fdd68c1 (patch)
tree484d1bb636788df7c7b2aa1b9a4232d964007b7c /src/lib
parent97b0f3af79c79ac4b9273e93090ef41753faba6c (diff)
Fix signalling of wxChoices that used to be ComboBoxes. Use Size a little more. Show any padding of films into larger frames in the preview (#33).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/format.cc9
-rw-r--r--src/lib/format.h3
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