CHDK_DE Vorschauversion  Trunk Rev. 5707
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
shooting.h-Dateireferenz
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  ISOTable
 
struct  ShutterSpeed
 
struct  ApertureSize
 
struct  EXPO_BRACKETING_VALUES
 

Makrodefinitionen

#define SET_NOW   1
 
#define SET_LATER   0
 
#define SHOOTING_TV96_INVALID   -10000
 
#define SHOOTING_CANON_FMT_JPG   1
 
#define SHOOTING_CANON_FMT_RAW   2
 
#define INFINITY_DIST   0xFFFFFFFF
 
#define VIDEO_RECORD_NEVER_STARTED   0
 
#define VIDEO_RECORD_STOPPED   1
 
#define VIDEO_RECORD_IN_PROGRESS   4
 
#define VIDEO_RECORD_STOPPING   5
 
#define ZOOM_OPTICAL_MIN   1
 
#define ZOOM_OPTICAL_MAX   2
 
#define ZOOM_OPTICAL_MEDIUM   3
 

Funktionen

void shooting_init ()
 
int shooting_in_progress ()
 
int shooting_is_flash ()
 
int shooting_is_flash_ready ()
 
short shooting_get_flash_mode ()
 
int shooting_get_user_tv_id ()
 
short shooting_get_tv96 ()
 
short shooting_get_tv96_from_shutter_speed (float t)
 
void shooting_set_tv96 (short tv96, short is_now)
 
void shooting_set_tv96_direct (short tv96, short is_now)
 
short shooting_get_user_tv96 ()
 
void shooting_set_user_tv96 (short tv96)
 
float shooting_get_shutter_speed_from_tv96 (short tv96)
 
void shooting_set_user_tv_by_id (int v)
 
void shooting_set_user_tv_by_id_rel (int v)
 
short shooting_get_aperture_sizes_table_size ()
 
int shooting_get_aperture_from_av96 (short av96)
 
short shooting_get_av96_from_aperture (int aperture)
 
int shooting_get_user_av_id ()
 
void shooting_set_user_av_by_id (int v)
 
short shooting_get_av96 ()
 
short shooting_get_min_av96 ()
 
short shooting_get_max_av96 ()
 
void shooting_set_av96 (short av96, short is_now)
 
void shooting_set_av96_direct (short av96, short is_now)
 
short shooting_get_user_av96 ()
 
void shooting_set_user_av96 (short av96)
 
void shooting_set_user_av_by_id_rel (int v)
 
int shooting_get_real_aperture ()
 
short shooting_get_av96_override_value ()
 
void shooting_set_nd_filter_state (short v, short is_now)
 
short shooting_get_nd_value_ev96 (void)
 
short shooting_get_nd_current_ev96 (void)
 
short shooting_get_is_mode ()
 
short shooting_get_resolution ()
 
short shooting_get_display_mode ()
 
int shooting_get_canon_image_format ()
 
int shooting_set_canon_image_format (int fmt)
 
int shooting_get_zoom ()
 
void shooting_set_zoom (int v)
 
void shooting_set_zoom_rel (int v)
 
void shooting_set_zoom_speed (int v)
 
int shooting_get_digital_zoom_mode (void)
 
int shooting_get_digital_zoom_state (void)
 
void shooting_set_focus (int v, short is_now)
 
short shooting_get_focus_mode ()
 
short shooting_get_real_focus_mode ()
 
short shooting_get_focus_state ()
 
short shooting_get_focus_ok ()
 
void shooting_update_dof_values ()
 
int shooting_get_hyperfocal_distance ()
 
int shooting_get_hyperfocal_distance_1e3_f (int av, int fl)
 
int shooting_get_exif_subject_dist ()
 
int shooting_get_subject_distance ()
 
int shooting_get_subject_distance_override_value ()
 
int shooting_get_lens_to_focal_plane_width ()
 
short shooting_get_drive_mode ()
 
short shooting_can_focus ()
 
short shooting_get_common_focus_mode ()
 
short shooting_is_infinity_distance ()
 
void set_focus_bypass (int)
 
int shooting_get_iso_mode ()
 
void shooting_set_iso_mode (int v)
 
short shooting_get_sv96_real ()
 
short shooting_get_sv96_market ()
 
short shooting_get_iso_market ()
 
short shooting_get_iso_real ()
 
void shooting_set_iso_real (short iso, short is_now)
 
void shooting_set_sv96 (short sv96, short is_now)
 
short shooting_get_iso_override_value ()
 
short shooting_iso_market_to_real (short isom)
 
short shooting_iso_real_to_market (short isor)
 
short shooting_sv96_market_to_real (short isom)
 
short shooting_sv96_real_to_market (short isor)
 
short shooting_get_sv96_from_iso (short iso)
 
short shooting_get_iso_from_sv96 (short sv96)
 
short shooting_get_canon_overexposure_value ()
 
short shooting_get_bv96 ()
 
int shooting_get_luminance ()
 
short shooting_get_ev_correction1 ()
 
short shooting_get_ev_correction2 ()
 
void shooting_expo_param_override ()
 
void shooting_bracketing (void)
 
void DoAELock (void)
 
void UnlockAE (void)
 
int EngDrvRead (int gpio_reg)
 
void PutInNdFilter ()
 
void PutOutNdFilter ()
 
long shooting_get_current_av96 ()
 
long shooting_get_current_tv96 ()
 
long IsStrobeChargeCompleted ()
 
void SetCurrentCaptureModeType ()
 
int shooting_get_imager_active ()
 
int shooting_get_analog_video_standard (void)
 
int get_ev_video_avail (void)
 
void set_ev_video_avail (int)
 
int get_ev_video (void)
 
void set_ev_video (int)
 
int shooting_mode_canon2chdk (int canonmode)
 
int shooting_mode_chdk2canon (int hackmode)
 
int shooting_set_mode_chdk (int mode)
 
