Beispiel #1
0
void display_overlay(uint8_t *vram_address) {
	char buffer[LP_MAX_WORD];

	if (FLAG_GUI_MODE == GUIMODE_OLC && AE_IS_CREATIVE(DPData.ae)) {
		if (FLAG_DISPLAY_ON) {
			int current_cmode = get_current_cmode();

			if (status.msm_active)
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  35,  96, "[***]");
			else if (status.cmode_active && current_cmode != CMODE_NONE)
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  16,  96, "%s", cmodes_config.names[current_cmode]);

			if (status.fexp && DPData.tv_val != TV_VAL_BULB)
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 138,  32, "#");

			if (settings.autoiso_enable && (DPData.ae != AE_MODE_M || DPData.tv_val != TV_VAL_BULB))
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 237,  14, "%s", AUTOISO_AUTO);

			if (DPData.wb == WB_MODE_COLORTEMP)
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  50, 138, "%d", DPData.color_temp);

			if (DPData.ae_bkt) {
				ec_print(buffer, DPData.ae_bkt);
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 224,  96, "%s", buffer);
			}

#ifdef RELEASE
			bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_BLUE), 148, 0, LP_WORD(L_P_400PLUS));
#else
			bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_RED ),  20, 0, LP_WORD(L_A_WARNING));
#endif

			if (*display_message) {
				if(timestamp() < message_timeout)
					bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_WHITE, COLOR_BLACK),  16, 228, display_message);
				else
					*display_message = '\0';
			}
		}

	}
}
Beispiel #2
0
void calculate_dof(int focal_length, int focus_distance, int av, char *min, char *max) {
	float fl =    1.0f * focal_length;
	float fd = 1000.0f * focus_distance;

	float fn = float_pow(2.0f, ((float)av / 8.0f - 1) / 2.0f); // Precise F-Number = 2^(n/2), 1/8 EV resolution
	float cof = 0.019f; // Circle of confusion

	// Hyperfocal
	float hf  = fl + fl * fl / (fn * cof);
	float aux = fd * (hf - fl) / 1000.0f;

	// Min distance
	display_float(min, aux / (hf + fd - 2.0f * fl));

	// Max distance
	if (hf >= fd)
		display_float(max, aux / (hf - fd));
	else
		sprintf(max, "%s", LP_WORD(L_S_INFINITE));
}
Beispiel #3
0
void cmodes_read() {
	int   id;
	int   version =  0;
	int file    = -1;

	cmodes_config_t buffer;

	for (id = 0; id < CMODES_MAX; id ++) {
		sprintf(cmodes_default.names[id], "%s %X", LP_WORD(L_S_CMODE_NAME), id);
		cmodes_default.order[id] = id;
	}

	for (id = 0; id < CMODES_MODES; id ++) {
		cmodes_default.assign[id] = CMODE_NONE;
	}

	cmodes_config = cmodes_default;

	if ((file = FIO_OpenFile(MKPATH_NEW(CMODES_CONFIG), O_RDONLY)) == -1)
		if ((file = FIO_OpenFile(MKPATH_OLD(CMODES_CONFIG), O_RDONLY)) == -1)
			goto end;

	if (FIO_ReadFile(file, &version, sizeof(version)) != sizeof(version))
		goto end;

	if (version != SNAPSHOT_VERSION)
		goto end;

	if (FIO_ReadFile(file, &buffer, sizeof(buffer)) != sizeof(buffer))
		goto end;

	cmodes_config = buffer;

end:
	if (file != -1)
		FIO_CloseFile(file);
}
Beispiel #4
0
#include "utils.h"

#include "menu_settings.h"

extern char languages_found[MAX_LANGUAGES][LP_MAX_WORD];

void menu_settings_open(menu_t *menu);

void menu_restore_settings(const menuitem_t *item);
void menu_restore_cmodes  (const menuitem_t *item);
void menu_delete_cmodes   (const menuitem_t *item);

void reload_language_and_refresh(const menuitem_t *item);

menuitem_t scripts_items[] = {
	MENUITEM_BOOLEAN(0, LP_WORD(L_I_KEEP_POWER_ON), &settings.keep_power_on,    NULL),
	MENUITEM_BOOLEAN(0, LP_WORD(L_I_REVIEW_OFF),    &settings.review_off,       NULL),
	MENUITEM_SCRLCD( 0, LP_WORD(L_I_LCD_SCRIPT),    &settings.script_lcd,       NULL),
	MENUITEM_SCRIND( 0, LP_WORD(L_I_INDICATOR),     &settings.script_indicator, NULL),
};

menuitem_t buttons_items[] = {
	MENUITEM_BOOLEAN(0, LP_WORD(L_I_USE_DPAD),    &settings.use_dpad,       NULL),
	MENUITEM_BOOLEAN(0, LP_WORD(L_I_BUTTON_DISP), &settings.button_disp,    NULL),
	MENUITEM_BTNACTN(0, LP_WORD(L_I_BTN_JUMP),    &settings.shortcut_jump,  NULL),
	MENUITEM_BTNACTN(0, LP_WORD(L_I_BTN_TRASH),   &settings.shortcut_trash, NULL),
};

menuitem_t cmodes_items[] = {
	MENUITEM_BOOLEAN(0, LP_WORD(L_I_CMODES_CAMERA),   &cmodes_config.recall_camera,   NULL),
	MENUITEM_BOOLEAN(0, LP_WORD(L_I_CMODES_400PLUS),  &cmodes_config.recall_400plus,  NULL),
Beispiel #5
0
void menu_params_apply_efcomp             (const menuitem_t *item);
void menu_params_apply_cf_emit_flash      (const menuitem_t *item);
void menu_params_apply_ae_bkt             (const menuitem_t *item);
void menu_params_apply_color_temp         (const menuitem_t *item);
void menu_params_apply_named_temp         (const menuitem_t *item);
void menu_params_apply_cf_emit_aux        (const menuitem_t *item);
void menu_params_apply_cf_mirror_up_lock  (const menuitem_t *item);
void menu_params_apply_cf_flash_sync_rear (const menuitem_t *item);
void menu_params_apply_cf_safety_shift    (const menuitem_t *item);
void menu_params_apply_remote_enable      (const menuitem_t *item);
void menu_params_apply_remote_delay       (const menuitem_t *item);

void menu_params_rename (menu_t *menu);

menuitem_t autoiso_items[] = {
	MENUITEM_BOOLEAN(0, LP_WORD(L_I_AUTOISO_ENABLE), &settings.autoiso_enable,  NULL),
	MENUITEM_BASEISO(0, LP_WORD(L_I_AUTOISO_MINISO), &settings.autoiso_miniso,  menu_params_apply_autoiso_miniso),
	MENUITEM_BASEISO(0, LP_WORD(L_I_AUTOISO_MAXISO), &settings.autoiso_maxiso,  menu_params_apply_autoiso_maxiso),
	MENUITEM_TV     (0, LP_WORD(L_I_AUTOISO_MINTV),  &settings.autoiso_mintv,   NULL),
	MENUITEM_EVEAEB (0, LP_WORD(L_I_AUTOISO_MAXAV),  &settings.autoiso_maxav,   NULL),
	MENUITEM_BOOLEAN(0, LP_WORD(L_I_AUTOISO_RELAX),  &settings.autoiso_relaxed, NULL),
};

menupage_t autoiso_page = {
	name     : LP_WORD(L_S_AUTOISO),
	items    : LIST(autoiso_items),
	actions  : {
		[MENU_EVENT_AV] = menu_return,
	}
};