CHDK_DE Vorschauversion  Trunk Rev. 5544
 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 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_raw_enabled ()
 
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 213 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_TV96_INVALID   -10000

Definiert in Zeile 70 der Datei shooting.h.

#define VIDEO_RECORD_IN_PROGRESS   4

Definiert in Zeile 225 der Datei shooting.h.

#define VIDEO_RECORD_NEVER_STARTED   0

Definiert in Zeile 223 der Datei shooting.h.

#define VIDEO_RECORD_STOPPED   1

Definiert in Zeile 224 der Datei shooting.h.

#define VIDEO_RECORD_STOPPING   5

Definiert in Zeile 226 der Datei shooting.h.

#define ZOOM_OPTICAL_MAX   2

Definiert in Zeile 230 der Datei shooting.h.

#define ZOOM_OPTICAL_MEDIUM   3

Definiert in Zeile 231 der Datei shooting.h.

#define ZOOM_OPTICAL_MIN   1

Definiert in Zeile 229 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 1213 der Datei wrappers.c.

1214 {
1216  {
1217  _DoAELock();
1218  }
1219 }
int EngDrvRead ( int  gpio_reg)

Definiert in Zeile 1249 der Datei wrappers.c.

1250 {
1251  return _EngDrvRead(gpio_reg);
1252 }
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 1625 der Datei shooting.c.

1626 {
1627 #ifndef CAM_SIMPLE_MOVIE_STATUS
1628  return movie_status;
1629 #else
1630  // firmware movie_status interpreted as: zero - not recording, nonzero - recording
1631  return simple_movie_status?VIDEO_RECORD_IN_PROGRESS:VIDEO_RECORD_STOPPED;
1632 #endif
1633 }
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 1636 der Datei shooting.c.

1637 {
1638 #ifndef CAM_SIMPLE_MOVIE_STATUS
1639 #if defined(CAM_HAS_MOVIE_DIGEST_MODE)
1640  // If camera has movie digest mode then movie_status values are different than previous models
1641  // 'movie_status' values
1642  // 0 - after startup
1643  // 1 - movie recording stopped
1644  // 4 - movie recording in progress, or in 'movie digest' scene mode
1645  // 5 - movie recording stopping
1646  // 6 - in video mode, not recording
1648 #else
1649  // 'movie_status' values
1650  // 0 - after startup
1651  // 1 - movie recording stopped
1652  // 4 - movie recording in progress
1653  // 5 - movie recording stopping
1654  return (movie_status > 1);
1655 #endif
1656 #else // CAM_SIMPLE_MOVIE_STATUS
1657  return (simple_movie_status!=0);
1658 #endif
1659 }
long IsStrobeChargeCompleted ( )

Definiert in Zeile 386 der Datei wrappers.c.

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

Definiert in Zeile 149 der Datei kbd.c.

150 {
151  if (video_ael == x) return;
152  video_ael = x;
153  if (x)
154  {
155  av_video = tv_video = 0;
156 
158 
162 
164  else tv_min_video=441; //480; //1/30
165  }
166  else
168 }
void set_focus_bypass ( int  )

Definiert in Zeile 1318 der Datei shooting.c.

1319 {
1321 }
void set_movie_status ( int  status)

Definiert in Zeile 1596 der Datei shooting.c.

1597 {
1598 #ifndef CAM_SIMPLE_MOVIE_STATUS
1599  switch(status)
1600  {
1601  case 1:
1603  {
1605  }
1606  break;
1607  case 2:
1609  {
1611  }
1612  break;
1613  case 3:
1615  {
1617  }
1618  break;
1619  }
1620 #else // CAM_SIMPLE_MOVIE_STATUS
1621  // no known way to control the recording process
1622 #endif
1623 }
void SetCurrentCaptureModeType ( )

Definiert in Zeile 387 der Datei wrappers.c.

void shooting_bracketing ( void  )

Definiert in Zeile 1547 der Datei shooting.c.

short shooting_can_focus ( )

Definiert in Zeile 1220 der Datei shooting.c.