int shooting_set_mode_canon (int mode)
 
void shooting_set_playrec_mode (int mode)
 
int get_focal_length (int zp)
 
int get_effective_focal_length (int zp)
 
int get_zoom_x (int zp)
 
int is_video_recording ()
 
void set_movie_status (int status)
 
int get_movie_status ()
 
void change_video_tables (int a, int b)
 
void shooting_video_bitrate_change (int v)
 
void shooting_video_minbitrate_change (int)
 
unsigned int shooting_get_video_recorded_size_kb ()
 
void change_video_minbitrate (int, int)
 
unsigned int get_video_recorded_size_kb ()
 

Variablen

int zoom_status
 
const int zoom_points
 
int recreview_hold
 

Makro-Dokumentation

#define INFINITY_DIST   0xFFFFFFFF

Definiert in Zeile 216 der Datei shooting.h.

#define SET_LATER   0

Definiert in Zeile 16 der Datei shooting.h.

#define SET_NOW   1

Definiert in Zeile 15 der Datei shooting.h.

#define SHOOTING_CANON_FMT_JPG   1

Definiert in Zeile 109 der Datei shooting.h.

#define SHOOTING_CANON_FMT_RAW   2

Definiert in Zeile 110 der Datei shooting.h.

#define SHOOTING_TV96_INVALID   -10000

Definiert in Zeile 70 der Datei shooting.h.

#define VIDEO_RECORD_IN_PROGRESS   4

Definiert in Zeile 228 der Datei shooting.h.

#define VIDEO_RECORD_NEVER_STARTED   0

Definiert in Zeile 226 der Datei shooting.h.

#define VIDEO_RECORD_STOPPED   1

Definiert in Zeile 227 der Datei shooting.h.

#define VIDEO_RECORD_STOPPING   5

Definiert in Zeile 229 der Datei shooting.h.

#define ZOOM_OPTICAL_MAX   2

Definiert in Zeile 233 der Datei shooting.h.

#define ZOOM_OPTICAL_MEDIUM   3

Definiert in Zeile 234 der Datei shooting.h.

#define ZOOM_OPTICAL_MIN   1

Definiert in Zeile 232 der Datei shooting.h.

Dokumentation der Funktionen

void change_video_minbitrate ( int  ,
int   
)
void change_video_tables ( int  a,
int  b 
)

Definiert in Zeile 14 der Datei movie_rec.c.

14  {
15  int i;
16  for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b;
17 }
void DoAELock ( void  )

Definiert in Zeile 1228 der Datei wrappers.c.

1229 {
1231  {
1232  _DoAELock();
1233  }
1234 }
int EngDrvRead ( int  gpio_reg)

Definiert in Zeile 1264 der Datei wrappers.c.

1265 {
1266  return _EngDrvRead(gpio_reg);
1267 }
int get_effective_focal_length ( int  zp)

Definiert in Zeile 45 der Datei main.c.

45  {
47 }
int get_ev_video ( void  )
int get_ev_video_avail ( void  )
int get_focal_length ( int  zp)

Definiert in Zeile 49 der Datei main.c.

49  {
50  if (zp < 0) zp = 0;
51  else if (zp >= NUM_FL) zp = NUM_FL-1;
52  return focus_len_table[zp*NUM_DATA];
53 }
int get_movie_status ( )

Definiert in Zeile 1716 der Datei shooting.c.

1717 {
1718 #ifndef CAM_SIMPLE_MOVIE_STATUS
1719  return movie_status;
1720 #else
1721  // firmware movie_status interpreted as: zero - not recording, nonzero - recording
1722  return simple_movie_status?VIDEO_RECORD_IN_PROGRESS:VIDEO_RECORD_STOPPED;
1723 #endif
1724 }
unsigned int get_video_recorded_size_kb ( )
int get_zoom_x ( int  zp)

Definiert in Zeile 55 der Datei main.c.

55  {
56  return get_focal_length(zp)*10/focus_len_table[0];
57 }
int is_video_recording ( )

Definiert in Zeile 1727 der Datei shooting.c.

1728 {
1729 #ifndef CAM_SIMPLE_MOVIE_STATUS
1730 #if defined(CAM_HAS_MOVIE_DIGEST_MODE)
1731  // If camera has movie digest mode then movie_status values are different than previous models
1732  // 'movie_status' values
1733  // 0 - after startup
1734  // 1 - movie recording stopped
1735  // 4 - movie recording in progress, or in 'movie digest' scene mode
1736  // 5 - movie recording stopping
1737  // 6 - in video mode, not recording
1739 #else
1740  // 'movie_status' values
1741  // 0 - after startup
1742  // 1 - movie recording stopped
1743  // 4 - movie recording in progress
1744  // 5 - movie recording stopping
1745  return (movie_status > 1);
1746 #endif
1747 #else // CAM_SIMPLE_MOVIE_STATUS
1748  return (simple_movie_status!=0);
1749 #endif
1750 }
long IsStrobeChargeCompleted ( )

Definiert in Zeile 387 der Datei wrappers.c.

387 { return _IsStrobeChargeCompleted(); }
void PutInNdFilter ( )
void PutOutNdFilter ( )
void set_ev_video ( int  )
void set_ev_video_avail ( int  )

Definiert in Zeile 148 der Datei kbd.c.

149 {
150  if (video_ael == x) return;
151  video_ael = x;
152  if (x)
153  {
154  av_video = tv_video = 0;
155 
157 
161 
163  else tv_min_video=441; //480; //1/30
164  }
165  else
167 }
void set_focus_bypass ( int  )

Definiert in Zeile 1406 der Datei shooting.c.

1407 {
1409 }
void set_movie_status ( int  status)

Definiert in Zeile 1686 der Datei shooting.c.

