Trying to implement ND support in rawopint raised some issues. (background:
https://chdk.setepontos.com/index.php?topic=12697.msg134341#msg134341https://chdk.setepontos.com/index.php?topic=12766.msg134375#msg134375)
Edit:
Background on ND_FILTER_STATE propcase
https://chdk.setepontos.com/index.php?topic=7889.msg95186#msg95186Issues
1) There's no reliable way to determine the ND value on cameras with both an ND and iris
2) On cameras with a "hidden" ND, there's no known way to determine the ND state set by the Canon firmware.
3) There's no way for script to distinguish between hidden and non-hidden ND cameras
Some general notes:
For cameras with only an ND filter, the ND state can be determined by comparing the AV and MIN_AV propcases.
If the ND was put in by the Canon firmware, the value can be determined by the difference between AV and MIN_AV. The values determined from this seem to be quite accurate, and vary between camera models. There is no obvious way to determine the value from script if the ND was not put in (and CHDK ND override does not set the appropriate propcase) but in many cases the values are available in the shooting.c AV table.
On cameras with manual ND control (mostly CAM_HAS_NATIVE_ND_FILTER but also on some ND-only cameras like SD990) there is a propcase which reflects the manual ND state (ND_FILTER_STATE). This is not set if the ND is controlled automatically (even on SD990, which also allows manual control of the ND)
Cameras with an ND and iris do not put the ND value in aperture exif, while ND-only cameras do.
On G7X, I thought I found propcases that reflected the ND value, however MarkB and c_joerg reported different values for the same camera model, so this may be incorrect.
There are 3 propcases that all have the same behavior. On g7x (propset 7), they are 85,93,94. On S110 (propset 5) they are 80,87,88. The lowest number is identified with the string "\r\nError : GetDeltaNdResult" in response to a propcase call. The second one similarly associated with "\r\nError : PCH_DELTAND_MEASURE"
The behavior of these propcases is: If the ND filter is selected (ND_FILTER_STATE = 1 before half press), they have a ~3 stop value after half press, otherwise 0.
Scripted ND control on manual ND cameras does not cause these propcases to update, unless ND_FILTER_STATE set *before* halfpress. The current ND override code sets ND_FILTER_STATE in half press for CAM_HAS_NATIVE_ND_FILTER
Some initial things to do:
1) Create a script like isoinc.lua to test ND value (here
https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/CHDK/SCRIPTS/TEST/ndtest.lua)
1.1) determine if the "delta ND" propcases accurately reflects ND value. (Pretty close, maybe?)
2) Create a spreadsheet of of cameras with ND details (ND only, CAM_HAS_NATIVE_ND_FILTER, ...)
3) Investigate how the ND is used on "hidden ND" cameras, and whether it affects any propcases when the Canon firmware uses it.
I'll try to get to #1 later today.