Format the photo exposure bias value in EV units
and in steps of thirds when applicable
CCBUG: 343273
bruns | |
ngraham |
Format the photo exposure bias value in EV units
and in steps of thirds when applicable
CCBUG: 343273
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
exposure bias seems mostly to be in steps of 1/3 according to https://www.geofflawrence.com/exposure_compensation.html
Many cameras can be switched to 1/2 EV steps.
src/formatstrings.cpp | ||
---|---|---|
189 | this is probably not working for e.g. "-1 1/3" |
Damn ;) do you know any other values? In case not, I would add this case in a loop and stupidly try everything
I think with 1/2 and 1/3 you have covered 99.9% of the cameras.
You can quantize to 1/6, and if the fractional part is in {2,3,4}, use the "%1 %2/%3" format.
To avoid the if() { if() { if() { }}} cascade, you may use a nested function (lambda) for the default case (format as double), and do an early return.
How about integral/fractional instead of wholeNumber/remainder?
src/formatstrings.cpp | ||
---|---|---|
183 | You obviously multiply here ... |
src/formatstrings.cpp | ||
---|---|---|
183 | dividing by one third is multiplying by three :) |
src/formatstrings.cpp | ||
---|---|---|
193 | no need for else here, you return. dito below |