diff --git a/src/ev_calculator.py b/src/ev_calculator.py index 8d68204..4efb71b 100644 --- a/src/ev_calculator.py +++ b/src/ev_calculator.py @@ -1,9 +1,24 @@ from math import log +''' +This class does all the required math. It is based on the Wikipedia page +https://en.wikipedia.org/wiki/Exposure_value +(N^2)/t = L*S/K +where: + N is the relative aperture (f-number) + t is the exposure time ("shutter speed") in seconds + L is the average scene luminance + S is the ISO arithmetic speed + K is the reflected-light meter calibration constant +''' class EVCalculator: + # K is the reflected-light meter calibration constant (unit: cd s/m2 ISO) + # (https://en.wikipedia.org/wiki/Light_meter#Calibration_constants) + K = 12.5 # TODO: Add to settings? def luxToEV(lux: float) -> float: # Wikipedia (https://en.wikipedia.org/wiki/Exposure_value#EV_as_a_measure_of_luminance_and_illuminance) # says E = 2.5 * (2^EV), so the inverse is EV = ln(2*E/5)/ln(2) return log(2*lux/5, 2) + diff --git a/src/widgets/aperture_priority_page.ui b/src/widgets/aperture_priority_page.ui index f02f1d3..aa2335f 100644 --- a/src/widgets/aperture_priority_page.ui +++ b/src/widgets/aperture_priority_page.ui @@ -29,7 +29,7 @@ - f/60 + --s diff --git a/src/widgets/time_priority_page.ui b/src/widgets/time_priority_page.ui index ea1a269..10917c9 100644 --- a/src/widgets/time_priority_page.ui +++ b/src/widgets/time_priority_page.ui @@ -29,7 +29,7 @@ - f/11 + f/-- diff --git a/src/window.py b/src/window.py index 6a83ac1..7f8e070 100644 --- a/src/window.py +++ b/src/window.py @@ -38,8 +38,6 @@ class LumosWindow(Adw.ApplicationWindow): def onSensorRead(self, value: float, unit: str): # Called when the light value changed - print("Read {} {}".format(value, unit)) - if self.lux_label: self.lux_label.set_label("{:.0f} {}".format(value, unit)) diff --git a/src/window.ui b/src/window.ui index 6fb14e6..85e858e 100644 --- a/src/window.ui +++ b/src/window.ui @@ -9,6 +9,26 @@ + + + + + + + ISO 50 + ISO 100 + ISO 200 + ISO 400 + ISO 800 + ISO 1600 + ISO 3200 + ISO 6400 + + + + 1 + + True @@ -31,7 +51,7 @@ aperture-priority-page - Aperture priority + Aperture camera-shutter-symbolic true @@ -45,7 +65,7 @@ time-priority-pagehelp - Time priority + Time camera-timer-symbolic true @@ -118,9 +138,12 @@ stack - + 8 + 2 + 2 +