From d9ae982816edb51d4def8e58d2bbdade900acf33 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 28 Mar 2012 14:39:18 +0200 Subject: iq: Add manual saturation setting Signed-off-by: Laurent Pinchart --- iq.c | 2 ++ iq.h | 2 ++ live.c | 6 ++++++ snapshot.c | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/iq.c b/iq.c index 8230d09..dd85cfc 100644 --- a/iq.c +++ b/iq.c @@ -116,6 +116,7 @@ void iq_params_init(struct iq_params *params) params->gain_min = 8; params->gain_max = 1024; params->black_level = 64; + params->saturation = 1.0; } /** @@ -213,6 +214,7 @@ struct iq_tuning *iq_init(struct omap3_isp_device *isp, omap3_isp_sensor_set_gain(isp, iq->params.gain); omap3_isp_sensor_set_exposure(isp, iq->params.exposure); omap3_isp_ccdc_set_black_level(isp, iq->params.black_level); + omap3_isp_preview_set_saturation(isp, iq->params.saturation); omap3_isp_stats_get_format(isp, &format); window.left = params->window.left * format.width; diff --git a/iq.h b/iq.h index 74be0a2..be13a9f 100644 --- a/iq.h +++ b/iq.h @@ -40,6 +40,7 @@ struct omap3_isp_aewb_stats; * @gain_min: Minimum gain value * @gain_max: Maximum gain value * @black_level: Black level offset + * @saturation: Color saturation */ struct iq_params { struct { @@ -63,6 +64,7 @@ struct iq_params { unsigned int gain_max; unsigned int black_level; + float saturation; }; void iq_aewb_process(struct iq_tuning *iq, diff --git a/live.c b/live.c index 75f62ba..512c529 100644 --- a/live.c +++ b/live.c @@ -326,6 +326,7 @@ static void usage(const char *argv0) printf("-h, --help Show this help screen\n"); printf("-s, --skip n Skip display of n frames out of n+1\n"); printf(" --aewb param=value Set AEWB algorithm parameter 'param' to 'value'\n"); + printf(" --saturation value Set the saturation value [0.0-2.0]\n"); printf("\nSupported AEWB parameters are:\n"); printf("- ae-delay Number of frames to skip at stream start before enabling AE\n"); printf("- ae-interval Number of frames between AE algorithm runs (>= 1)\n"); @@ -343,10 +344,12 @@ static void usage(const char *argv0) } #define OPT_AEWB_PARAM 256 +#define OPT_SATURATION 257 static struct option opts[] = { { "aewb", 1, 0, OPT_AEWB_PARAM }, { "help", 0, 0, 'h' }, + { "saturation", 1, 0, OPT_SATURATION }, { "skip", 1, 0, 's' }, { 0, 0, 0, 0 } }; @@ -388,6 +391,9 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu return 1; } break; + case OPT_SATURATION: + iq_params.saturation = strtof(optarg, NULL); + break; default: printf("Invalid option -%c\n", c); printf("Run %s -h for help.\n", argv[0]); diff --git a/snapshot.c b/snapshot.c index 5d29653..8e45dfa 100644 --- a/snapshot.c +++ b/snapshot.c @@ -438,6 +438,7 @@ static void usage(const char *argv0) 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(" --saturation value Set the saturation value [0.0-2.0]\n"); printf("\nSupported AEWB parameters are:\n"); printf("- ae-delay Number of frames to skip at stream start before enabling AE\n"); printf("- ae-interval Number of frames between AE algorithm runs (>= 1)\n"); @@ -455,6 +456,7 @@ static void usage(const char *argv0) } #define OPT_AEWB_PARAM 256 +#define OPT_SATURATION 257 static struct option opts[] = { { "aewb", 1, 0, OPT_AEWB_PARAM }, @@ -465,6 +467,7 @@ static struct option opts[] = { #if USE_LIBJPEG { "jpeg", 0, 0, 'j' }, #endif + { "saturation", 1, 0, OPT_SATURATION }, { "save", 0, 0, 'S' }, { "size", 1, 0, 's' }, { "snap-frames", 1, 0, 'N' }, @@ -565,6 +568,9 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu return 1; } break; + case OPT_SATURATION: + iq_params.saturation = strtof(optarg, NULL); + break; default: printf("Invalid option -%c\n", c); printf("Run %s -h for help.\n", argv[0]); -- cgit v1.2.3