Things look really exciting over in ML videoland at the moment, but over in ML photoland some of us are 'struggling'.
What I've been trying to do is see if I can extend the Lua fix and expose more functionality, thus opening up Lua to greater things.
For example, at the moment the ML spotmeter, and in particular RAW form, remains 'hidden' in Lua.
In the main source, the spotmeter is in zebra.c:
#ifdef FEATURE_RAW_SPOTMETER
int raw_luma = 0;
int raw_ev = 0;
if (can_use_raw_overlays() && raw_update_params())
{
const int xcr = BM2RAW_X(xcb);
const int ycr = BM2RAW_Y(ycb);
const int dxr = BM2RAW_DX(dxb);
raw_luma = 0;
int raw_count = 0;
for( y = ycr - dxr ; y <= ycr + dxr ; y++ )
{
if (y < raw_info.active_area.y1 || y > raw_info.active_area.y2) continue;
for( x = xcr - dxr ; x <= xcr + dxr ; x++ )
{
if (x < raw_info.active_area.x1 || x > raw_info.active_area.x2) continue;
raw_luma += raw_get_pixel(x, y);
raw_count++;
/* define this to check if spotmeter reads from the right place;
* you should see some gibberish on raw zebras, right inside the spotmeter box */
#ifdef RAW_SPOTMETER_TEST
raw_set_pixel(raw_buf, x, y, rand());
#endif
}
}
if (!raw_count) return;
raw_luma /= raw_count;
raw_ev = (int) roundf(10.0 * raw_to_ev(raw_luma));
}
#endif
The relevant info here are the x and y values, ie giving the screen position of the spotmeter, and the raw EV value we see on the LV, ie raw_ev.
Having looked at the Lua module in the source, there are ways to access ML C and Canon variable, but this requires coding in C and compiling, which is a little bit beyond me at the moment.
So, does anyone know if it is possible to access variables that are in the main build, eg the spotmeter, but only via using Lua. I've read online that it should be possible, within Lua, to access functions in C, but I'm not sure if you can do this with variables and, of course, with ML Lua?
Obviously I'm only looking to read, not write, here.
I know there are lots of bright people out there and thus I would welcome any thoughts on the above, ie is it possible, using only, Lua, to read a C variable from ML, eg raw_ev above.