summaryrefslogtreecommitdiff
path: root/iq.h
blob: be13a9f70fc4e47293f3471fd74f9711c8e72129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 * OMAP3 image quality tuning
 *
 * Copyright (C) 2010-2012 Ideas on board SPRL
 *
 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef __IQ_H__
#define __IQ_H__

struct iq_tuning;
struct omap3_isp_device;
struct omap3_isp_aewb_stats;

/**
 * struct iq_params - Image quality tuning parameters
 * @window: Statistics computation window (fraction of the image size)
 * @ae_delay: Number of frames to skip at stream start before enabling AE
 * @ae_interval: Number of frames between AE algorithm runs
 * @mean_level: Target mean luminance level (fraction of the maximum)
 * @exposure: Initial exposure value (sensor-specific units)
 * @exposure_min: Minimum exposure value
 * @exposure_max: Maximum exposure value
 * @gain: Initial gain value (sensor-specific units)
 * @gain_min: Minimum gain value
 * @gain_max: Maximum gain value
 * @black_level: Black level offset
 * @saturation: Color saturation
 */
struct iq_params {
	struct {
		float left;
		float top;
		float width;
		float height;
	} window;

	unsigned int ae_delay;
	unsigned int ae_interval;

	float mean_level;

	unsigned int exposure;
	unsigned int exposure_min;
	unsigned int exposure_max;

	unsigned int gain;
	unsigned int gain_min;
	unsigned int gain_max;

	unsigned int black_level;
	float saturation;
};

void iq_aewb_process(struct iq_tuning *iq,
		     const struct omap3_isp_aewb_stats *stats);

void iq_params_init(struct iq_params *params);
int iq_params_parse(struct iq_params *params, const char *arg);

struct iq_tuning *iq_init(struct omap3_isp_device *isp,
			  const struct iq_params *params);
void iq_cleanup(struct iq_tuning *iq);

#endif