Exemplo n.º 1
0
static int config_imager(void)
{
	load_config_file();

	#if 0
	if (mw_set_iq_preference(iq_map.ae_preference) < 0) {
		APP_PRINTF("mw_set_iq_preference error\n");
	}
	#endif
	if (mw_set_ae_param(&iq_map.ae) < 0) {
		APP_ERROR("mw_set_ae_param error\n");
		return -1;
	}
	if (mw_set_image_param(&image_map) < 0) {
		APP_ERROR("mw_set_image_param error\n");
		return -1;
	}
	if (mw_set_awb_param(&awb_map) < 0) {
		APP_ERROR("mw_set_awb_param error\n");
		return -1;
	}
	if (set_basic_image_params(&iq_map) < 0) {
		APP_ERROR("set_basic_image_params error\n");
		return -1;
	}
	g_mw_basic_iq = iq_map;
	g_mw_image = image_map;
	g_mw_awb = awb_map;

	return 0;
}
Exemplo n.º 2
0
int imagingSetAEGainMax(int gainMax)
{
	int retVal = 0;
#ifndef NO_HARDWARE
	mw_ae_param aeParams;

	mw_get_ae_param(&aeParams);
	printf("Current sensor gain max is %d .\n", aeParams.sensor_gain_max);	
	printf("New sensor gain max is %d .\n", gainMax);
	aeParams.sensor_gain_max = gainMax;
	retVal = mw_set_ae_param(&aeParams);
#endif

	return retVal;
}
Exemplo n.º 3
0
static int set_image_param(char * section_name)
{
	APP_INFO("Section [%s] settings:\n", section_name);

	#if 0
	if (g_mw_basic_iq.ae_preference != iq_map.ae_preference) {
		if (mw_set_iq_preference(iq_map.ae_preference) < 0) {
			APP_PRINTF("mw_set_iq_preference error\n");
		}
		g_mw_basic_iq.ae_preference = iq_map.ae_preference;
	}
	#endif
	if (0 != memcmp(&g_mw_basic_iq.ae, &iq_map.ae, sizeof(g_mw_basic_iq.ae))) {
		if (mw_set_ae_param(&iq_map.ae) < 0) {
			APP_ERROR("mw_set_ae_param error\n");
			return -1;
		} else {
			g_mw_basic_iq.ae = iq_map.ae;
		}
	}
	if (0 != memcmp(&g_mw_image, &image_map, sizeof(g_mw_image))) {
		if (mw_set_image_param(&image_map) < 0) {
			APP_ERROR("mw_set_image_param error\n");
			return -1;
		} else {
			g_mw_image = image_map;
		}
	}
	if (0 != memcmp(&g_mw_awb, &awb_map, sizeof(g_mw_awb))) {
		if (mw_set_awb_param(&awb_map) < 0) {
			APP_ERROR("mw_set_awb_param error\n");
			return -1;
		} else {
			g_mw_awb = awb_map;
		}
	}
	if (0 != memcmp(&g_mw_basic_iq, &iq_map, sizeof(g_mw_basic_iq))) {
		if (set_basic_image_params(&iq_map) < 0) {
			APP_ERROR("set_basic_image_params error\n");
			return -1;
		} else {
			g_mw_basic_iq = iq_map;
		}
	}

	return 0;
}