1687 {
1688 #ifndef CAM_SIMPLE_MOVIE_STATUS
1689  switch(status)
1690  {
1691  case 1:
1693  {
1695  }
1696  break;
1697  case 2:
1699  {
1701  }
1702  break;
1703  case 3:
1705  {
1707  }
1708  break;
1709  }
1710 #else // CAM_SIMPLE_MOVIE_STATUS
1711  // no known way to control the recording process
1712  (void)status;
1713 #endif
1714 }
void SetCurrentCaptureModeType ( )

Definiert in Zeile 388 der Datei wrappers.c.

void shooting_bracketing ( void  )

Definiert in Zeile 1637 der Datei shooting.c.

short shooting_can_focus ( )

Definiert in Zeile 1308 der Datei shooting.c.

1309 {
1310  if(camera_info.state.mode_play) return 0 ; // don't focus in playback mode
1311 
1312  if(focus_interlock_bypass) return 1; // checks disabled, allow
1313 
1314  if( camera_info.state.mode_video == 1) return 1; // FIXME : default to MF enabled in video mode for now
1315 
1316 #ifdef CAM_SD_OVER_IN_AFL
1317  if (shooting_get_prop(PROPCASE_AF_LOCK)==1 ) return 1; // allow focus if AFL enabled and camera can focus that way?
1318 #endif
1319 #ifdef CAM_SD_OVER_IN_MF
1320  if (shooting_get_prop(PROPCASE_FOCUS_MODE)==1 ) return 1; // allow focus if MF enabled and camera can focus that way?
1321 #endif
1322 
1323 #ifdef CAM_SD_OVER_IN_AF
1324 #ifdef PROPCASE_CONTINUOUS_AF
1325  if (shooting_get_prop(PROPCASE_CONTINUOUS_AF)) return 0; // don't focus in continuous AF mode,
1326 #endif
1327 #ifdef PROPCASE_SERVO_AF
1328  if (shooting_get_prop(PROPCASE_SERVO_AF)) return 0; // don't focus in servo AF mode
1329 #endif
1330  if ( (shooting_get_prop(PROPCASE_AF_LOCK)==0) // allow focus when in AF mode (i.e AFL or MF not enabled)?
1331  && (shooting_get_prop(PROPCASE_FOCUS_MODE)==0 )) return 1;
1332 #endif
1333  return 0;
1334 }
void shooting_expo_param_override ( )
int shooting_get_analog_video_standard ( void  )

Definiert in Zeile 232 der Datei shooting.c.

233 {
234 #ifdef PROPCASE_LANGUAGE
236  // lowest bit of language propcase
237  v = (v&1) + 1;
238  return v;
239 #else // if unknown, just pretend it's NTSC
240  return 1;
241 #endif
242 }
int shooting_get_aperture_from_av96 ( short  av96)

Definiert in Zeile 789 der Datei shooting.c.

790 {
791  if (av96)
792  return (short)((pow(2, ((double)av96)/192.0))*1000.0 + 0.5);
793  return -1;
794 }
short shooting_get_aperture_sizes_table_size ( )

Definiert in Zeile 785 der Datei shooting.c.

785 { return AS_SIZE; }
short shooting_get_av96 ( )

Definiert in Zeile 784 der Datei shooting.c.

784 { return shooting_get_prop(PROPCASE_AV); }
short shooting_get_av96_from_aperture ( int  aperture)

Definiert in Zeile 796 der Datei shooting.c.

797 {
798  return (int)((log((double)aperture/1000.0) * 192 * inv_log_2) + 0.5);
799 }
short shooting_get_av96_override_value ( )

Definiert in Zeile 802 der Datei shooting.c.

803 {
804  if (conf.av_override_value<(int)AS_SIZE)
806  return (short) (AV96_MAX+32*(conf.av_override_value-AS_SIZE+1));
807 }
short shooting_get_bv96 ( )

Definiert in Zeile 124 der Datei shooting.c.

124 { return shooting_get_prop(PROPCASE_BV); }
int shooting_get_canon_image_format ( )

Definiert in Zeile 138 der Datei shooting.c.

138  {
139 #ifdef CAM_HAS_CANON_RAW
140 #ifdef PROPCASE_IMAGE_FORMAT
142  case 0:
143  return SHOOTING_CANON_FMT_RAW;
144  case 2:
146  default:
147  return SHOOTING_CANON_FMT_JPG;
148  }
149 #else // PROPCASE_IMAGE_FORMAT not defined, = propset 2 or 3
150  if(shooting_get_prop(PROPCASE_RESOLUTION) == 5) { // resolution 5 = raw, jpeg controlled by JPEG_WITH_RAW
153  }
154  return SHOOTING_CANON_FMT_RAW;
155  } else {
156  return SHOOTING_CANON_FMT_JPG;
157  }
158 #endif
159 #else // no native raw
160  return SHOOTING_CANON_FMT_JPG;
161 #endif
162 }
short shooting_get_canon_overexposure_value ( )

Definiert in Zeile 125 der Datei shooting.c.

short shooting_get_common_focus_mode ( )

Definiert in Zeile 1336 der Datei shooting.c.

1337 {
1338 #if !CAM_HAS_MANUAL_FOCUS
1339  return conf.subj_dist_override_koef; // SD override state 0=OFF, 1=ON, 2=Infinity if camera has no native MF mode
1340 #else
1341  return shooting_get_focus_mode(); // 0=Auto, 1=manual
1342 #endif
1343 }
long shooting_get_current_av96 ( )

Definiert in Zeile 385 der Datei wrappers.c.

385 { return _GetCurrentAvValue(); }
long shooting_get_current_tv96 ( )

Definiert in Zeile 377 der Datei wrappers.c.

378 {
379  // old cameras crash if _GetCurrentShutterSpeed called when inactive
381  return SHOOTING_TV96_INVALID;
382  }
383  return _GetCurrentShutterSpeed();
384 }
int shooting_get_digital_zoom_mode ( void  )
int shooting_get_digital_zoom_state ( void  )

Definiert in Zeile 260 der Datei shooting.c.

