Add Luminance::value_in_foot_lamberts().
[libdcp.git] / src / types.cc
index 44422ca96167fa72729bf73d2564ff5101fd163b..743e72606a5f176617f619e34d88567dd1d12227 100644 (file)
@@ -547,6 +547,20 @@ Luminance::string_to_unit (string u)
 }
 
 
+float
+Luminance::value_in_foot_lamberts () const
+{
+       switch (_unit) {
+       case Unit::CANDELA_PER_SQUARE_METRE:
+               return _value / 3.426;
+       case Unit::FOOT_LAMBERT:
+               return _value;
+       default:
+               DCP_ASSERT (false);
+       }
+}
+
+
 bool
 dcp::operator== (Luminance const& a, Luminance const& b)
 {