root/include/shooting.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef SHOOTING_H
   2 #define SHOOTING_H
   3 
   4 // CHDK shooting interface
   5 
   6 // Note: used in modules and platform independent code. 
   7 // Do not add platform dependent stuff in here (#ifdef/#endif compile options or camera dependent values)
   8 
   9 /******************************************************************/
  10 
  11 extern void shooting_init(); // startup initialization
  12 
  13 /******************************************************************/
  14 
  15 #define SET_NOW      1
  16 #define SET_LATER    0
  17 
  18 /******************************************************************/
  19 
  20 typedef struct {
  21     short id;       // hacks id
  22     short prop_id;  // Canons id
  23     char *name;
  24     short shutter_dfs_value; // shutter speed to use dark frame subtraction
  25 } ISOTable;
  26 
  27 typedef struct {
  28     short id;       // hacks id
  29     short prop_id;  // Canons id
  30     char *name;
  31     long usec;
  32 } ShutterSpeed;
  33 
  34 typedef struct {
  35     short id;       // hacks id
  36     short prop_id;  // Canons id
  37     char *name;
  38 } ApertureSize;
  39 
  40 typedef struct {
  41     short av96;
  42     short dav96;
  43     short av96_step;
  44     short tv96;
  45     short dtv96;
  46     short tv96_step;
  47     short sv96;
  48     short dsv96;
  49     short sv96_step;
  50     short iso;
  51     short diso;
  52     short iso_step;
  53     short subj_dist;
  54     short dsubj_dist;
  55     short subj_dist_step;
  56     short shoot_counter;
  57 } EXPO_BRACKETING_VALUES;
  58 
  59 /******************************************************************/
  60 
  61 extern int shooting_in_progress();
  62 extern int shooting_is_flash();
  63 extern int shooting_is_flash_ready();
  64 extern short shooting_get_flash_mode();
  65 
  66 /******************************************************************/
  67 
  68 // returned by shooting_get_tv96_from_shutter_speed for invalid input
  69 // and get_current_tv96 when imager not active
  70 #define SHOOTING_TV96_INVALID -10000
  71 
  72 extern int shooting_get_user_tv_id();
  73 extern short shooting_get_tv96();
  74 extern short shooting_get_tv96_from_shutter_speed(float t);
  75 extern void shooting_set_tv96(short tv96, short is_now);
  76 extern void shooting_set_tv96_direct(short tv96, short is_now);
  77 extern short shooting_get_user_tv96();
  78 extern void shooting_set_user_tv96(short tv96);
  79 extern float shooting_get_shutter_speed_from_tv96(short tv96);
  80 extern void shooting_set_user_tv_by_id(int v);
  81 extern void shooting_set_user_tv_by_id_rel(int v);
  82 
  83 /******************************************************************/
  84 
  85 extern short shooting_get_aperture_sizes_table_size();
  86 extern int shooting_get_aperture_from_av96(short av96);
  87 extern short shooting_get_av96_from_aperture(int aperture);
  88 extern int shooting_get_user_av_id();
  89 extern void shooting_set_user_av_by_id(int v);
  90 extern short shooting_get_av96();
  91 extern short shooting_get_min_av96();
  92 extern short shooting_get_max_av96();
  93 extern void shooting_set_av96(short av96,short is_now);
  94 extern void shooting_set_av96_direct(short av96, short is_now);
  95 extern short shooting_get_user_av96();
  96 extern void shooting_set_user_av96(short av96);
  97 extern void shooting_set_user_av_by_id_rel(int v);
  98 extern int shooting_get_real_aperture();
  99 extern short shooting_get_av96_override_value();
 100 extern void shooting_set_nd_filter_state(short v, short is_now);
 101 extern short shooting_get_nd_value_ev96(void);
 102 extern short shooting_get_nd_current_ev96(void);
 103 
 104 /******************************************************************/
 105 
 106 extern short shooting_get_is_mode();
 107 extern short shooting_get_resolution();
 108 extern short shooting_get_display_mode();
 109 extern int shooting_get_canon_raw_enabled();
 110 
 111 /******************************************************************/
 112 
 113 extern int shooting_get_zoom();
 114 extern void shooting_set_zoom(int v);
 115 extern void shooting_set_zoom_rel(int v);
 116 extern void shooting_set_zoom_speed(int v);
 117 
 118 // mode: 0 = off or standard, 2 or 3 digital tele
 119 int shooting_get_digital_zoom_mode(void);
 120 // state: 0 = off or digital tele, 1 = standard
 121 int shooting_get_digital_zoom_state(void);
 122 
 123 /******************************************************************/
 124 
 125 extern void shooting_set_focus(int v, short is_now);
 126 extern short shooting_get_focus_mode();
 127 extern short shooting_get_real_focus_mode();
 128 extern short shooting_get_focus_state();
 129 extern short shooting_get_focus_ok();
 130 extern void shooting_update_dof_values();
 131 extern int shooting_get_hyperfocal_distance();
 132 extern int shooting_get_hyperfocal_distance_1e3_f(int av, int fl);
 133 extern int shooting_get_exif_subject_dist();
 134 extern int shooting_get_subject_distance();
 135 extern int shooting_get_subject_distance_override_value();
 136 extern int shooting_get_lens_to_focal_plane_width();
 137 extern short shooting_get_drive_mode();
 138 extern short shooting_can_focus();
 139 extern short shooting_get_common_focus_mode();
 140 extern short shooting_is_infinity_distance();
 141 extern void set_focus_bypass(int);
 142 
 143 /******************************************************************/
 144 
 145 extern int shooting_get_iso_mode();
 146 extern void shooting_set_iso_mode(int v);
 147 extern short shooting_get_sv96_real();
 148 extern short shooting_get_sv96_market();
 149 extern short shooting_get_iso_market();
 150 extern short shooting_get_iso_real();
 151 extern void shooting_set_iso_real(short iso, short is_now);
 152 extern void shooting_set_sv96(short sv96, short is_now);
 153 extern short shooting_get_iso_override_value();
 154 
 155 extern short shooting_iso_market_to_real(short isom);
 156 extern short shooting_iso_real_to_market(short isor);
 157 extern short shooting_sv96_market_to_real(short isom);
 158 extern short shooting_sv96_real_to_market(short isor);
 159 extern short shooting_get_sv96_from_iso(short iso);
 160 extern short shooting_get_iso_from_sv96(short sv96);
 161 
 162 /******************************************************************/
 163 
 164 extern short shooting_get_canon_overexposure_value();
 165 extern short shooting_get_bv96();
 166 extern int shooting_get_luminance();
 167 
 168 extern short shooting_get_ev_correction1();
 169 extern short shooting_get_ev_correction2();
 170 
 171 /******************************************************************/
 172 
 173 extern void shooting_expo_param_override();
 174 extern void shooting_bracketing(void);
 175 
 176 /******************************************************************/
 177 
 178 extern void DoAELock(void);
 179 extern void UnlockAE(void);
 180 
 181 extern int EngDrvRead(int gpio_reg);
 182 
 183 extern void PutInNdFilter();
 184 extern void PutOutNdFilter();
 185 extern long shooting_get_current_av96();
 186 extern long shooting_get_current_tv96();
 187 extern long IsStrobeChargeCompleted();
 188 extern void SetCurrentCaptureModeType();
 189 extern int shooting_get_imager_active();
 190 
 191 extern int get_ev_video_avail(void);
 192 extern void set_ev_video_avail(int);
 193 extern int get_ev_video(void);
 194 extern void set_ev_video(int);
 195 
 196 /******************************************************************/
 197 
 198 // capture mode functions
 199 // return a CHDK mode enum for a PROPCASE_SHOOTING_MODE value, or 0 if not found
 200 extern int shooting_mode_canon2chdk(int canonmode);
 201 // return a PROPCASE_SHOOTING_MODE value for a CHDK mode enum value, or -1 if not found. 0 is a valid mode on some cameras.
 202 extern int shooting_mode_chdk2canon(int hackmode);
 203 // set capture mode from CHDK mode, returns 0 if mode not found or not in rec, otherwise 1
 204 extern int shooting_set_mode_chdk(int mode);
 205 // set capture mode from PROPCASE_SHOOTING_MODE value. return 0 if not in rec or mode is -1, otherwise 1
 206 extern int shooting_set_mode_canon(int mode);
 207 
 208 // set switch between play (0) / rec (1) modes, using USB function if needed
 209 void shooting_set_playrec_mode(int mode);
 210 
 211 /******************************************************************/
 212 
 213 #define INFINITY_DIST               0xFFFFFFFF          // Value to send to firmware to select 'infinity' focus
 214 
 215 int get_focal_length(int zp);
 216 int get_effective_focal_length(int zp);
 217 int get_zoom_x(int zp);
 218 
 219 /******************************************************************/
 220 
 221 // Video recording current status constants, see movie_status variable 
 222 // values actually used in pre-DIGIC 6 firmware
 223 #define VIDEO_RECORD_NEVER_STARTED  0  
 224 #define VIDEO_RECORD_STOPPED        1  
 225 #define VIDEO_RECORD_IN_PROGRESS    4
 226 #define VIDEO_RECORD_STOPPING       5
 227 
 228 //Optical & digital zoom status constants, see zoom_status variable 
 229 #define ZOOM_OPTICAL_MIN            1
 230 #define ZOOM_OPTICAL_MAX            2
 231 #define ZOOM_OPTICAL_MEDIUM         3
 232 //#define ZOOM_OPTICAL_IN             4
 233 //#define ZOOM_OPTICAL_OUT            5
 234 //#define ZOOM_OPTICAL_REACHED_MIN    7
 235 
 236 //#define ZOOM_DIGITAL_MAX            9
 237 //#define ZOOM_DIGITAL_MEDIUM         10
 238 //#define ZOOM_DIGITAL_IN             11
 239 //#define ZOOM_DIGITAL_OUT            12
 240 //#define ZOOM_DIGITAL_REACHED_MAX    13
 241 
 242 // return whether video is actually being recorded
 243 extern int is_video_recording();
 244 // set movie status, not effective on CAM_SIMPLE_MOVIE_STATUS cams
 245 extern void set_movie_status(int status);
 246 // get movie status, emulated on CAM_SIMPLE_MOVIE_STATUS cams
 247 extern int get_movie_status();
 248 
 249 
 250 extern void change_video_tables(int a, int b);
 251 extern void shooting_video_bitrate_change(int v);
 252 
 253 // for CAM_MOVIEREC_NEWSTYLE:
 254 void shooting_video_minbitrate_change(int);
 255 unsigned int shooting_get_video_recorded_size_kb();
 256 extern void change_video_minbitrate(int, int);
 257 extern unsigned int get_video_recorded_size_kb();
 258 
 259 extern int zoom_status;
 260 extern const int zoom_points;
 261 extern int recreview_hold;
 262 
 263 /******************************************************************/
 264 
 265 #endif
 266 

/* [<][>][^][v][top][bottom][index][help] */