projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9c5e3f
)
Add Luminance::value_in_foot_lamberts().
author
Carl Hetherington
<cth@carlh.net>
Sat, 3 Apr 2021 18:29:45 +0000
(20:29 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Sat, 3 Apr 2021 18:29:45 +0000
(20:29 +0200)
src/types.cc
patch
|
blob
|
history
src/types.h
patch
|
blob
|
history
diff --git
a/src/types.cc
b/src/types.cc
index 44422ca96167fa72729bf73d2564ff5101fd163b..743e72606a5f176617f619e34d88567dd1d12227 100644
(file)
--- a/
src/types.cc
+++ b/
src/types.cc
@@
-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)
{
diff --git
a/src/types.h
b/src/types.h
index 374dd8b8c1d22741deeafbd252ddae3ffe3340c2..9dc3e5f539475305d50d84dd6ca0098d5152d75c 100644
(file)
--- a/
src/types.h
+++ b/
src/types.h
@@
-444,6
+444,8
@@
public:
return _unit;
}
+ float value_in_foot_lamberts () const;
+
void as_xml (xmlpp::Element* parent, std::string ns) const;
static std::string unit_to_string (Unit u);