Hi,
I think the Set Auto WB is now working, let me know what you think. Didn't use the logs, (I have to look at it yet) I modified the shot.c and added some function I found in lens.c and added the GUI stuff: "Auto" for the cycle. Here is the function I modified in shot.c :
void
kelvin_toggle( void* priv, int sign )
{
int k;
switch (lens_info.wb_mode)
{
case WB_SUNNY: k = 5200; break;
case WB_SHADE: k = 7000; break;
case WB_CLOUDY: k = 6000; break;
case WB_TUNGSTEN: k = 3200; break;
case WB_FLUORESCENT: k = 4000; break;
case WB_FLASH: k = 6500; break; // maybe?
default: k = lens_info.kelvin;
}
//begin raiky - set auto wb
if (!lens_info.wb_mode) { //if we are in auto
k = sign>0? KELVIN_MIN : KELVIN_MAX;
lens_set_kelvin(k);
return;
}
else if ((k == KELVIN_MIN && sign<0) || (k == KELVIN_MAX && sign>0)) {
lens_info.wb_mode = 0;
int mode = WB_AUTO;
prop_request_change(PROP_WB_MODE_LV, &mode, 4);
prop_request_change(PROP_WB_MODE_PH, &mode, 4);
return;
}
//end raiky - set auto wb
int step = KELVIN_STEP;
if (k + sign * step > 7000)
step *= 5;
k = (k/step) * step;
if (priv == (void*)-1) // no wrap around
k = COERCE(k + sign * step, KELVIN_MIN, KELVIN_MAX);
else // allow wrap around
k = KELVIN_MIN + mod(k - KELVIN_MIN + sign * step, KELVIN_MAX - KELVIN_MIN + step);
lens_set_kelvin(k);
}
I guess it should be quite straighforward to add the rest of White Balance values (Cloudy, Sunny, etc)
R.