Quick & dirty approach, probably nice to optimice...
// include/camera_info.h
const char* av_str;
const char* tv_str;
} DOF_TYPE;
// core/shooting.c
void shooting_update_dof_values()
...
camera_info.dof_values.av_str=(char*)aperture_sizes_table[find_nearest_aperture_entry(av96)].name;
camera_info.dof_values.tv_str=(char*)shutter_speeds_table[find_nearest_shutter_speed_entry(shooting_get_tv96())].name;
return;
}
// modules/luascript.c
static int luaCB_get_dofinfo( lua_State* L )
...
SET_STR_FIELD("av_str", camera_info.dof_values.av_str );
SET_STR_FIELD("tv_str", camera_info.dof_values.tv_str );
return 1;
}
-->>
dof=get_dofinfo(); print(get_exp_count(),-get_focus(),dof.av_str,dof.tv_str)
Tested ++ on Sx280,
-- CanĀ“t compile with Ix170,190, ...
Edit:
static int find_nearest_aperture_entry(short av96)
depends on
#if (CAM_HAS_IRIS_DIAPHRAGM || CAM_DRAW_EXPOSITION)
Edit2: Seems fine without that #if ... line.