diff options
Diffstat (limited to 'snapshot.c')
-rw-r--r-- | snapshot.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -400,9 +400,21 @@ static void usage(const char *argv0) printf("-S, --save Save snapshots to disk\n"); printf("-s, --size wxh Set the snapshot capture size\n"); printf("-v, --view Enable viewfinder\n"); + printf(" --aewb param=value Set AEWB algorithm parameter 'param' to 'value'\n"); + printf("\nSupported AEWB parameters are:\n"); + printf("- exposure-def Exposure time default value\n"); + printf("- exposure-min Exposure time minimum value\n"); + printf("- exposure-max Exposure time maximum value\n"); + printf("- gain-def Sensor gain default value\n"); + printf("- gain-min Sensor gain minimum value\n"); + printf("- gain-max Sensor gain maximum value\n"); + printf("- mean-level Mean luminance target level (float [0-1])\n"); } +#define OPT_AEWB_PARAM 256 + static struct option opts[] = { + { "aewb", 1, 0, OPT_AEWB_PARAM }, { "crop", 1, 0, 'c' }, { "format", 1, 0, 'f' }, { "help", 0, 0, 'h' }, @@ -421,6 +433,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu struct omap3_isp_device *isp = NULL; struct omap3_isp_operations ops; struct timespec start, end; + struct iq_params iq_params; int exit_code = EXIT_FAILURE; float fps; int ret; @@ -430,6 +443,8 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu snap.format.width = SNAPSHOT_WIDTH; snap.format.height = SNAPSHOT_HEIGHT; + iq_params_init(&iq_params); + while ((c = getopt_long(argc, argv, "c:f:hi:k:N:n:Ss:v", opts, NULL)) != -1) { switch (c) { case 'c': @@ -485,6 +500,15 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu vf.enabled = true; snap.trigger = SNAPSHOT_TRIGGER_MANUAL; break; + case OPT_AEWB_PARAM: + ret = iq_params_parse(&iq_params, optarg); + if (ret < 0) { + printf("%s AEWB argument %s.\n", + ret == -ERANGE ? "out-of-range" : "invalid", + optarg); + return 1; + } + break; default: printf("Invalid option -%c\n", c); printf("Run %s -h for help.\n", argv[0]); @@ -524,7 +548,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu if (ret < 0) goto cleanup; - iq = iq_init(isp); + iq = iq_init(isp, &iq_params); if (iq == NULL) { printf("error: unable to initialize image quality tuning\n"); goto cleanup; |