1221 {
1222  if(camera_info.state.mode_play) return 0 ; // don't focus in playback mode
1223 
1224  if(focus_interlock_bypass) return 1; // checks disabled, allow
1225 
1226  if( camera_info.state.mode_video == 1) return 1; // FIXME : default to MF enabled in video mode for now
1227 
1228 #ifdef CAM_SD_OVER_IN_AFL
1229  if (shooting_get_prop(PROPCASE_AF_LOCK)==1 ) return 1; // allow focus if AFL enabled and camera can focus that way?
1230 #endif
1231 #ifdef CAM_SD_OVER_IN_MF
1232  if (shooting_get_prop(PROPCASE_FOCUS_MODE)==1 ) return 1; // allow focus if MF enabled and camera can focus that way?
1233 #endif
1234 
1235 #ifdef CAM_SD_OVER_IN_AF
1236 #ifdef PROPCASE_CONTINUOUS_AF
1237  if (shooting_get_prop(PROPCASE_CONTINUOUS_AF)) return 0; // don't focus in continuous AF mode,
1238 #endif
1239 #ifdef PROPCASE_SERVO_AF
1240  if (shooting_get_prop(PROPCASE_SERVO_AF)) return 0; // don't focus in servo AF mode
1241 #endif
1242  if ( (shooting_get_prop(PROPCASE_AF_LOCK)==0) // allow focus when in AF mode (i.e AFL or MF not enabled)?
1243  && (shooting_get_prop(PROPCASE_FOCUS_MODE)==0 )) return 1;
1244 #endif
1245  return 0;
1246 }
void shooting_expo_param_override ( )
int shooting_get_analog_video_standard ( void  )

Definiert in Zeile 162 der Datei shooting.c.

163 {
164 #ifdef PROPCASE_LANGUAGE
166  // lowest bit of language propcase
167  v = (v&1) + 1;
168  return v;
169 #else // if unknown, just pretend it's NTSC
170  return 1;
171 #endif
172 }
int shooting_get_aperture_from_av96 ( short  av96)

Definiert in Zeile 713 der Datei shooting.c.

714 {
715  if (av96)
716  return (short)((pow(2, ((double)av96)/192.0))*1000.0 + 0.5);
717  return -1;
718 }
short shooting_get_aperture_sizes_table_size ( )

Definiert in Zeile 709 der Datei shooting.c.

709 { return AS_SIZE; }
short shooting_get_av96 ( )

Definiert in Zeile 708 der Datei shooting.c.

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

Definiert in Zeile 720 der Datei shooting.c.

721 {
722  return (int)((log((double)aperture/1000.0) * 192 * inv_log_2) + 0.5);
723 }
short shooting_get_av96_override_value ( )

Definiert in Zeile 726 der Datei shooting.c.

727 {
730  return (short) (AV96_MAX+32*(conf.av_override_value-AS_SIZE+1));
731 }
short shooting_get_bv96 ( )

Definiert in Zeile 125 der Datei shooting.c.

125 { return shooting_get_prop(PROPCASE_BV); }
short shooting_get_canon_overexposure_value ( )

Definiert in Zeile 126 der Datei shooting.c.

int shooting_get_canon_raw_enabled ( )

Definiert in Zeile 139 der Datei shooting.c.

139  {
140 #ifdef CAM_HAS_CANON_RAW
141 #ifdef PROPCASE_IMAGE_FORMAT
142  return (shooting_get_prop(PROPCASE_IMAGE_FORMAT) != 1); // 0 = raw, 2 = raw+jpeg
143 #else
144  return (shooting_get_prop(PROPCASE_RESOLUTION) == 5); // resolution 5 = raw, jpeg controlled with another prop
145 #endif
146 #else
147  return 0;
148 #endif
149 }
short shooting_get_common_focus_mode ( )

Definiert in Zeile 1248 der Datei shooting.c.

1249 {
1250 #if !CAM_HAS_MANUAL_FOCUS
1251  return conf.subj_dist_override_koef; // SD override state 0=OFF, 1=ON, 2=Infinity if camera has no native MF mode
1252 #else
1253  return shooting_get_focus_mode(); // 0=Auto, 1=manual
1254 #endif
1255 }
long shooting_get_current_av96 ( )

Definiert in Zeile 384 der Datei wrappers.c.

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

Definiert in Zeile 376 der Datei wrappers.c.

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

Definiert in Zeile 190 der Datei shooting.c.

191 {
192 #if CAM_PROPSET == 7 || CAM_PROPSET == 9 || CAM_PROPSET == 10 || CAM_PROPSET == 11 || CAM_PROPSET == 12 || CAM_PROPSET == 13
193  // PS7 doesn't have _STATE, combines values
195  if(x==1) {
196  return 1;
197  }
198  return 0;
199 #else
201 #endif
202 }
short shooting_get_display_mode ( )

