1 #ifndef CAMERA_INFO_H
2 #define CAMERA_INFO_H
3
4
5
6
7
8
9
10
11 #include "stdlib.h"
12 #include "stddef.h"
13 #include "stdio.h"
14 #include "string.h"
15
16
17
18
19 typedef struct
20 {
21 short hyperfocal_valid;
22 short distance_valid;
23 int hyperfocal_distance_1e3;
24 int aperture_value;
25 int focal_length;
26 int subject_distance;
27 int near_limit;
28 int far_limit;
29 int hyperfocal_distance;
30 int depth_of_field;
31 int min_stack_distance;
32 } DOF_TYPE;
33
34
35
36
37
38
39
40
41
42 #define CAM_SCREEN_VERSION {2,0}
43 #define CAM_SENSOR_VERSION {1,0}
44 #define CAM_INFO_VERSION {3,0}
45
46 typedef struct
47 {
48 int bits_per_pixel;
49 int black_level;
50 int white_level;
51 unsigned raw_rows, raw_rowpix, raw_rowlen, raw_size;
52 union
53 {
54 struct
55 {
56 int x, y;
57 int width, height;
58 } jpeg;
59 struct
60 {
61 int origin[2];
62 int size[2];
63 } crop;
64 };
65 union
66 {
67 struct
68 {
69 int y1, x1, y2, x2;
70 } active_area;
71 int dng_active_area[4];
72 };
73 int lens_info[8];
74 int exposure_bias[2];
75 int cfa_pattern;
76 int calibration_illuminant1;
77 int color_matrix1[18];
78 int calibration_illuminant2;
79 int color_matrix2[18];
80 int has_calibration1;
81 int camera_calibration1[18];
82 int has_calibration2;
83 int camera_calibration2[18];
84 int has_forwardmatrix1;
85 int forward_matrix1[18];
86 int has_forwardmatrix2;
87 int forward_matrix2[18];
88 int dng_badpixel_value_limit;
89 } _cam_sensor;
90
91 extern _cam_sensor camera_sensor;
92
93 typedef struct
94 {
95 int width, height, size;
96 int physical_width;
97 int buffer_width, buffer_height, buffer_size;
98 int disp_left, disp_right, disp_width;
99 int edge_hmargin;
100 int zebra_nobuf, zebra_aspect_adjust;
101 int has_variable_aspect;
102 int ts_menu_border;
103 int menu_border_width;
104 int fselect_name_size;
105 int fselect_size_size;
106 int fselect_time_size;
107 } _cam_screen;
108
109 extern _cam_screen camera_screen;
110
111 typedef struct
112 {
113 unsigned int tick_count;
114 unsigned int last, min, max, sum, count;
115 } time_counter;
116
117 typedef struct
118 {
119
120 struct
121 {
122 int camera_name;
123 int owner_name;
124 int artist_name;
125 int copyright;
126 } params;
127
128 struct
129 {
130 int propset;
131 int gps;
132 int orientation_sensor;
133 int tv;
134 int av;
135 int min_av;
136 int ev_correction_1;
137 int ev_correction_2;
138 int flash_mode;
139 int flash_fire;
140 int metering_mode;
141 int wb_adj;
142 int aspect_ratio;
143 int shooting;
144 int resolution;
145 int quality;
146 int af_lock;
147 } props;
148 int rombaseaddr, maxramaddr, memisosize;
149 int cam_uncached_bit, exmem;
150 int text_start, data_start, bss_start, bss_end;
151 int tick_count_offset;
152 char* platform;
153 char* platformsub;
154 char* chdk_ver;
155 char* build_number;
156 char* chdk_dng_ver;
157 char* build_svnrev;
158 char* build_date;
159 char* build_time;
160 char* os;
161 int cam_ev_in_video;
162 int cam_has_nd_filter;
163 int cam_has_iris_diaphragm;
164 int cam_has_video_button, cam_has_zoom_lever;
165 int cam_has_manual_focus;
166 int cam_has_multipart;
167 int cam_remote_sync_status_led;
168 int cam_key_press_delay, cam_key_release_delay;
169 int cam_af_led;
170 int circle_of_confusion;
171 int cam_digic;
172 int cam_canon_raw;
173
174
175 struct
176 {
177 int edge_state_draw;
178 int is_shutter_half_press;
179 int auto_started;
180 int user_menu_has_changed;
181 int kbd_last_clicked;
182 long kbd_last_clicked_time;
183 long kbd_last_checked_time;
184 long shutter_open_time;
185 long shutter_open_tick_count;
186 int state_shooting_progress;
187 int state_kbd_script_run;
188 int osd_title_line;
189
190 int gui_mode;
191 int gui_mode_none;
192 int gui_mode_alt;
193
194 int mode;
195 int mode_shooting;
196 int mode_video;
197 int mode_rec;
198 int mode_rec_or_review;
199 int mode_play;
200 int mode_photo;
201
202 } state;
203
204
205 struct
206 {
207 unsigned int md_detect_tick;
208 int md_af_tuning;
209 int af_led_on;
210 time_counter af_led;
211 int md_af_on_flag;
212 unsigned int md_af_on_delay;
213 unsigned int md_af_on_time;
214 } perf;
215
216
217 DOF_TYPE dof_values;
218
219 #if defined(OPT_FILEIO_STATS)
220
221 struct
222 {
223 int fileio_semaphore_errors;
224 int max_semaphore_timeout;
225 int close_badfile_count;
226 int write_badfile_count;
227 int open_count;
228 int close_count;
229 int open_fail_count;
230 int close_fail_count;
231 } fileio_stats;
232 #endif
233 } _cam_info;
234
235 extern _cam_info camera_info;
236
237 extern void camera_info_init();
238
239
240
241 #endif