filmtools

various tools for photographic film development and darkroom printing
git clone git://src.adamsgaard.dk/filmtools
Log | Files | Refs Back to index

commit 08c5774bdd4f60189f2f49e63b713e68758cef53
parent fdf4f540757312f4e76e5eddbd95f5c2cb9e2691
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 16 Jul 2020 22:38:29 +0200

Include factor for linear exposure scaling

Diffstat:
Mreciprocity.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/reciprocity.c b/reciprocity.c @@ -46,7 +46,7 @@ usage() int main(int argc, char **argv) { - double exponent; + double factor, exponent; int i, hour, min, sec, sec_equiv; argv0 = *argv; @@ -65,6 +65,7 @@ main(int argc, char **argv) if (i == LENGTH(films)) errx(3, "unknown film type"); if (strncasecmp(argv[1], films[i].name, 10) == 0) { + factor = films[i].factor; exponent = films[i].exponent; break; } @@ -73,7 +74,7 @@ main(int argc, char **argv) if (sscanf(argv[2], "%d:%d", &min, &sec) != 2) errx(2, "could not parse time in MM:SS format"); - sec_equiv = pow(min * 60 + sec, exponent); + sec_equiv = factor * pow(min * 60 + sec, exponent); sec = (int)(sec_equiv) % 60; if ((min = (int)(sec_equiv / 60.0)) >= 60) { hour = (int)(min/60.0);