示例#1
0
static void autoexpo_task()
{
    autoexpo_running = 1;

    if(!lens_info.raw_shutter) goto cleanup; //open menus

    int bv = RAW2TV(lens_info.raw_shutter) + RAW2AV(lens_info.raw_aperture) - RAW2SV(lens_info.iso_equiv_raw) + RAW2EC(get_ae_value());
    
    if(bv < -200){ //AE_VALUE overflows, set some low values
        lens_set_rawshutter(60 + 56);
        lens_set_rawaperture(1);
        lens_set_rawiso(1);
        NotifyBox(1000, "AE_VALUE overflows");
        goto cleanup;
    }

    last_bv = bv;
    
    exposure expo = get_exposure(bv, 0);
    lens_set_rawaperture(AV2RAW(expo.av));
    lens_set_rawiso(SV2RAW(expo.sv));
    lens_set_rawshutter(TV2RAW(expo.tv));

    cleanup:
    autoexpo_running = 0;
}
示例#2
0
static void iso_movie_change_setting(int iso, int dgain, int shutter)
{
    lens_set_rawiso(iso);
    lens_set_rawshutter(shutter);
    set_display_gain_equiv(dgain);
    msleep(2000);
    take_fast_pictures(1);
}
示例#3
0
static void find_response_curve(const char* fname)
{
    char fname_real[255];
    snprintf(fname_real, sizeof(fname_real), "ML/LOGS/%s", fname);
    FILE* f = FIO_CreateFile(fname_real);

    ensure_movie_mode();
    clrscr();
    set_lv_zoom(5);

    msleep(1000);

    for (int i = 0; i < 64*2; i+=8)
        bmp_draw_rect(COLOR_BLACK,  i*5+40, 0, 8*5, 380);

    draw_line( 40,  190,  720-40,  190, COLOR_BLACK);

    extern int bv_auto;
    //int bva0 = bv_auto;
    bv_auto = 0; // make sure it won't interfere

    bv_enable(); // for enabling fine 1/8 EV increments

    int ma = (lens_info.raw_aperture_min + 7) & ~7;
    for (int i = 0; i < 64*2; i++)
    {
        int a = (i/2) & ~7;                                // change aperture in full-stop increments
        lens_set_rawaperture(ma + a);
        lens_set_rawshutter(96 + i - a);                   // shutter can be changed in finer increments
        msleep(400);
        int Y,U,V;
        get_spot_yuv(180, &Y, &U, &V);
        dot( i*5 + 40 - 16,  380 - Y*380/255 - 16, COLOR_BLUE, 3); // dot has an offset of 16px
        my_fprintf(f, "%d %d %d %d\n", i, Y, U, V);
    }
    FIO_CloseFile(f);
    beep();
    //~ call("dispcheck");
    lens_set_rawaperture(ma);
    lens_set_rawshutter(96);
}
示例#4
0
static void shutter_lock_step()
{
    if (is_movie_mode()) // no effect in photo mode
    {
        int shutter = lens_info.raw_shutter;
        if (shutter_lock_value == 0) shutter_lock_value = shutter; // make sure it's some valid value
        if (!gui_menu_shown()) // lock shutter
        {
            if (shutter != shutter_lock_value) // i.e. revert it if changed
            {
                //~ lens_set_rawaperture(COERCE(lens_info.raw_aperture + shutter - shutter_lock_value, 16, 96));
                msleep(100);
                lens_set_rawshutter(shutter_lock_value);
                msleep(100);
            }
        }
        else
            shutter_lock_value = shutter; // accept change from ML menu
    }
}