Definiert in Zeile 132 der Datei shooting.c.

short shooting_get_drive_mode ( )

Definiert in Zeile 231 der Datei shooting.c.

232 {
233  // these cameras do not set PROPCASE_DRIVE_MODE when in custom timer mode
234  // SX 200 IS 0,1,2,3,4=Off, 2 Second, Custom, Face Detection
235 #if defined (CAM_DRIVE_MODE_FROM_TIMER_MODE)
237  // note we return this only in custom mode.
238  // Other cameras would return 3 if any timer mode is set (?) even if it doesn't do multiple exposures
239  // note that face detect does multiple exposure
240  if (m == 3)
241  return m;
242 #endif
243 
245 }
short shooting_get_ev_correction1 ( )

Definiert in Zeile 129 der Datei shooting.c.

short shooting_get_ev_correction2 ( )

Definiert in Zeile 130 der Datei shooting.c.

int shooting_get_exif_subject_dist ( )

Definiert in Zeile 134 der Datei shooting.c.

short shooting_get_flash_mode ( )

Definiert in Zeile 127 der Datei shooting.c.

short shooting_get_focus_mode ( )

Definiert in Zeile 128 der Datei shooting.c.

short shooting_get_focus_ok ( )

Definiert in Zeile 226 der Datei shooting.c.

227 {
228  return ((shooting_get_focus_state()!=0) && shooting_in_progress());
229 }
short shooting_get_focus_state ( )

Definiert in Zeile 219 der Datei shooting.c.

220 {
221  if (shooting_get_focus_mode()==1) return -1;
223  return (short) m;
224 }
int shooting_get_hyperfocal_distance ( )

Definiert in Zeile 1212 der Datei shooting.c.

1213 {
1216 }
int shooting_get_hyperfocal_distance_1e3_f ( int  av,
int  fl 
)

Definiert in Zeile 1065 der Datei shooting.c.

1066 {
1067  if ((av>0) && (fl>0) && (camera_info.circle_of_confusion>0))
1068  return (int)(((((double)fl*fl)/(av*camera_info.circle_of_confusion)*1000)+fl)+0.5);
1069  else return (-1);
1070 }
int shooting_get_imager_active ( )

Definiert in Zeile 151 der Datei shooting.c.

151  {
152  extern int imager_active;
153  return imager_active;
154 }
short shooting_get_is_mode ( )

Definiert in Zeile 124 der Datei shooting.c.

short shooting_get_iso_from_sv96 ( short  sv96)

Definiert in Zeile 346 der Datei shooting.c.

347 {
348  // APEX equation --> (int)(POWER(2,(iso/96)) * 3.125) + 0.5)
349  return (short)( (double)pow(2, (((double)sv96)/96.0))*100.0/32.0 + 0.5 );
350 }
short shooting_get_iso_market ( )

Definiert in Zeile 415 der Datei shooting.c.

416 {
418  if (sv == 0)
419  return 0;
420  return shooting_get_iso_from_sv96(sv);
421 }
int shooting_get_iso_mode ( )

Definiert in Zeile 394 der Datei shooting.c.

395 {
396  short isov = shooting_get_canon_iso_mode();
397  long i;
398  for (i=0;i<ISO_SIZE;i++)
399  {
400  if (iso_table[i].prop_id == isov)
401  return iso_table[i].id;
402  }
403  return 0;
404 }
short shooting_get_iso_override_value ( )

Definiert in Zeile 372 der Datei shooting.c.

373 {
374  short iso = conf.iso_override_value; // Start with market value
375  // Apply limits if needed
376 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
377  // Limit max ISO in HQ burst mode (also done in shooting_set_iso_real; but done here so OSD display value is correct)
380 #endif
381 #ifdef CAM_MIN_ISO_OVERRIDE
382  // Limit min (non-zero) ISO
383  // Some cameras will crash if flash used and ISO set lower than this value (most easily tested in AUTO mode)
384  if ((iso > 0) && (iso < CAM_MIN_ISO_OVERRIDE)) iso = CAM_MIN_ISO_OVERRIDE;
385 #endif
386 #ifdef CAM_MAX_ISO_OVERRIDE
387  // Limit max ISO
388  // Some cameras will crash if ISO set higher than this value (dependence on flash is unclear)
390 #endif
391  return shooting_iso_market_to_real(iso); // return real value (after limits applied)
392 }
short shooting_get_iso_real ( )

