1 /*
2  * sensor_descriptor.h - sensor descriptor
3  *
4  *  Copyright (c) 2015 Intel Corporation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * Author: Wind Yuan <feng.yuan@intel.com>
19  */
20 
21 #ifndef XCAM_SENSOR_DESCRIPTOR_H
22 #define XCAM_SENSOR_DESCRIPTOR_H
23 
24 #include <xcam_std.h>
25 #include <linux/atomisp.h>
26 
27 namespace XCam {
28 
29 class SensorDescriptor {
30 public:
31     explicit SensorDescriptor ();
32     virtual ~SensorDescriptor ();
33 
34     void set_sensor_data (struct atomisp_sensor_mode_data &data);
35     virtual bool is_ready ();
36 
37     // Input: exposure_time
38     // Output: coarse_time, fine_time
39     virtual bool exposure_time_to_integration (
40         int32_t exposure_time, uint32_t &coarse_time, uint32_t &fine_time);
41     // Input: coarse_time, fine_time
42     // Output: exposure_time
43     virtual bool exposure_integration_to_time (
44         uint32_t coarse_time, uint32_t fine_time, int32_t &exposure_time);
45 
46     // Input : analog_gain, digital_gain
47     // Output: analog_code, digital_code
48     virtual bool exposure_gain_to_code (
49         double analog_gain, double digital_gain,
50         int32_t &analog_code, int32_t &digital_code);
51 
52     // Input : analog_code, digital_code
53     // Output : analog_gain, digital_gain
54     virtual bool exposure_code_to_gain (
55         int32_t analog_code, int32_t digital_code,
56         double &analog_gain, double &digital_gain);
57 
58 private:
59     XCAM_DEAD_COPY (SensorDescriptor);
60 
61 private:
62     struct atomisp_sensor_mode_data _sensor_data;
63 };
64 
65 };
66 #endif //XCAM_SENSOR_DESCRIPTOR_H
67