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     int subj_dist;
  42     int dsubj_dist;
  43     int subj_dist_step;
  44     short av96;
  45     short dav96;
  46     short av96_step;
  47     short tv96;
  48     short dtv96;
  49     short tv96_step;
  50     short sv96;
  51     short dsv96;
  52     short sv96_step;
  53     short iso;
  54     short diso;
  55     short iso_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 #define SHOOTING_CANON_FMT_JPG  1
 110 #define SHOOTING_CANON_FMT_RAW  2
 111 extern int shooting_get_canon_image_format();
 112 extern int shooting_set_canon_image_format(int fmt);
 113 
 114 /******************************************************************/
 115 
 116 extern int shooting_get_zoom();
 117 extern void shooting_set_zoom(int v);
 118 extern void shooting_set_zoom_rel(int v);
 119 extern void shooting_set_zoom_speed(int v);
 120 
 121 // mode: 0 = off or standard, 2 or 3 digital tele
 122 int shooting_get_digital_zoom_mode(void);
 123 // state: 0 = off or digital tele, 1 = standard
 124 int shooting_get_digital_zoom_state(void);
 125 
 126 /******************************************************************/
 127 
 128 extern void shooting_set_focus(int v, short is_now);
 129 extern short shooting_get_focus_mode();
 130 extern short shooting_get_real_focus_mode();
 131 extern short shooting_get_focus_state();
 132 extern short shooting_get_focus_ok();
 133 extern void shooting_update_dof_values();
 134 extern int shooting_get_hyperfocal_distance();
 135 extern int shooting_get_hyperfocal_distance_1e3_f(int av, int fl);
 136 extern int shooting_get_exif_subject_dist();
 137 extern int shooting_get_subject_distance();
 138 extern int shooting_get_subject_distance_override_value();
 139 extern int shooting_get_lens_to_focal_plane_width();
 140 extern short shooting_get_drive_mode();
 141 extern short shooting_can_focus();
 142 extern short shooting_get_common_focus_mode();
 143 extern short shooting_is_infinity_distance();
 144 extern void set_focus_bypass(int);
 145 
 146 /******************************************************************/
 147 
 148 extern int shooting_get_iso_mode();
 149 extern void shooting_set_iso_mode(int v);
 150 extern short shooting_get_sv96_real();
 151 extern short shooting_get_sv96_market();
 152 extern short shooting_get_iso_market();
 153 extern short shooting_get_iso_real();
 154 extern void shooting_set_iso_real(short iso, short is_now);
 155 extern void shooting_set_sv96(short sv96, short is_now);
 156 extern short shooting_get_iso_override_value();
 157 
 158 extern short shooting_iso_market_to_real(short isom);
 159 extern short shooting_iso_real_to_market(short isor);
 160 extern short shooting_sv96_market_to_real(short isom);
 161 extern short shooting_sv96_real_to_market(short isor);
 162 extern short shooting_get_sv96_from_iso(short iso);
 163 extern short shooting_get_iso_from_sv96(short sv96);
 164 
 165 /******************************************************************/
 166 
 167 extern short shooting_get_canon_overexposure_value();
 168 extern short shooting_get_bv96();
 169 extern int shooting_get_luminance();
 170 
 171 extern short shooting_get_ev_correction1();
 172 extern short shooting_get_ev_correction2();
 173 
 174 /******************************************************************/
 175 
 176 extern void shooting_expo_param_override();
 177 extern void shooting_bracketing(void);
 178 
 179 /******************************************************************/
 180 
 181 extern void DoAELock(void);
 182 extern void UnlockAE(void);
 183 
 184 extern int EngDrvRead(int gpio_reg);
 185 
 186 extern void PutInNdFilter();
 187 extern void PutOutNdFilter();
 188 extern long shooting_get_current_av96();
 189 extern long shooting_get_current_tv96();
 190 extern long IsStrobeChargeCompleted();
 191 extern void SetCurrentCaptureModeType();
 192 extern int shooting_get_imager_active();
 193 extern int shooting_get_analog_video_standard(void);
 194 extern int get_ev_video_avail(void);
 195 extern void set_ev_video_avail(int);
 196 extern int get_ev_video(void);
 197 extern void set_ev_video(int);
 198 
 199 /******************************************************************/
 200 
 201 // capture mode functions
 202 // return a CHDK mode enum for a PROPCASE_SHOOTING_MODE value, or 0 if not found
 203 extern int shooting_mode_canon2chdk(int canonmode);
 204 // 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.
 205 extern int shooting_mode_chdk2canon(int hackmode);
 206 // set capture mode from CHDK mode, returns 0 if mode not found or not in rec, otherwise 1
 207 extern int shooting_set_mode_chdk(int mode);
 208 // set capture mode from PROPCASE_SHOOTING_MODE value. return 0 if not in rec or mode is -1, otherwise 1
 209 extern int shooting_set_mode_canon(int mode);
 210 
 211 // set switch between play (0) / rec (1) modes, using USB function if needed
 212 void shooting_set_playrec_mode(int mode);
 213 
 214 /******************************************************************/
 215 
 216 #define INFINITY_DIST               0xFFFFFFFF          // Value to send to firmware to select 'infinity' focus
 217 
 218 int get_focal_length(int zp);
 219 int get_effective_focal_length(int zp);
 220 int get_zoom_x(int zp);
 221 
 222 /******************************************************************/
 223 
 224 // Video recording current status constants, see movie_status variable 
 225 // values actually used in pre-DIGIC 6 firmware
 226 #define VIDEO_RECORD_NEVER_STARTED  0  
 227 #define VIDEO_RECORD_STOPPED        1  
 228 #define VIDEO_RECORD_IN_PROGRESS    4
 229 #define VIDEO_RECORD_STOPPING       5
 230 
 231 //Optical & digital zoom status constants, see zoom_status variable 
 232 #define ZOOM_OPTICAL_MIN            1
 233 #define ZOOM_OPTICAL_MAX            2
 234 #define ZOOM_OPTICAL_MEDIUM         3
 235 //#define ZOOM_OPTICAL_IN             4
 236 //#define ZOOM_OPTICAL_OUT            5
 237 //#define ZOOM_OPTICAL_REACHED_MIN    7
 238 
 239 //#define ZOOM_DIGITAL_MAX            9
 240 //#define ZOOM_DIGITAL_MEDIUM         10
 241 //#define ZOOM_DIGITAL_IN             11
 242 //#define ZOOM_DIGITAL_OUT            12
 243 //#define ZOOM_DIGITAL_REACHED_MAX    13
 244 
 245 // return whether video is actually being recorded
 246 extern int is_video_recording();
 247 // set movie status, not effective on CAM_SIMPLE_MOVIE_STATUS cams
 248 extern void set_movie_status(int status);
 249 // get movie status, emulated on CAM_SIMPLE_MOVIE_STATUS cams
 250 extern int get_movie_status();
 251 
 252 
 253 extern void change_video_tables(int a, int b);
 254 extern void shooting_video_bitrate_change(int v);
 255 
 256 // for CAM_MOVIEREC_NEWSTYLE:
 257 void shooting_video_minbitrate_change(int);
 258 unsigned int shooting_get_video_recorded_size_kb();
 259 extern void change_video_minbitrate(int, int);
 260 extern unsigned int get_video_recorded_size_kb();
 261 
 262 extern int zoom_status;
 263 extern const int zoom_points;
 264 extern int recreview_hold;
 265 
 266 /******************************************************************/
 267 
 268 #endif
 269 

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