Definiert in Zeile 406 der Datei shooting.c.

407 {
408  short sv = shooting_get_sv96_real();
409  if (sv == 0)
410  return 0;
411  return shooting_get_iso_from_sv96(sv);
412 }
int shooting_get_lens_to_focal_plane_width ( )

Definiert in Zeile 1060 der Datei shooting.c.

1061 {
1063 }
int shooting_get_luminance ( )

Definiert in Zeile 1002 der Datei shooting.c.

1003 {
1004  short bv = shooting_get_bv96();
1005  int b = (int)(100 * K * pow(2.0,((double)(bv-168)/96.0)));
1006  return b;
1007 }
short shooting_get_max_av96 ( )

Definiert in Zeile 929 der Datei shooting.c.

930 {
931 #if CAM_HAS_IRIS_DIAPHRAGM
932  extern short GetUsableMinAv(void);
934  {
935  return -1;
936  }
937  return GetUsableMinAv();
938 #else
939  return -1;
940 #endif
941 }
short shooting_get_min_av96 ( )

Definiert in Zeile 915 der Datei shooting.c.

916 {
917 #if CAM_HAS_IRIS_DIAPHRAGM
918  extern short GetUsableMaxAv(void);
920  {
921  return -1;
922  }
923  return GetUsableMaxAv();
924 #else
925  return -1;
926 #endif
927 }
short shooting_get_nd_current_ev96 ( void  )

Definiert in Zeile 367 der Datei wrappers.c.

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

Definiert in Zeile 358 der Datei wrappers.c.

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

Definiert in Zeile 733 der Datei shooting.c.

short shooting_get_real_focus_mode ( )

Definiert in Zeile 211 der Datei shooting.c.

212 {
213  short f = shooting_get_focus_mode();
215  if (f==0 && m!=0) f=(m==1)?4:m;
216  return f;
217 }
short shooting_get_resolution ( )

Definiert in Zeile 131 der Datei shooting.c.

float shooting_get_shutter_speed_from_tv96 ( short  tv96)

Definiert in Zeile 552 der Datei shooting.c.

553 {
554  return pow(2,((float)(-tv96))/96.0);
555 }
int shooting_get_subject_distance ( )

Definiert in Zeile 1206 der Datei shooting.c.

1207 {
1210 }
int shooting_get_subject_distance_override_value ( )
short shooting_get_sv96_from_iso ( short  iso)

Definiert in Zeile 338 der Datei shooting.c.

339 {
340  // Equivalent to (short)(log2(iso/3.125)*96+0.5) [APEX equation]
341  if (iso > 0)
342  return (short)( log((double)(iso)*32.0/100.0)*96.0*(inv_log_2)+0.5 );
343  return 0;
344 }
short shooting_get_sv96_market ( )

Definiert in Zeile 312 der Datei shooting.c.

short shooting_get_sv96_real ( )

Definiert in Zeile 313 der Datei shooting.c.

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

Definiert in Zeile 536 der Datei shooting.c.

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

Definiert in Zeile 540 der Datei shooting.c.

541 {
542  if (t > 0)
543  {
544  t = ((96.0 * -log(t)) * inv_log_2);
545  if (t < 0)
546  return (short)(t - 0.5);
547  return (short)(t + 0.5);
548  }
549  return SHOOTING_TV96_INVALID;
550 }
short shooting_get_user_av96 ( )

Definiert in Zeile 808 der Datei shooting.c.

809 {
810 #if CAM_HAS_IRIS_DIAPHRAGM
812 #else
813  return 0;
814 #endif
815 }
int shooting_get_user_av_id ( )

Definiert in Zeile 817 der Datei shooting.c.

818 {
819 #if CAM_HAS_IRIS_DIAPHRAGM
820  return aperture_sizes_table[find_nearest_aperture_entry(shooting_get_user_av96())].prop_id;
821 #else
822  return 0;
823 #endif
824 }
short shooting_get_user_tv96 ( )

Definiert in Zeile 629 der Datei shooting.c.

630 {
631 #if CAM_HAS_USER_TV_MODES
633 #else
634  return 0;
635 #endif
636 }
int shooting_get_user_tv_id ( )

Definiert in Zeile 638 der Datei shooting.c.