261 {
262 #if CAM_PROPSET == 7 || CAM_PROPSET == 9 || CAM_PROPSET == 10 || CAM_PROPSET == 11 || CAM_PROPSET == 12 || CAM_PROPSET == 13
263  // PS7 doesn't have _STATE, combines values
265  if(x==1) {
266  return 1;
267  }
268  return 0;
269 #else
271 #endif
272 }
short shooting_get_display_mode ( )

Definiert in Zeile 131 der Datei shooting.c.

short shooting_get_drive_mode ( )

Definiert in Zeile 301 der Datei shooting.c.

302 {
303  // these cameras do not set PROPCASE_DRIVE_MODE when in custom timer mode
304  // SX 200 IS 0,1,2,3,4=Off, 2 Second, Custom, Face Detection
305 #if defined (CAM_DRIVE_MODE_FROM_TIMER_MODE)
307  // note we return this only in custom mode.
308  // Other cameras would return 3 if any timer mode is set (?) even if it doesn't do multiple exposures
309  // note that face detect does multiple exposure
310  if (m == 3)
311  return m;
312 #endif
313 
315 }
short shooting_get_ev_correction1 ( )

Definiert in Zeile 128 der Datei shooting.c.

short shooting_get_ev_correction2 ( )

Definiert in Zeile 129 der Datei shooting.c.

int shooting_get_exif_subject_dist ( )

Definiert in Zeile 133 der Datei shooting.c.

short shooting_get_flash_mode ( )

Definiert in Zeile 126 der Datei shooting.c.

short shooting_get_focus_mode ( )

Definiert in Zeile 127 der Datei shooting.c.

short shooting_get_focus_ok ( )

Definiert in Zeile 296 der Datei shooting.c.

297 {
298  return ((shooting_get_focus_state()!=0) && shooting_in_progress());
299 }
short shooting_get_focus_state ( )

Definiert in Zeile 289 der Datei shooting.c.

290 {
291  if (shooting_get_focus_mode()==1) return -1;
293  return (short) m;
294 }
int shooting_get_hyperfocal_distance ( )

Definiert in Zeile 1300 der Datei shooting.c.

1301 {
1304 }
int shooting_get_hyperfocal_distance_1e3_f ( int  av,
int  fl 
)

Definiert in Zeile 1153 der Datei shooting.c.

1154 {
1155  if ((av>0) && (fl>0) && (camera_info.circle_of_confusion>0))
1156  return (int)(((((double)fl*fl)/(av*camera_info.circle_of_confusion)*1000)+fl)+0.5);
1157  else return (-1);
1158 }
int shooting_get_imager_active ( )

Definiert in Zeile 221 der Datei shooting.c.

221  {
222  extern int imager_active;
223  return imager_active;
224 }
short shooting_get_is_mode ( )

Definiert in Zeile 123 der Datei shooting.c.

short shooting_get_iso_from_sv96 ( short  sv96)

Definiert in Zeile 416 der Datei shooting.c.

417 {
418  // APEX equation --> (int)(POWER(2,(iso/96)) * 3.125) + 0.5)
419  return (short)( (double)pow(2, (((double)sv96)/96.0))*100.0/32.0 + 0.5 );
420 }
short shooting_get_iso_market ( )

Definiert in Zeile 485 der Datei shooting.c.

486 {
488  if (sv == 0)
489  return 0;
490  return shooting_get_iso_from_sv96(sv);
491 }
int shooting_get_iso_mode ( )

Definiert in Zeile 464 der Datei shooting.c.

465 {
466  short isov = shooting_get_canon_iso_mode();
467  unsigned i;
468  for (i=0;i<ISO_SIZE;i++)
469  {
470  if (iso_table[i].prop_id == isov)
471  return iso_table[i].id;
472  }
473  return 0;
474 }
short shooting_get_iso_override_value ( )

Definiert in Zeile 442 der Datei shooting.c.

443 {
444  short iso = conf.iso_override_value; // Start with market value
445  // Apply limits if needed
446 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
447  // Limit max ISO in HQ burst mode (also done in shooting_set_iso_real; but done here so OSD display value is correct)
450 #endif
451 #ifdef CAM_MIN_ISO_OVERRIDE
452  // Limit min (non-zero) ISO
453  // Some cameras will crash if flash used and ISO set lower than this value (most easily tested in AUTO mode)
454  if ((iso > 0) && (iso < CAM_MIN_ISO_OVERRIDE)) iso = CAM_MIN_ISO_OVERRIDE;
455 #endif
456 #ifdef CAM_MAX_ISO_OVERRIDE
457  // Limit max ISO
458  // Some cameras will crash if ISO set higher than this value (dependence on flash is unclear)
460 #endif
461  return shooting_iso_market_to_real(iso); // return real value (after limits applied)
462 }
short shooting_get_iso_real ( )

Definiert in Zeile 476 der Datei shooting.c.

477 {
478  short sv = shooting_get_sv96_real();
479  if (sv == 0)
480  return 0;
481  return shooting_get_iso_from_sv96(sv);
482 }
int shooting_get_lens_to_focal_plane_width ( )

Definiert in Zeile 1148 der Datei shooting.c.

1149 {
1151 }
int shooting_get_luminance ( )

Definiert in Zeile 1090 der Datei shooting.c.

1091 {
1092  short bv = shooting_get_bv96();
1093  int b = (int)(100 * K * pow(2.0,((double)(bv-168)/96.0)));
1094  return b;
1095 }
short shooting_get_max_av96 ( )

Definiert in Zeile 1017 der Datei shooting.c.

1018 {
1019 #if CAM_HAS_IRIS_DIAPHRAGM
1020  extern short GetUsableMinAv(void);
1022  {
1023  return -1;
1024  }
1025  return GetUsableMinAv();
1026 #else
1027  return -1;
1028 #endif
1029 }
short shooting_get_min_av96 ( )

Definiert in Zeile 1003 der Datei shooting.c.

