add timer switch
[sparrow.git] / calibrate.h
blob5c9323603cf5e4e352d389083b618bbe417a9e96
1 #ifndef __SPARROW_CALIBRATE_H__
2 #define __SPARROW_CALIBRATE_H__
5 #define CALIBRATE_SELF_SIZE 24
7 #define CALIBRATE_MAX_VOTE_ERROR 5
8 #define CALIBRATE_MAX_BEST_ERROR 2
9 #define CALIBRATE_INITIAL_WAIT 72
10 #define CALIBRATE_RETRY_WAIT 16
12 #define CALIBRATE_SIGNAL_THRESHOLD 200
14 #define MAX_CALIBRATE_SHAPES 4
16 #define WAIT_COUNTDOWN (MAX(CALIBRATE_OFF_MAX_T, CALIBRATE_ON_MAX_T) + 3)
18 #define MAX_CALIBRATION_LAG 12
19 typedef struct lag_times_s {
20 //guint32 hits;
21 guint64 record;
22 } lag_times_t;
24 enum calibration_shape {
25 NO_SHAPE = 0,
26 RECTANGLE,
29 typedef struct sparrow_shape_s {
30 /*Calibration shape definition -- a rectangle.*/
31 enum calibration_shape shape;
32 gint x;
33 gint y;
34 gint w;
35 gint h;
36 } sparrow_shape_t;
39 typedef struct sparrow_calibrate_s {
40 /*calibration state, and shape and pattern definition */
41 gboolean on; /*for calibration pattern */
42 gint wait;
43 guint32 transitions;
44 guint32 incolour;
45 guint32 outcolour;
46 sparrow_shape_t shapes[MAX_CALIBRATE_SHAPES];
47 int n_shapes;
49 IplImage *in_ipl[SPARROW_N_IPL_IN];
50 lag_times_t *lag_table;
51 guint64 lag_record;
53 } sparrow_calibrate_t;
56 #endif