639 {
640 #if CAM_HAS_USER_TV_MODES
642 #else
643  return 0;
644 #endif
645 }
unsigned int shooting_get_video_recorded_size_kb ( )
int shooting_get_zoom ( )

Definiert in Zeile 247 der Datei shooting.c.

248 {
249  return lens_get_zoom_point();
250 }
int shooting_in_progress ( )

Definiert in Zeile 136 der Datei shooting.c.

void shooting_init ( )

Definiert in Zeile 950 der Datei shooting.c.

951 {
953  iso_init();
954 }
int shooting_is_flash ( )

Definiert in Zeile 135 der Datei shooting.c.

int shooting_is_flash_ready ( )

Definiert in Zeile 1257 der Datei shooting.c.

1258 {
1259  int t = shooting_get_flash_mode();
1260  if ((t != 2) && (shooting_in_progress()))
1261  if (shooting_is_flash())
1262  return IsStrobeChargeCompleted();
1263  return 1;
1264 }
short shooting_is_infinity_distance ( )

Definiert in Zeile 1092 der Datei shooting.c.

1093 {
1094  return (shooting_get_lens_to_focal_plane_width() == 0)?1:0;
1095 }
short shooting_iso_market_to_real ( short  isom)

Definiert in Zeile 352 der Datei shooting.c.

353 {
354  return ISO_MARKET_TO_REAL(isom);
355 }
short shooting_iso_real_to_market ( short  isor)

Definiert in Zeile 357 der Datei shooting.c.

358 {
359  return ISO_REAL_TO_MARKET(isor);
360 }
int shooting_mode_canon2chdk ( int  canonmode)

Definiert in Zeile 1023 der Datei shooting.c.

1024 {
1025  int i;
1026  for (i=0; i < MODESCNT; i++)
1027  {
1028  if (modemap[i].canonmode == canonmode)
1029  return modemap[i].hackmode;
1030  }
1031  return 0;
1032 }
int shooting_mode_chdk2canon ( int  hackmode)

Definiert in Zeile 1034 der Datei shooting.c.

1035 {
1036  int i;
1037  for (i=0; i < MODESCNT; i++)
1038  {
1039  if (modemap[i].hackmode == hackmode)
1040  return modemap[i].canonmode;
1041  }
1042  return -1; // 0 is a valid mode on old cameras!
1043 }
void shooting_set_av96 ( short  av96,
short  is_now 
)

Definiert in Zeile 798 der Datei shooting.c.

799 {
800 #if CAM_HAS_IRIS_DIAPHRAGM
802  shooting_set_av96_direct(find_canon_aperture(av96), is_now);
803 #endif
804 }
void shooting_set_av96_direct ( short  av96,
short  is_now 
)

Definiert in Zeile 780 der Datei shooting.c.

781 {
782 #if CAM_HAS_IRIS_DIAPHRAGM
784  {
785  if(is_now)
786  {
787  set_property_case(PROPCASE_AV, &av96, sizeof(av96));
788 #ifdef PROPCASE_AV2
789  set_property_case(PROPCASE_AV2, &av96, sizeof(av96)); // Save override to property that will update JPEG header & Canon OSD
790 #endif
791  }
792  else
793  photo_param_put_off.av96 = av96;
794  }
795 #endif
796 }
void shooting_set_focus ( int  v,
short  is_now 
)

Definiert in Zeile 1323 der Datei shooting.c.

1324 {
1325  int s=v;
1327  {
1328  if (is_now && shooting_can_focus())
1329  {
1331  {
1333  }
1334  if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST))
1336  lens_set_focus_pos(s);
1337  }
1338  else
1340  }
1341 }
void shooting_set_iso_mode ( int  v)

Definiert in Zeile 429 der Datei shooting.c.

430 {
431  int i;
432  if (v < 50) // CHDK ID
433  {
434  for (i=0; i<ISO_SIZE; i++)
435  {
436  if (iso_table[i].id == v)
437  {
438  set_iso_mode(i);
439  return;
440  }
441  }
442  }
443  else // ISO value - find nearest entry in iso_table and set iso mode to that value
444  {
445  if (v <= iso_table[0].prop_id) // In case no AUTO (0) entry
446  {
447  set_iso_mode(0);
448  return;
449  }
450  for (i=0; i<ISO_SIZE-1; i++)
451  {
452  if ((v > iso_table[i].prop_id) && (v <= iso_table[i+1].prop_id))
453  {
454  if ((v - iso_table[i].prop_id) < (iso_table[i+1].prop_id - v))
455  set_iso_mode(i);
456  else
457  set_iso_mode(i+1);
458  return;
459  }
460  }
461  set_iso_mode(ISO_SIZE-1);
462  }
463 }
void shooting_set_iso_real ( short  iso,
short  is_now 
)

