static void iso_response_curve_current() { msleep(2000); static char name[100]; int digic_iso_gain = is_movie_mode() ? get_digic_iso_gain_movie() : get_digic_iso_gain_photo(); snprintf(name, sizeof(name), "ML/LOGS/i%d%s%s.txt", raw2iso(lens_info.iso_equiv_raw), digic_iso_gain <= 256 ? "e2" : digic_iso_gain != 1024 ? "e" : "", get_htp() ? "h" : ""); find_response_curve(name); }
static MENU_UPDATE_FUNC(last_bv_upd) { if(last_bv != INT_MIN) { exposure expo = get_exposure(last_bv, 1); expo.av = AV2STR(expo.av); MENU_SET_VALUE("%s%d.%d BV", FMT_FIXEDPOINT1(last_bv)); MENU_SET_HELP("%s f/%d.%d %d ISO %s%d.%d EC", lens_format_shutter(TV2RAW(expo.tv)), expo.av / 10, expo.av % 10, raw2iso(SV2RAW(expo.sv)), FMT_FIXEDPOINT1S(expo.ec) ); } MENU_CUSTOM_DRAW(browse); }
static MENU_UPDATE_FUNC(iso_range_upd) { MENU_SET_VALUE("%d - %d", raw2iso(SV2RAW(iso_min)), raw2iso(SV2RAW(iso_max))); MENU_CUSTOM_DRAW(sv); }
static void update_graph() { exposure last_expo; bool draw_label = 0; //bg rect bmp_fill(GRAPH_BG, 1, GRAPH_YOFF - GRAPH_MAX_PX - GRAPH_PADD, 720 - 2, GRAPH_MAX_PX + GRAPH_TEXT_PADD + GRAPH_PADD + font_med.height ); // current BV if(last_bv != INT_MIN){ int x = GRAPH_XOFF + (BV_MAX - last_bv) * GRAPH_XSIZE; draw_line(x - 1, GRAPH_YOFF - GRAPH_MAX_PX, x - 1, GRAPH_YOFF, IS_SEL(browse) ? COLOR_WHITE : COLOR_CYAN); draw_line(x + 1, GRAPH_YOFF - GRAPH_MAX_PX, x + 1, GRAPH_YOFF, IS_SEL(browse) ? COLOR_WHITE : COLOR_CYAN); } graph_draw: last_expo = (exposure){-1, -1, -1, -1}; for(int bv = BV_MAX; bv >= BV_MIN; bv -= (draw_label) ? 20 : GRAPH_STEP) { int x = GRAPH_XOFF + (BV_MAX - bv) * GRAPH_XSIZE; exposure expo = get_exposure(bv, 1); int ec_val = expo.ec; expo.ec = (GRAPH_MAX / 2) + expo.ec; if(!draw_label) { int x_last = x - GRAPH_XSIZE * GRAPH_STEP; // bg lines if(!(bv % 10))draw_line(x, GRAPH_YOFF - GRAPH_MAX_PX, x, GRAPH_YOFF, COLOR_BLACK); // sv curve GRAPH_DRAW_CURVE(sv, COLOR_LIGHT_BLUE); // av curve GRAPH_DRAW_CURVE(av, COLOR_GREEN2); // ec curve GRAPH_DRAW_CURVE(ec, (last_expo.ec - (GRAPH_MAX / 2) == 0 && ec_val == 0) ? COLOR_BLACK : COLOR_ORANGE); // tv curve GRAPH_DRAW_CURVE(tv, COLOR_RED); } else { // bv value { char bv_str[3]; snprintf(bv_str, sizeof(bv_str), "%d", ABS(bv / 10)); int center = strlen(bv_str) * font_med.width / 2; if(bv < 0) center += font_med.width; bmp_printf(GRAPH_FONT, x + 3 - center, GRAPH_YOFF + GRAPH_TEXT_PADD, "%d", bv / 10); } //do not print on the right edge of graph if(BV_MAX + bv <= 40) continue; // sv value if(expo.sv != last_expo.sv) { bmp_printf(GRAPH_FONT, x, GRAPH_Y_TEXT(expo.sv), "%d", raw2iso(SV2RAW(expo.sv))); } // av value if(expo.av != last_expo.av) { int ap = AV2STR(expo.av); bmp_printf(GRAPH_FONT, x, GRAPH_Y_TEXT(expo.av), "%d.%d", ap / 10, ap % 10); } // ec value if(expo.ec != last_expo.ec && ec_val) { bmp_printf(GRAPH_FONT, x, GRAPH_Y_TEXT(expo.ec), "%s%d.%d", FMT_FIXEDPOINT1S(ec_val)); } // tv value if(expo.tv != last_expo.tv) { bmp_printf(GRAPH_FONT, x, GRAPH_Y_TEXT(expo.tv), "%s", lens_format_shutter(TV2RAW(expo.tv))); } } last_expo = expo; } if(!draw_label) { draw_label = 1; goto graph_draw; } }