1004 {
1005 #if CAM_HAS_IRIS_DIAPHRAGM
1006  extern short GetUsableMaxAv(void);
1008  {
1009  return -1;
1010  }
1011  return GetUsableMaxAv();
1012 #else
1013  return -1;
1014 #endif
1015 }
short shooting_get_nd_current_ev96 ( void  )

Definiert in Zeile 368 der Datei wrappers.c.

369 {
370 #if CAM_HAS_ND_FILTER
371  return _get_current_nd_value();
372 #else
373  return 0;
374 #endif
375 }
short shooting_get_nd_value_ev96 ( void  )

Definiert in Zeile 359 der Datei wrappers.c.

360 {
361 #if CAM_HAS_ND_FILTER
362  return _get_nd_value();
363 #else
364  return 0;
365 #endif
366 }
int shooting_get_real_aperture ( )

Definiert in Zeile 809 der Datei shooting.c.

short shooting_get_real_focus_mode ( )

Definiert in Zeile 281 der Datei shooting.c.

282 {
283  short f = shooting_get_focus_mode();
285  if (f==0 && m!=0) f=(m==1)?4:m;
286  return f;
287 }
short shooting_get_resolution ( )

Definiert in Zeile 130 der Datei shooting.c.

float shooting_get_shutter_speed_from_tv96 ( short  tv96)

Definiert in Zeile 622 der Datei shooting.c.

623 {
624  return pow(2,((float)(-tv96))/96.0);
625 }
int shooting_get_subject_distance ( )

Definiert in Zeile 1294 der Datei shooting.c.

1295 {
1298 }
int shooting_get_subject_distance_override_value ( )
short shooting_get_sv96_from_iso ( short  iso)

Definiert in Zeile 408 der Datei shooting.c.

409 {
410  // Equivalent to (short)(log2(iso/3.125)*96+0.5) [APEX equation]
411  if (iso > 0)
412  return (short)( log((double)(iso)*32.0/100.0)*96.0*(inv_log_2)+0.5 );
413  return 0;
414 }
short shooting_get_sv96_market ( )

Definiert in Zeile 382 der Datei shooting.c.

short shooting_get_sv96_real ( )

Definiert in Zeile 383 der Datei shooting.c.

383 { return shooting_get_prop(PROPCASE_SV); }
short shooting_get_tv96 ( )

Definiert in Zeile 606 der Datei shooting.c.

606 { return shooting_get_prop(PROPCASE_TV); }
short shooting_get_tv96_from_shutter_speed ( float  t)

Definiert in Zeile 610 der Datei shooting.c.

611 {
612  if (t > 0)
613  {
614  t = ((96.0 * -log(t)) * inv_log_2);
615  if (t < 0)
616  return (short)(t - 0.5);
617  return (short)(t + 0.5);
618  }
619  return SHOOTING_TV96_INVALID;
620 }
short shooting_get_user_av96 ( )

Definiert in Zeile 888 der Datei shooting.c.

889 {
890 #if CAM_HAS_IRIS_DIAPHRAGM
892 #else
893  return 0;
894 #endif
895 }
int shooting_get_user_av_id ( )

Definiert in Zeile 897 der Datei shooting.c.

898 {
899 #if CAM_HAS_IRIS_DIAPHRAGM
900  return aperture_sizes_table[find_nearest_aperture_entry(shooting_get_user_av96())].prop_id;
901 #else
902  return 0;
903 #endif
904 }
short shooting_get_user_tv96 ( )

Definiert in Zeile 699 der Datei shooting.c.

700 {
701 #if CAM_HAS_USER_TV_MODES
703 #else
704  return 0;
705 #endif
706 }
int shooting_get_user_tv_id ( )

Definiert in Zeile 708 der Datei shooting.c.

709 {
710 #if CAM_HAS_USER_TV_MODES
712 #else
713  return 0;
714 #endif
715 }
unsigned int shooting_get_video_recorded_size_kb ( )
int shooting_get_zoom ( )

Definiert in Zeile 317 der Datei shooting.c.

318 {
319  return lens_get_zoom_point();
320 }
int shooting_in_progress ( )

Definiert in Zeile 135 der Datei shooting.c.

void shooting_init ( )

Definiert in Zeile 1038 der Datei shooting.c.

1039 {
1041  iso_init();
1042 }
int shooting_is_flash ( )

Definiert in Zeile 134 der Datei shooting.c.

int shooting_is_flash_ready ( )

Definiert in Zeile 1345 der Datei shooting.c.

1346 {
1347  int t = shooting_get_flash_mode();
1348  if ((t != 2) && (shooting_in_progress()))
1349  if (shooting_is_flash())
1350  return IsStrobeChargeCompleted();
1351  return 1;
1352 }
short shooting_is_infinity_distance ( )

Definiert in Zeile 1180 der Datei shooting.c.

1181 {
1182  return (shooting_get_lens_to_focal_plane_width() == 0)?1:0;
1183 }
short shooting_iso_market_to_real ( short  isom)

Definiert in Zeile 422 der Datei shooting.c.

423 {
424  return ISO_MARKET_TO_REAL(isom);
425 }
short shooting_iso_real_to_market ( short  isor)

Definiert in Zeile 427 der Datei shooting.c.

428 {
429  return ISO_REAL_TO_MARKET(isor);
430 }
int shooting_mode_canon2chdk ( int  canonmode)

Definiert in Zeile 1111 der Datei shooting.c.

1112 {
1113  unsigned i;
1114  for (i=0; i < MODESCNT; i++)
1115  {
1116  if (modemap[i].canonmode == canonmode)
1117  return modemap[i].hackmode;
1118  }
1119  return 0;
1120 }
int shooting_mode_chdk2canon ( int  hackmode)

Definiert in Zeile 1122 der Datei shooting.c.