Definiert in Zeile 492 der Datei shooting.c.

493 {
495  {
496  if (iso > 0)
497  {
498 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
499  // Limit max ISO in HQ burst mode
502 #endif
503 #ifdef CAM_MIN_ISO_OVERRIDE
504  // Limit min (non-zero) ISO
506 #endif
507 #ifdef CAM_MAX_ISO_OVERRIDE
508  // Limit max ISO
510 #endif
512  }
513  }
514 }
int shooting_set_mode_canon ( int  mode)

Definiert in Zeile 1388 der Datei shooting.c.

1389 {
1390  if (canonmode == -1 || !rec_mode_active())
1391  return 0;
1392  SetCurrentCaptureModeType(canonmode);
1393  // updated cached mode information immediately
1394  mode_get();
1395  return 1;
1396 }
int shooting_set_mode_chdk ( int  mode)

Definiert in Zeile 1398 der Datei shooting.c.

1399 {
1401 }
void shooting_set_nd_filter_state ( short  v,
short  is_now 
)

Definiert in Zeile 876 der Datei shooting.c.

877 {
878 #if CAM_HAS_ND_FILTER
880  {
881  if (is_now)
882  {
883 #if defined(CAM_ND_SET_AV_VALUE)
884  short av;
885  get_property_case(PROPCASE_MIN_AV,&av,sizeof(av));
886  if(v==1) {
888  }
889  set_property_case(PROPCASE_AV, &av, sizeof(av));
890 #if defined(PROPCASE_AV2)
891  set_property_case(PROPCASE_AV2, &av, sizeof(av));
892 #endif
893 #endif
894  if (v==1) {
895  PutInNdFilter();
896  }
897  else if (v==2)
898  PutOutNdFilter();
899 #if defined(CAM_HAS_NATIVE_ND_FILTER) && defined(PROPCASE_ND_FILTER_STATE)
900  int n = (v==1) ? 1 : 0;
902 #endif
903  }
904  else
906  }
907 #endif
908 }
void shooting_set_playrec_mode ( int  mode)

Definiert in Zeile 1917 der Datei shooting.c.

1918 {
1919  // use PTP compatible switch if usb bit power detected, and USB remote not configured to use USB
1920  // TODO should just check the USB bit seen by canon firmware (after masking)
1922  {
1924  return;
1925  }
1926  if(mode)
1928  else
1929  levent_set_play();
1930 }
void shooting_set_sv96 ( short  sv96,
short  is_now 
)

Definiert in Zeile 465 der Datei shooting.c.

466 {
468  {
469  if (is_now)
470  {
471  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
472 
473  short iso_mode = shooting_get_canon_iso_mode();
474  if (iso_mode >= 50) {
475  // save current ISO mode, to avoid leaving in auto after override done
476  // only needed for non-auto
477  iso_override_mode_save = iso_mode;
478  shooting_set_iso_mode(0); // Force AUTO mode on camera
479  }
480 
481  short dsv96 = sv96 + SV96_MARKET_OFFSET - canon_sv96_base;
482 
483  set_property_case(PROPCASE_SV_MARKET, &canon_sv96_base, sizeof(canon_sv96_base));
484  set_property_case(PROPCASE_SV, &sv96, sizeof(sv96));
485  set_property_case(PROPCASE_DELTA_SV, &dsv96, sizeof(dsv96));
486  }
487  else
488  photo_param_put_off.sv96 = sv96;
489  }
490 }
void shooting_set_tv96 ( short  tv96,
short  is_now 
)

Definiert in Zeile 621 der Datei shooting.c.

622 {
625 }
void shooting_set_tv96_direct ( short  tv96,
short  is_now 
)

Definiert in Zeile 605 der Datei shooting.c.

606 {
608  {
609  if(is_now)
610  {
611  set_property_case(PROPCASE_TV, &tv96, sizeof(tv96));
612 #ifdef PROPCASE_TV2
613  set_property_case(PROPCASE_TV2, &tv96, sizeof(tv96)); // Save override to property that will update JPEG header & Canon OSD
614 #endif
615  }
616  else
617  photo_param_put_off.tv96 = tv96;
618  }
619 }
void shooting_set_user_av96 ( short  av96)