1123 {
1124  unsigned i;
1125  for (i=0; i < MODESCNT; i++)
1126  {
1127  if (modemap[i].hackmode == hackmode)
1128  return modemap[i].canonmode;
1129  }
1130  return -1; // 0 is a valid mode on old cameras!
1131 }
void shooting_set_av96 ( short  av96,
short  is_now 
)

Definiert in Zeile 876 der Datei shooting.c.

877 {
878 #if CAM_HAS_IRIS_DIAPHRAGM
880  shooting_set_av96_direct(find_canon_aperture(av96), is_now);
881 #else
882  (void)av96; (void)is_now;
883 #endif
884 }
void shooting_set_av96_direct ( short  av96,
short  is_now 
)

Definiert in Zeile 856 der Datei shooting.c.

857 {
858 #if CAM_HAS_IRIS_DIAPHRAGM
860  {
861  if(is_now)
862  {
863  set_property_case(PROPCASE_AV, &av96, sizeof(av96));
864 #ifdef PROPCASE_AV2
865  set_property_case(PROPCASE_AV2, &av96, sizeof(av96)); // Save override to property that will update JPEG header & Canon OSD
866 #endif
867  }
868  else
869  photo_param_put_off.av96 = av96;
870  }
871 #else
872  (void)av96; (void)is_now;
873 #endif
874 }
int shooting_set_canon_image_format ( int  fmt)

Definiert in Zeile 165 der Datei shooting.c.

165  {
166 #ifdef CAM_HAS_CANON_RAW
167 #ifdef PROPCASE_IMAGE_FORMAT
168  int v;
169  switch(fmt) {
171  v = 0;
172  break;
174  v = 2;
175  break;
177  v = 1;
178  break;
179  default:
180  return 0;
181  }
183  return 1;
184 #else // PROPCASE_IMAGE_FORMAT not defined, propset 2 or 3
185  // raw enabled is in resolution, try to save when changing to raw, restore when switching to jpeg
186  static int saved_resolution = -1;
187 
188  // invalid format, bail
189  if(fmt < 1 || fmt > 3) {
190  return 0;
191  }
192  if(fmt & SHOOTING_CANON_FMT_RAW) {
194  if( res != 5) { // raw requested, if resolution not already set, set to 5 and previous
195  saved_resolution = res;
197  }
198  if(fmt & SHOOTING_CANON_FMT_JPG) {
200  } else {
202  }
203  } else { // jpeg
204  if(shooting_get_prop(PROPCASE_RESOLUTION) == 5) { // 5 = raw for cams that set with resolution
205  if(saved_resolution != -1) {
206  shooting_set_prop(PROPCASE_RESOLUTION,saved_resolution); // switching to jpeg, try to restore resolution
207  saved_resolution = -1;
208  } else {
209  shooting_set_prop(PROPCASE_RESOLUTION,0); // default to L if we don't know
210  }
211  }
212  }
213  return 1;
214 #endif
215 #else // no native raw
216  return fmt == SHOOTING_CANON_FMT_JPG; // only setting jpeg is valid
217 #endif
218 }
void shooting_set_focus ( int  v,
short  is_now 
)

Definiert in Zeile 1411 der Datei shooting.c.

1412 {
1413  int s=v;
1415  {
1416  if (is_now && shooting_can_focus())
1417  {
1419  {
1421  }
1422  if (!conf.dof_use_exif_subj_dist && (s != (int)INFINITY_DIST))
1424  lens_set_focus_pos(s);
1425  }
1426  else
1428  }
1429 }
void shooting_set_iso_mode ( int  v)

Definiert in Zeile 499 der Datei shooting.c.

500 {
501  unsigned i;
502  if (v < 50) // CHDK ID
503  {
504  for (i=0; i<ISO_SIZE; i++)
505  {
506  if (iso_table[i].id == v)
507  {
508  set_iso_mode(i);
509  return;
510  }
511  }
512  }
513  else // ISO value - find nearest entry in iso_table and set iso mode to that value
514  {
515  if (v <= iso_table[0].prop_id) // In case no AUTO (0) entry
516  {
517  set_iso_mode(0);
518  return;
519  }
520  for (i=0; i<ISO_SIZE-1; i++)
521  {
522  if ((v > iso_table[i].prop_id) && (v <= iso_table[i+1].prop_id))
523  {
524  if ((v - iso_table[i].prop_id) < (iso_table[i+1].prop_id - v))
525  set_iso_mode(i);
526  else
527  set_iso_mode(i+1);
528  return;
529  }
530  }
531  set_iso_mode(ISO_SIZE-1);
532  }
533 }
void shooting_set_iso_real ( short  iso,
short  is_now 
)

Definiert in Zeile 562 der Datei shooting.c.

563 {
565  {
566  if (iso > 0)
567  {
568 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
569  // Limit max ISO in HQ burst mode
572 #endif
573 #ifdef CAM_MIN_ISO_OVERRIDE
574  // Limit min (non-zero) ISO
576 #endif
577 #ifdef CAM_MAX_ISO_OVERRIDE
578  // Limit max ISO
580 #endif
582  }
583  }
584 }
int shooting_set_mode_canon ( int  mode)

Definiert in Zeile 1478 der Datei shooting.c.

1479 {
1480  if (canonmode == -1 || !rec_mode_active())
1481  return 0;
1482  SetCurrentCaptureModeType(canonmode);
1483  // updated cached mode information immediately
1484  mode_get();
1485  return 1;
1486 }
int shooting_set_mode_chdk ( int  mode)

Definiert in Zeile 1488 der Datei shooting.c.

1489 {
1491 }
void shooting_set_nd_filter_state ( short  v,
short  is_now 
)

Definiert in Zeile 962 der Datei shooting.c.

963 {
964 #if CAM_HAS_ND_FILTER
966  {
967  if (is_now)
968  {
969 #if CAM_ND_SET_AV_VALUE == 1
970  short av;
971  get_property_case(PROPCASE_MIN_AV,&av,sizeof(av));
972  if(v==1) {
974  }
975  set_property_case(PROPCASE_AV, &av, sizeof(av));
976 #if defined(PROPCASE_AV2)
977  set_property_case(PROPCASE_AV2, &av, sizeof(av));
978 #endif
979 #endif // CAM_ND_SET_AV_VALUE
980  if (v==1) {
981  PutInNdFilter();
982  }
983  else if (v==2)
984  PutOutNdFilter();
985 #if defined(CAM_HAS_NATIVE_ND_FILTER) && defined(PROPCASE_ND_FILTER_STATE)
986  int n = (v==1) ? 1 : 0;
988 #endif
989  }
990  else
992  }
993 #else
994  (void)v; (void)is_now;
995 #endif // CAM_HAS_ND_FILTER
996 }
void shooting_set_playrec_mode ( int  mode)

Definiert in Zeile 2008 der Datei shooting.c.

2009 {
2010  // use PTP compatible switch if usb bit power detected, and USB remote not configured to use USB
2011  // TODO should just check the USB bit seen by canon firmware (after masking)
2013  {
2015  return;
2016  }
2017  if(mode)
2019  else
2020  levent_set_play();
2021 }
void shooting_set_sv96 ( short  sv96,
short  is_now 
)

Definiert in Zeile 535 der Datei shooting.c.

536 {
538  {
539  if (is_now)
540  {
541  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
542 
543  short iso_mode = shooting_get_canon_iso_mode();
544  if (iso_mode >= 50) {
545  // save current ISO mode, to avoid leaving in auto after override done
546  // only needed for non-auto
547  iso_override_mode_save = iso_mode;
548  shooting_set_iso_mode(0); // Force AUTO mode on camera
549  }
550 
551  short dsv96 = sv96 + SV96_MARKET_OFFSET - canon_sv96_base;
552 
553  set_property_case(PROPCASE_SV_MARKET, &canon_sv96_base, sizeof(canon_sv96_base));
554  set_property_case(PROPCASE_SV, &sv96, sizeof(sv96));
555  set_property_case(PROPCASE_DELTA_SV, &dsv96, sizeof(dsv96));
556  }
557  else
558  photo_param_put_off.sv96 = sv96;
559  }
560 }
void shooting_set_tv96 ( short  tv96,
short  is_now 
)

Definiert in Zeile 691 der Datei shooting.c.

692 {
695 }
void shooting_set_tv96_direct ( short  tv96,
short  is_now 
)

Definiert in Zeile 675 der Datei shooting.c.

676 {
678  {
679  if(is_now)
680  {
681  set_property_case(PROPCASE_TV, &tv96, sizeof(tv96));
682 #ifdef PROPCASE_TV2
683  set_property_case(PROPCASE_TV2, &tv96, sizeof(tv96)); // Save override to property that will update JPEG header & Canon OSD
684 #endif
685  }
686  else
687  photo_param_put_off.tv96 = tv96;
688  }
689 }
void shooting_set_user_av96 ( short  av96)

Definiert in Zeile 940 der Datei shooting.c.

941 {
942 #if CAM_HAS_IRIS_DIAPHRAGM
944  {
945  av96 = find_canon_aperture(av96);
946  set_property_case(PROPCASE_USER_AV, &av96, sizeof(av96));
947  }
948 #else
949  (void)av96;
950 #endif
951 }
void shooting_set_user_av_by_id ( int  v)

Definiert in Zeile 906 der Datei shooting.c.

907 {
908 #if CAM_HAS_IRIS_DIAPHRAGM
909  unsigned i;
911  {
912  for (i=0;i<AS_SIZE;i++)
913  {
914  if (aperture_sizes_table[i].id == v)
915  {
916  short vv = aperture_sizes_table[i].prop_id;
917  set_property_case(PROPCASE_USER_AV, &vv, sizeof(vv));
918  return;
919  }
920  }
921  }
922 #else
923  (void)v;
924 #endif
925 }
void shooting_set_user_av_by_id_rel ( int  v)

Definiert in Zeile 927 der Datei shooting.c.

928 {
929 #if CAM_HAS_IRIS_DIAPHRAGM
931  {
932  int cv = shooting_get_user_av_id();
934  }
935 #else
936  (void)v;
937 #endif
938 }
void shooting_set_user_tv96 ( short  tv96)

Definiert in Zeile 751 der Datei shooting.c.

752 {
753 #if CAM_HAS_USER_TV_MODES
755  {
756  tv96 = find_canon_shutter_speed(tv96);
757  set_property_case(PROPCASE_USER_TV, &tv96, sizeof(tv96));
758  }
759 #else
760  (void)tv96;
761 #endif
762 }
void shooting_set_user_tv_by_id ( int  v)

Definiert in Zeile 717 der Datei shooting.c.

718 {
719 #if CAM_HAS_USER_TV_MODES
721  {
722  unsigned i;
723  for (i=0;i<SS_SIZE;i++)
724  {
725  if (shutter_speeds_table[i].id == v)
726  {
727  short vv = shutter_speeds_table[i].prop_id;
728  set_property_case(PROPCASE_USER_TV, &vv, sizeof(vv));
729  return;
730  }
731  }
732  }
733 #else
734  (void)v;
735 #endif
736 }
void shooting_set_user_tv_by_id_rel ( int  v)

Definiert in Zeile 738 der Datei shooting.c.

739 {
740 #if CAM_HAS_USER_TV_MODES
742  {
743  int cv = shooting_get_user_tv_id();
745  }
746 #else
747  (void)v;
748 #endif
749 }
void shooting_set_zoom ( int  v)

Definiert in Zeile 1372 der Datei shooting.c.