Definiert in Zeile 856 der Datei shooting.c.

857 {
858 #if CAM_HAS_IRIS_DIAPHRAGM
860  {
861  av96 = find_canon_aperture(av96);
862  set_property_case(PROPCASE_USER_AV, &av96, sizeof(av96));
863  }
864 #endif
865 }
void shooting_set_user_av_by_id ( int  v)

Definiert in Zeile 826 der Datei shooting.c.

827 {
828 #if CAM_HAS_IRIS_DIAPHRAGM
829  long i;
831  {
832  for (i=0;i<AS_SIZE;i++)
833  {
834  if (aperture_sizes_table[i].id == v)
835  {
836  short vv = aperture_sizes_table[i].prop_id;
837  set_property_case(PROPCASE_USER_AV, &vv, sizeof(vv));
838  return;
839  }
840  }
841  }
842 #endif
843 }
void shooting_set_user_av_by_id_rel ( int  v)

Definiert in Zeile 845 der Datei shooting.c.

846 {
847 #if CAM_HAS_IRIS_DIAPHRAGM
849  {
850  int cv = shooting_get_user_av_id();
852  }
853 #endif
854 }
void shooting_set_user_tv96 ( short  tv96)

Definiert in Zeile 677 der Datei shooting.c.

678 {
679 #if CAM_HAS_USER_TV_MODES
681  {
682  tv96 = find_canon_shutter_speed(tv96);
683  set_property_case(PROPCASE_USER_TV, &tv96, sizeof(tv96));
684  }
685 #endif
686 }
void shooting_set_user_tv_by_id ( int  v)

Definiert in Zeile 647 der Datei shooting.c.

648 {
649 #if CAM_HAS_USER_TV_MODES
651  {
652  long i;
653  for (i=0;i<SS_SIZE;i++)
654  {
655  if (shutter_speeds_table[i].id == v)
656  {
657  short vv = shutter_speeds_table[i].prop_id;
658  set_property_case(PROPCASE_USER_TV, &vv, sizeof(vv));
659  return;
660  }
661  }
662  }
663 #endif
664 }
void shooting_set_user_tv_by_id_rel ( int  v)

Definiert in Zeile 666 der Datei shooting.c.

667 {
668 #if CAM_HAS_USER_TV_MODES
670  {
671  int cv = shooting_get_user_tv_id();
673  }
674 #endif
675 }
void shooting_set_zoom ( int  v)

Definiert in Zeile 1284 der Datei shooting.c.

1285 {
1287  {
1288 #if CAM_REFOCUS_AFTER_ZOOM
1289  int dist = shooting_get_subject_distance();
1291 #if defined(CAM_NEED_SET_ZOOM_DELAY)
1293 #endif
1294  shooting_set_focus(dist, SET_NOW);
1295 #else // CAM_REFOCUS_AFTER_ZOOM
1297 #endif // CAM_REFOCUS_AFTER_ZOOM
1298  }
1299 }
void shooting_set_zoom_rel ( int  v)

Definiert in Zeile 1301 der Datei shooting.c.

1302 {
1303  int cv = shooting_get_zoom();
1305  {
1306  shooting_set_zoom(cv+v);
1307  }
1308 }
void shooting_set_zoom_speed ( int  v)

Definiert in Zeile 1310 der Datei shooting.c.

1310  {
1312  {
1314  }
1315 }
short shooting_sv96_market_to_real ( short  isom)

Definiert in Zeile 362 der Datei shooting.c.

363 {
364  return sv96 - SV96_MARKET_OFFSET;
365 }
short shooting_sv96_real_to_market ( short  isor)

Definiert in Zeile 367 der Datei shooting.c.

368 {
369  return sv96 + SV96_MARKET_OFFSET;
370 }
void shooting_update_dof_values ( )

Definiert in Zeile 1113 der Datei shooting.c.