1373 {
1375  {
1376 #if CAM_REFOCUS_AFTER_ZOOM
1377  int dist = shooting_get_subject_distance();
1379 #if defined(CAM_NEED_SET_ZOOM_DELAY)
1381 #endif
1382  shooting_set_focus(dist, SET_NOW);
1383 #else // CAM_REFOCUS_AFTER_ZOOM
1385 #endif // CAM_REFOCUS_AFTER_ZOOM
1386  }
1387 }
void shooting_set_zoom_rel ( int  v)

Definiert in Zeile 1389 der Datei shooting.c.

1390 {
1391  int cv = shooting_get_zoom();
1393  {
1394  shooting_set_zoom(cv+v);
1395  }
1396 }
void shooting_set_zoom_speed ( int  v)

Definiert in Zeile 1398 der Datei shooting.c.

1398  {
1400  {
1402  }
1403 }
short shooting_sv96_market_to_real ( short  isom)

Definiert in Zeile 432 der Datei shooting.c.

433 {
434  return sv96 - SV96_MARKET_OFFSET;
435 }
short shooting_sv96_real_to_market ( short  isor)

Definiert in Zeile 437 der Datei shooting.c.

438 {
439  return sv96 + SV96_MARKET_OFFSET;
440 }
void shooting_update_dof_values ( )

Definiert in Zeile 1201 der Datei shooting.c.

1202 {
1203  int hyp, hyp_1e3, av_1e3, v;
1204  int dist = shooting_get_subject_distance_();
1205  int zoom_point = lens_get_zoom_point();
1206  int fl = get_focal_length(zoom_point);
1207  short f_focus_ok = shooting_get_focus_ok();
1208  short f_hyp_calc = 0, f_dist_calc = 0;
1209  short min_av96_zoom_point = 0;
1210  short av96 = shooting_get_user_av96();
1211  short curr_av96 = shooting_get_current_av96();
1212  short prop_av96 = shooting_get_av96();
1213  short min_av96;
1214 
1215  if (!min_av96_zoom_point_tbl) {
1216  min_av96_zoom_point_tbl = (short *) malloc(zoom_points * sizeof(short));
1218  memset(min_av96_zoom_point_tbl, 0, zoom_points * sizeof(short));
1219  }
1220  else {
1221  return;
1222  }
1223  } else min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];
1224 
1225  if (min_av96_zoom_point==0 && shooting_in_progress()) {
1226  get_property_case(PROPCASE_MIN_AV, &min_av96, sizeof(min_av96));
1227  min_av96_zoom_point_tbl[zoom_point] = min_av96;
1228  }
1229 
1230  if ((camera_info.state.mode_shooting==MODE_M || camera_info.state.mode_shooting==MODE_AV) && (av96>0) && !f_focus_ok) {
1231  if (av96 < min_av96_zoom_point) av96 = min_av96_zoom_point;
1232  }
1233  else av96 = (abs(curr_av96-prop_av96)<2)?prop_av96:curr_av96;
1234 
1235  av_1e3 = shooting_get_aperture_from_av96(av96);
1238 
1239  if (camera_info.dof_values.aperture_value!=av_1e3 || camera_info.dof_values.focal_length!=fl || (hyp_1e3<0)) {
1240  //calc new hyperfocal distance and min stack distance
1241  f_hyp_calc = 1;
1242  hyp_1e3 = -1;
1243  hyp = -1;
1246  hyp_1e3 = shooting_get_hyperfocal_distance_1e3_f(av_1e3, fl);
1247  if (hyp_1e3>0) {
1248  hyp = (hyp_1e3+500)/1000;
1250  v = ((hyp_1e3 - fl)/250 + 2 + 1)/2;
1251  if (v>0) {
1252  int m = ((fl*((fl - hyp_1e3)/1000 - 1)/500)/v + 1)/2;
1253  int m2 = (int)((((double)hyp*(2*fl - hyp_1e3)/1000))/v + 0.5);
1255  }
1256  }
1257  }
1258 
1259  if ((camera_info.dof_values.subject_distance!=dist || (camera_info.dof_values.hyperfocal_distance_1e3!=hyp_1e3)) && (hyp_1e3>0)) {
1260  //calc new NEAR, FAR, DOF values
1261  f_dist_calc = 1;
1266  if ((av_1e3>0) && (fl>0) && (dist>0) && (shooting_is_infinity_distance()==0) && (hyp_1e3>0)) {
1267  double m = ((double)(hyp_1e3 - fl)/1000 * dist) + 0.5;
1270  } else {
1271  int v = ((((hyp_1e3 - 2*fl + 1000*dist)/500) + 1)/2);
1272  if (v>0) camera_info.dof_values.near_limit = (int)(m/v);
1273  }
1274  int v = ((((hyp_1e3 - 1000*dist)/500) + 1)/2);
1275  if (v>0) camera_info.dof_values.far_limit = (int)(m/v);
1278  }
1279  }
1280  // if at infinity then set near to hyperfocal value
1281  // note focus beyond infinity is not distinguished from infinity
1284  }
1285  }
1288  f_focus_ok = (f_focus_ok && shooting_get_focus_ok());
1291  return;
1292 }
void shooting_video_bitrate_change ( int  v)

Definiert in Zeile 1431 der Datei shooting.c.

1432 {
1433 #if CAM_CHDK_HAS_EXT_VIDEO_MENU
1434  int m[]={1,2,3,4,5,6,7,8,10,12}; // m[v]/4 = bitrate*1x
1435  if (v>=(int)((sizeof(m)/sizeof(m[0]))))
1436  v=(sizeof(m)/sizeof(m[0]))-1;
1437  change_video_tables(m[v],4);
1438 #else
1439  (void)v;
1440 #endif
1441 }
void shooting_video_minbitrate_change ( int  )
void UnlockAE ( void  )

Definiert in Zeile 1236 der Datei wrappers.c.

1237 {
1239  {
1240  _UnlockAE();
1241  }
1242 }

Variablen-Dokumentation

int recreview_hold
const int zoom_points

Definiert in Zeile 43 der Datei main.c.

int zoom_status

Definiert in Zeile 8 der Datei lib.c.