1114 {
1115  int hyp, hyp_1e3, av_1e3, v;
1116  int dist = shooting_get_subject_distance_();
1117  int zoom_point = lens_get_zoom_point();
1118  int fl = get_focal_length(zoom_point);
1119  short f_focus_ok = shooting_get_focus_ok();
1120  short f_hyp_calc = 0, f_dist_calc = 0;
1121  short min_av96_zoom_point = 0;
1122  short av96 = shooting_get_user_av96();
1123  short curr_av96 = shooting_get_current_av96();
1124  short prop_av96 = shooting_get_av96();
1125  short min_av96;
1126 
1127  if (!min_av96_zoom_point_tbl) {
1128  min_av96_zoom_point_tbl = (short *) malloc(zoom_points * sizeof(short));
1130  memset(min_av96_zoom_point_tbl, 0, zoom_points * sizeof(short));
1131  }
1132  else {
1133  return;
1134  }
1135  } else min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];
1136 
1137  if (min_av96_zoom_point==0 && shooting_in_progress()) {
1138  get_property_case(PROPCASE_MIN_AV, &min_av96, sizeof(min_av96));
1139  min_av96_zoom_point_tbl[zoom_point] = min_av96;
1140  }
1141 
1142  if ((camera_info.state.mode_shooting==MODE_M || camera_info.state.mode_shooting==MODE_AV) && (av96>0) && !f_focus_ok) {
1143  if (av96 < min_av96_zoom_point) av96 = min_av96_zoom_point;
1144  }
1145  else av96 = (abs(curr_av96-prop_av96)<2)?prop_av96:curr_av96;
1146 
1147  av_1e3 = shooting_get_aperture_from_av96(av96);
1150 
1151  if (camera_info.dof_values.aperture_value!=av_1e3 || camera_info.dof_values.focal_length!=fl || (hyp_1e3<0)) {
1152  //calc new hyperfocal distance and min stack distance
1153  f_hyp_calc = 1;
1154  hyp_1e3 = -1;
1155  hyp = -1;
1158  hyp_1e3 = shooting_get_hyperfocal_distance_1e3_f(av_1e3, fl);
1159  if (hyp_1e3>0) {
1160  hyp = (hyp_1e3+500)/1000;
1162  v = ((hyp_1e3 - fl)/250 + 2 + 1)/2;
1163  if (v>0) {
1164  int m = ((fl*((fl - hyp_1e3)/1000 - 1)/500)/v + 1)/2;
1165  int m2 = (int)((((double)hyp*(2*fl - hyp_1e3)/1000))/v + 0.5);
1167  }
1168  }
1169  }
1170 
1171  if ((camera_info.dof_values.subject_distance!=dist || (camera_info.dof_values.hyperfocal_distance_1e3!=hyp_1e3)) && (hyp_1e3>0)) {
1172  //calc new NEAR, FAR, DOF values
1173  f_dist_calc = 1;
1178  if ((av_1e3>0) && (fl>0) && (dist>0) && (shooting_is_infinity_distance()==0) && (hyp_1e3>0)) {
1179  double m = ((double)(hyp_1e3 - fl)/1000 * dist) + 0.5;
1182  } else {
1183  int v = ((((hyp_1e3 - 2*fl + 1000*dist)/500) + 1)/2);
1184  if (v>0) camera_info.dof_values.near_limit = (int)(m/v);
1185  }
1186  int v = ((((hyp_1e3 - 1000*dist)/500) + 1)/2);
1187  if (v>0) camera_info.dof_values.far_limit = (int)(m/v);
1190  }
1191  }
1192  // if at infinity then set near to hyperfocal value
1193  // note focus beyond infinity is not distinguished from infinity
1196  }
1197  }
1200  f_focus_ok = (f_focus_ok && shooting_get_focus_ok());
1203  return;
1204 }
void shooting_video_bitrate_change ( int  v)

Definiert in Zeile 1343 der Datei shooting.c.

1344 {
1345 #if CAM_CHDK_HAS_EXT_VIDEO_MENU
1346  int m[]={1,2,3,4,5,6,7,8,10,12}; // m[v]/4 = bitrate*1x
1347  if (v>=(sizeof(m)/sizeof(m[0])))
1348  v=(sizeof(m)/sizeof(m[0]))-1;
1349  change_video_tables(m[v],4);
1350 #endif
1351 }
void shooting_video_minbitrate_change ( int  )
void UnlockAE ( void  )

Definiert in Zeile 1221 der Datei wrappers.c.

1222 {
1224  {
1225  _UnlockAE();
1226  }
1227 }

Variablen-Dokumentation

int recreview_hold
const int zoom_points

Definiert in Zeile 43 der Datei main.c.

int zoom_status