CHDK_DE Vorschauversion  Trunk Rev. 5292
 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 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 1204 der Datei wrappers.c.

1205 {
1207  {
1208  _DoAELock();
1209  }
1210 }
int EngDrvRead ( int  gpio_reg)

Definiert in Zeile 1240 der Datei wrappers.c.

1241 {
1242  return _EngDrvRead(gpio_reg);
1243 }
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 1547 der Datei shooting.c.

1548 {
1549 #ifndef CAM_SIMPLE_MOVIE_STATUS
1550  return movie_status;
1551 #else
1552  // firmware movie_status interpreted as: zero - not recording, nonzero - recording
1553  return simple_movie_status?VIDEO_RECORD_IN_PROGRESS:VIDEO_RECORD_STOPPED;
1554 #endif
1555 }
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 1558 der Datei shooting.c.

1559 {
1560 #ifndef CAM_SIMPLE_MOVIE_STATUS
1561 #if defined(CAM_HAS_MOVIE_DIGEST_MODE)
1562  // If camera has movie digest mode then movie_status values are different than previous models
1563  // 'movie_status' values
1564  // 0 - after startup
1565  // 1 - movie recording stopped
1566  // 4 - movie recording in progress, or in 'movie digest' scene mode
1567  // 5 - movie recording stopping
1568  // 6 - in video mode, not recording
1570 #else
1571  // 'movie_status' values
1572  // 0 - after startup
1573  // 1 - movie recording stopped
1574  // 4 - movie recording in progress
1575  // 5 - movie recording stopping
1576  return (movie_status > 1);
1577 #endif
1578 #else // CAM_SIMPLE_MOVIE_STATUS
1579  return (simple_movie_status!=0);
1580 #endif
1581 }
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 143 der Datei kbd.c.

144 {
145  if (video_ael == x) return;
146  video_ael = x;
147  if (x)
148  {
149  av_video = tv_video = 0;
150 
152 
156 
158  else tv_min_video=441; //480; //1/30
159  }
160  else
162 }
void set_focus_bypass ( int  )

Definiert in Zeile 1240 der Datei shooting.c.

1241 {
1243 }
void set_movie_status ( int  status)

Definiert in Zeile 1518 der Datei shooting.c.

1519 {
1520 #ifndef CAM_SIMPLE_MOVIE_STATUS
1521  switch(status)
1522  {
1523  case 1:
1525  {
1527  }
1528  break;
1529  case 2:
1531  {
1533  }
1534  break;
1535  case 3:
1537  {
1539  }
1540  break;
1541  }
1542 #else // CAM_SIMPLE_MOVIE_STATUS
1543  // no known way to control the recording process
1544 #endif
1545 }
void SetCurrentCaptureModeType ( )

Definiert in Zeile 387 der Datei wrappers.c.

void shooting_bracketing ( void  )

Definiert in Zeile 1469 der Datei shooting.c.

short shooting_can_focus ( )

Definiert in Zeile 1148 der Datei shooting.c.

1149 {
1150  if(camera_info.state.mode_play) return 0 ; // don't focus in playback mode
1151 
1152  if(focus_interlock_bypass) return 1; // checks disabled, allow
1153 
1154  if( camera_info.state.mode_video == 1) return 1; // FIXME : default to MF enabled in video mode for now
1155 
1156 #ifdef CAM_SD_OVER_IN_AFL
1157  if (shooting_get_prop(PROPCASE_AF_LOCK)==1 ) return 1; // allow focus if AFL enabled and camera can focus that way?
1158 #endif
1159 #ifdef CAM_SD_OVER_IN_MF
1160  if (shooting_get_prop(PROPCASE_FOCUS_MODE)==1 ) return 1; // allow focus if MF enabled and camera can focus that way?
1161 #endif
1162 
1163 #ifdef CAM_SD_OVER_IN_AF
1164 #ifdef PROPCASE_CONTINUOUS_AF
1165  if (shooting_get_prop(PROPCASE_CONTINUOUS_AF)) return 0; // don't focus in continuous AF mode,
1166 #endif
1167 #ifdef PROPCASE_SERVO_AF
1168  if (shooting_get_prop(PROPCASE_SERVO_AF)) return 0; // don't focus in servo AF mode
1169 #endif
1170  if ( (shooting_get_prop(PROPCASE_AF_LOCK)==0) // allow focus when in AF mode (i.e AFL or MF not enabled)?
1171  && (shooting_get_prop(PROPCASE_FOCUS_MODE)==0 )) return 1;
1172 #endif
1173  return 0;
1174 }
void shooting_expo_param_override ( )
int shooting_get_aperture_from_av96 ( short  av96)

Definiert in Zeile 648 der Datei shooting.c.

649 {
650  if (av96)
651  return (short)((pow(2, ((double)av96)/192.0))*1000.0 + 0.5);
652  return -1;
653 }
short shooting_get_aperture_sizes_table_size ( )

Definiert in Zeile 644 der Datei shooting.c.

644 { return AS_SIZE; }
short shooting_get_av96 ( )

Definiert in Zeile 643 der Datei shooting.c.

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

Definiert in Zeile 655 der Datei shooting.c.

656 {
657  return (int)((log((double)aperture/1000.0) * 192 * inv_log_2) + 0.5);
658 }
short shooting_get_av96_override_value ( )

Definiert in Zeile 661 der Datei shooting.c.

662 {
665  return (short) (AV96_MAX+32*(conf.av_override_value-AS_SIZE+1));
666 }
short shooting_get_bv96 ( )

Definiert in Zeile 82 der Datei shooting.c.

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

Definiert in Zeile 83 der Datei shooting.c.

int shooting_get_canon_raw_enabled ( )

Definiert in Zeile 96 der Datei shooting.c.

96  {
97 #ifdef CAM_HAS_CANON_RAW
98 #ifdef PROPCASE_IMAGE_FORMAT
99  return (shooting_get_prop(PROPCASE_IMAGE_FORMAT) != 1); // 0 = raw, 2 = raw+jpeg
100 #else
101  return (shooting_get_prop(PROPCASE_RESOLUTION) == 5); // resolution 5 = raw, jpeg controlled with another prop
102 #endif
103 #else
104  return 0;
105 #endif
106 }
short shooting_get_common_focus_mode ( )

Definiert in Zeile 1176 der Datei shooting.c.

1177 {
1178 #if !CAM_HAS_MANUAL_FOCUS
1179  return conf.subj_dist_override_koef; // SD override state 0=OFF, 1=ON, 2=Infinity if camera has no native MF mode
1180 #else
1181  return shooting_get_focus_mode(); // 0=Auto, 1=manual
1182 #endif
1183 }
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 129 der Datei shooting.c.

130 {
131 #if CAM_PROPSET == 7 || CAM_PROPSET == 9 || CAM_PROPSET == 10 || CAM_PROPSET == 11
132  // PS7 doesn't have _STATE, combines values
134  if(x==1) {
135  return 1;
136  }
137  return 0;
138 #else
140 #endif
141 }
short shooting_get_display_mode ( )

Definiert in Zeile 89 der Datei shooting.c.

short shooting_get_drive_mode ( )

Definiert in Zeile 170 der Datei shooting.c.

171 {
172  // these cameras do not set PROPCASE_DRIVE_MODE when in custom timer mode
173  // SX 200 IS 0,1,2,3,4=Off, 2 Second, Custom, Face Detection
174 #if defined (CAM_DRIVE_MODE_FROM_TIMER_MODE)
176  // note we return this only in custom mode.
177  // Other cameras would return 3 if any timer mode is set (?) even if it doesn't do multiple exposures
178  // note that face detect does multiple exposure
179  if (m == 3)
180  return m;
181 #endif
182 
184 }
short shooting_get_ev_correction1 ( )

Definiert in Zeile 86 der Datei shooting.c.

short shooting_get_ev_correction2 ( )

Definiert in Zeile 87 der Datei shooting.c.

int shooting_get_exif_subject_dist ( )

Definiert in Zeile 91 der Datei shooting.c.

short shooting_get_flash_mode ( )

Definiert in Zeile 84 der Datei shooting.c.

short shooting_get_focus_mode ( )

Definiert in Zeile 85 der Datei shooting.c.

short shooting_get_focus_ok ( )

Definiert in Zeile 165 der Datei shooting.c.

166 {
167  return ((shooting_get_focus_state()!=0) && shooting_in_progress());
168 }
short shooting_get_focus_state ( )

Definiert in Zeile 158 der Datei shooting.c.

159 {
160  if (shooting_get_focus_mode()==1) return -1;
162  return (short) m;
163 }
int shooting_get_hyperfocal_distance ( )

Definiert in Zeile 1140 der Datei shooting.c.

1141 {
1144 }
int shooting_get_hyperfocal_distance_1e3_f ( int  av,
int  fl 
)

Definiert in Zeile 1000 der Datei shooting.c.

1001 {
1002  if ((av>0) && (fl>0) && (camera_info.circle_of_confusion>0))
1003  return (int)(((((double)fl*fl)/(av*camera_info.circle_of_confusion)*1000)+fl)+0.5);
1004  else return (-1);
1005 }
int shooting_get_imager_active ( )

Definiert in Zeile 108 der Datei shooting.c.

108  {
109  extern int imager_active;
110  return imager_active;
111 }
short shooting_get_is_mode ( )

Definiert in Zeile 81 der Datei shooting.c.

short shooting_get_iso_from_sv96 ( short  sv96)

Definiert in Zeile 285 der Datei shooting.c.

286 {
287  // APEX equation --> (int)(POWER(2,(iso/96)) * 3.125) + 0.5)
288  return (short)( (double)pow(2, (((double)sv96)/96.0))*100.0/32.0 + 0.5 );
289 }
short shooting_get_iso_market ( )

Definiert in Zeile 354 der Datei shooting.c.

355 {
357  if (sv == 0)
358  return 0;
359  return shooting_get_iso_from_sv96(sv);
360 }
int shooting_get_iso_mode ( )

Definiert in Zeile 333 der Datei shooting.c.

334 {
335  short isov = shooting_get_canon_iso_mode();
336  long i;
337  for (i=0;i<ISO_SIZE;i++)
338  {
339  if (iso_table[i].prop_id == isov)
340  return iso_table[i].id;
341  }
342  return 0;
343 }
short shooting_get_iso_override_value ( )

Definiert in Zeile 311 der Datei shooting.c.

312 {
313  short iso = conf.iso_override_value; // Start with market value
314  // Apply limits if needed
315 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
316  // Limit max ISO in HQ burst mode (also done in shooting_set_iso_real; but done here so OSD display value is correct)
319 #endif
320 #ifdef CAM_MIN_ISO_OVERRIDE
321  // Limit min (non-zero) ISO
322  // Some cameras will crash if flash used and ISO set lower than this value (most easily tested in AUTO mode)
323  if ((iso > 0) && (iso < CAM_MIN_ISO_OVERRIDE)) iso = CAM_MIN_ISO_OVERRIDE;
324 #endif
325 #ifdef CAM_MAX_ISO_OVERRIDE
326  // Limit max ISO
327  // Some cameras will crash if ISO set higher than this value (dependence on flash is unclear)
329 #endif
330  return shooting_iso_market_to_real(iso); // return real value (after limits applied)
331 }
short shooting_get_iso_real ( )

Definiert in Zeile 345 der Datei shooting.c.

346 {
347  short sv = shooting_get_sv96_real();
348  if (sv == 0)
349  return 0;
350  return shooting_get_iso_from_sv96(sv);
351 }
int shooting_get_lens_to_focal_plane_width ( )

Definiert in Zeile 995 der Datei shooting.c.

996 {
998 }
int shooting_get_luminance ( )

Definiert in Zeile 937 der Datei shooting.c.

938 {
939  short bv = shooting_get_bv96();
940  int b = (int)(100 * K * pow(2.0,((double)(bv-168)/96.0)));
941  return b;
942 }
short shooting_get_max_av96 ( )

Definiert in Zeile 864 der Datei shooting.c.

865 {
866 #if CAM_HAS_IRIS_DIAPHRAGM
867  extern short GetUsableMinAv(void);
869  {
870  return -1;
871  }
872  return GetUsableMinAv();
873 #else
874  return -1;
875 #endif
876 }
short shooting_get_min_av96 ( )

Definiert in Zeile 850 der Datei shooting.c.

851 {
852 #if CAM_HAS_IRIS_DIAPHRAGM
853  extern short GetUsableMaxAv(void);
855  {
856  return -1;
857  }
858  return GetUsableMaxAv();
859 #else
860  return -1;
861 #endif
862 }
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 668 der Datei shooting.c.

short shooting_get_real_focus_mode ( )

Definiert in Zeile 150 der Datei shooting.c.

151 {
152  short f = shooting_get_focus_mode();
154  if (f==0 && m!=0) f=(m==1)?4:m;
155  return f;
156 }
short shooting_get_resolution ( )

Definiert in Zeile 88 der Datei shooting.c.

float shooting_get_shutter_speed_from_tv96 ( short  tv96)

Definiert in Zeile 487 der Datei shooting.c.

488 {
489  return pow(2,((float)(-tv96))/96.0);
490 }
int shooting_get_subject_distance ( )

Definiert in Zeile 1134 der Datei shooting.c.

1135 {
1138 }
int shooting_get_subject_distance_override_value ( )
short shooting_get_sv96_from_iso ( short  iso)

Definiert in Zeile 277 der Datei shooting.c.

278 {
279  // Equivalent to (short)(log2(iso/3.125)*96+0.5) [APEX equation]
280  if (iso > 0)
281  return (short)( log((double)(iso)*32.0/100.0)*96.0*(inv_log_2)+0.5 );
282  return 0;
283 }
short shooting_get_sv96_market ( )

Definiert in Zeile 251 der Datei shooting.c.

short shooting_get_sv96_real ( )

Definiert in Zeile 252 der Datei shooting.c.

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

Definiert in Zeile 471 der Datei shooting.c.

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

Definiert in Zeile 475 der Datei shooting.c.

476 {
477  if (t > 0)
478  {
479  t = ((96.0 * -log(t)) * inv_log_2);
480  if (t < 0)
481  return (short)(t - 0.5);
482  return (short)(t + 0.5);
483  }
484  return SHOOTING_TV96_INVALID;
485 }
short shooting_get_user_av96 ( )

Definiert in Zeile 743 der Datei shooting.c.

744 {
745 #if CAM_HAS_IRIS_DIAPHRAGM
747 #else
748  return 0;
749 #endif
750 }
int shooting_get_user_av_id ( )

Definiert in Zeile 752 der Datei shooting.c.

753 {
754 #if CAM_HAS_IRIS_DIAPHRAGM
755  return aperture_sizes_table[find_nearest_aperture_entry(shooting_get_user_av96())].prop_id;
756 #else
757  return 0;
758 #endif
759 }
short shooting_get_user_tv96 ( )

Definiert in Zeile 564 der Datei shooting.c.

565 {
566 #if CAM_HAS_USER_TV_MODES
568 #else
569  return 0;
570 #endif
571 }
int shooting_get_user_tv_id ( )

Definiert in Zeile 573 der Datei shooting.c.

574 {
575 #if CAM_HAS_USER_TV_MODES
577 #else
578  return 0;
579 #endif
580 }
unsigned int shooting_get_video_recorded_size_kb ( )
int shooting_get_zoom ( )

Definiert in Zeile 186 der Datei shooting.c.

187 {
188  return lens_get_zoom_point();
189 }
int shooting_in_progress ( )

Definiert in Zeile 93 der Datei shooting.c.

void shooting_init ( )

Definiert in Zeile 885 der Datei shooting.c.

886 {
888  iso_init();
889 }
int shooting_is_flash ( )

Definiert in Zeile 92 der Datei shooting.c.

int shooting_is_flash_ready ( )

Definiert in Zeile 1185 der Datei shooting.c.

1186 {
1187  int t = shooting_get_flash_mode();
1188  if ((t != 2) && (shooting_in_progress()))
1189  if (shooting_is_flash())
1190  return IsStrobeChargeCompleted();
1191  return 1;
1192 }
short shooting_is_infinity_distance ( )

Definiert in Zeile 1027 der Datei shooting.c.

1028 {
1029  return (shooting_get_lens_to_focal_plane_width() == 0)?1:0;
1030 }
short shooting_iso_market_to_real ( short  isom)

Definiert in Zeile 291 der Datei shooting.c.

292 {
293  return ISO_MARKET_TO_REAL(isom);
294 }
short shooting_iso_real_to_market ( short  isor)

Definiert in Zeile 296 der Datei shooting.c.

297 {
298  return ISO_REAL_TO_MARKET(isor);
299 }
int shooting_mode_canon2chdk ( int  canonmode)

Definiert in Zeile 958 der Datei shooting.c.

959 {
960  int i;
961  for (i=0; i < MODESCNT; i++)
962  {
963  if (modemap[i].canonmode == canonmode)
964  return modemap[i].hackmode;
965  }
966  return 0;
967 }
int shooting_mode_chdk2canon ( int  hackmode)

Definiert in Zeile 969 der Datei shooting.c.

970 {
971  int i;
972  for (i=0; i < MODESCNT; i++)
973  {
974  if (modemap[i].hackmode == hackmode)
975  return modemap[i].canonmode;
976  }
977  return -1; // 0 is a valid mode on old cameras!
978 }
void shooting_set_av96 ( short  av96,
short  is_now 
)

Definiert in Zeile 733 der Datei shooting.c.

734 {
735 #if CAM_HAS_IRIS_DIAPHRAGM
737  shooting_set_av96_direct(find_canon_aperture(av96), is_now);
738 #endif
739 }
void shooting_set_av96_direct ( short  av96,
short  is_now 
)

Definiert in Zeile 715 der Datei shooting.c.

716 {
717 #if CAM_HAS_IRIS_DIAPHRAGM
719  {
720  if(is_now)
721  {
722  set_property_case(PROPCASE_AV, &av96, sizeof(av96));
723 #ifdef PROPCASE_AV2
724  set_property_case(PROPCASE_AV2, &av96, sizeof(av96)); // Save override to property that will update JPEG header & Canon OSD
725 #endif
726  }
727  else
728  photo_param_put_off.av96 = av96;
729  }
730 #endif
731 }
void shooting_set_focus ( int  v,
short  is_now 
)

Definiert in Zeile 1245 der Datei shooting.c.

1246 {
1247  int s=v;
1249  {
1250  if (is_now && shooting_can_focus())
1251  {
1253  {
1255  }
1256  if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST))
1258  lens_set_focus_pos(s);
1259  }
1260  else
1262  }
1263 }
void shooting_set_iso_mode ( int  v)

Definiert in Zeile 368 der Datei shooting.c.

369 {
370  int i;
371  if (v < 50) // CHDK ID
372  {
373  for (i=0; i<ISO_SIZE; i++)
374  {
375  if (iso_table[i].id == v)
376  {
377  set_iso_mode(i);
378  return;
379  }
380  }
381  }
382  else // ISO value - find nearest entry in iso_table and set iso mode to that value
383  {
384  if (v <= iso_table[0].prop_id) // In case no AUTO (0) entry
385  {
386  set_iso_mode(0);
387  return;
388  }
389  for (i=0; i<ISO_SIZE-1; i++)
390  {
391  if ((v > iso_table[i].prop_id) && (v <= iso_table[i+1].prop_id))
392  {
393  if ((v - iso_table[i].prop_id) < (iso_table[i+1].prop_id - v))
394  set_iso_mode(i);
395  else
396  set_iso_mode(i+1);
397  return;
398  }
399  }
400  set_iso_mode(ISO_SIZE-1);
401  }
402 }
void shooting_set_iso_real ( short  iso,
short  is_now 
)

Definiert in Zeile 427 der Datei shooting.c.

428 {
430  {
431  if (iso > 0)
432  {
433 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
434  // Limit max ISO in HQ burst mode
437 #endif
438 #ifdef CAM_MIN_ISO_OVERRIDE
439  // Limit min (non-zero) ISO
441 #endif
442 #ifdef CAM_MAX_ISO_OVERRIDE
443  // Limit max ISO
445 #endif
447  }
448  }
449 }
int shooting_set_mode_canon ( int  mode)

Definiert in Zeile 1310 der Datei shooting.c.

1311 {
1312  if (canonmode == -1 || !rec_mode_active())
1313  return 0;
1314  SetCurrentCaptureModeType(canonmode);
1315  // updated cached mode information immediately
1316  mode_get();
1317  return 1;
1318 }
int shooting_set_mode_chdk ( int  mode)

Definiert in Zeile 1320 der Datei shooting.c.

1321 {
1323 }
void shooting_set_nd_filter_state ( short  v,
short  is_now 
)

Definiert in Zeile 811 der Datei shooting.c.

812 {
813 #if CAM_HAS_ND_FILTER
815  {
816  if (is_now)
817  {
818 #if defined(CAM_ND_SET_AV_VALUE)
819  short av;
820  get_property_case(PROPCASE_MIN_AV,&av,sizeof(av));
821  if(v==1) {
823  }
824  set_property_case(PROPCASE_AV, &av, sizeof(av));
825 #if defined(PROPCASE_AV2)
826  set_property_case(PROPCASE_AV2, &av, sizeof(av));
827 #endif
828 #endif
829  if (v==1) {
830  PutInNdFilter();
831  }
832  else if (v==2)
833  PutOutNdFilter();
834 #if defined(CAM_HAS_NATIVE_ND_FILTER) && defined(PROPCASE_ND_FILTER_STATE)
835  int n = (v==1) ? 1 : 0;
837 #endif
838  }
839  else
841  }
842 #endif
843 }
void shooting_set_playrec_mode ( int  mode)

Definiert in Zeile 1843 der Datei shooting.c.

1844 {
1845  // use PTP compatible switch if usb bit power detected, and USB remote not configured to use USB
1846  // TODO should just check the USB bit seen by canon firmware (after masking)
1848  {
1850  return;
1851  }
1852  if(mode)
1854  else
1855  levent_set_play();
1856 }
void shooting_set_sv96 ( short  sv96,
short  is_now 
)

Definiert in Zeile 404 der Datei shooting.c.

405 {
407  {
408  if (is_now)
409  {
410  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
411 
412  short iso_mode = shooting_get_canon_iso_mode();
413  if (iso_mode >= 50)
414  shooting_set_iso_mode(0); // Force AUTO mode on camera
415 
416  short dsv96 = sv96 + SV96_MARKET_OFFSET - canon_sv96_base;
417 
418  set_property_case(PROPCASE_SV_MARKET, &canon_sv96_base, sizeof(canon_sv96_base));
419  set_property_case(PROPCASE_SV, &sv96, sizeof(sv96));
420  set_property_case(PROPCASE_DELTA_SV, &dsv96, sizeof(dsv96));
421  }
422  else
423  photo_param_put_off.sv96 = sv96;
424  }
425 }
void shooting_set_tv96 ( short  tv96,
short  is_now 
)

Definiert in Zeile 556 der Datei shooting.c.

557 {
560 }
void shooting_set_tv96_direct ( short  tv96,
short  is_now 
)

Definiert in Zeile 540 der Datei shooting.c.

541 {
543  {
544  if(is_now)
545  {
546  set_property_case(PROPCASE_TV, &tv96, sizeof(tv96));
547 #ifdef PROPCASE_TV2
548  set_property_case(PROPCASE_TV2, &tv96, sizeof(tv96)); // Save override to property that will update JPEG header & Canon OSD
549 #endif
550  }
551  else
552  photo_param_put_off.tv96 = tv96;
553  }
554 }
void shooting_set_user_av96 ( short  av96)

Definiert in Zeile 791 der Datei shooting.c.

792 {
793 #if CAM_HAS_IRIS_DIAPHRAGM
795  {
796  av96 = find_canon_aperture(av96);
797  set_property_case(PROPCASE_USER_AV, &av96, sizeof(av96));
798  }
799 #endif
800 }
void shooting_set_user_av_by_id ( int  v)

Definiert in Zeile 761 der Datei shooting.c.

762 {
763 #if CAM_HAS_IRIS_DIAPHRAGM
764  long i;
766  {
767  for (i=0;i<AS_SIZE;i++)
768  {
769  if (aperture_sizes_table[i].id == v)
770  {
771  short vv = aperture_sizes_table[i].prop_id;
772  set_property_case(PROPCASE_USER_AV, &vv, sizeof(vv));
773  return;
774  }
775  }
776  }
777 #endif
778 }
void shooting_set_user_av_by_id_rel ( int  v)

Definiert in Zeile 780 der Datei shooting.c.

781 {
782 #if CAM_HAS_IRIS_DIAPHRAGM
784  {
785  int cv = shooting_get_user_av_id();
787  }
788 #endif
789 }
void shooting_set_user_tv96 ( short  tv96)

Definiert in Zeile 612 der Datei shooting.c.

613 {
614 #if CAM_HAS_USER_TV_MODES
616  {
617  tv96 = find_canon_shutter_speed(tv96);
618  set_property_case(PROPCASE_USER_TV, &tv96, sizeof(tv96));
619  }
620 #endif
621 }
void shooting_set_user_tv_by_id ( int  v)

Definiert in Zeile 582 der Datei shooting.c.

583 {
584 #if CAM_HAS_USER_TV_MODES
586  {
587  long i;
588  for (i=0;i<SS_SIZE;i++)
589  {
590  if (shutter_speeds_table[i].id == v)
591  {
592  short vv = shutter_speeds_table[i].prop_id;
593  set_property_case(PROPCASE_USER_TV, &vv, sizeof(vv));
594  return;
595  }
596  }
597  }
598 #endif
599 }
void shooting_set_user_tv_by_id_rel ( int  v)

Definiert in Zeile 601 der Datei shooting.c.

602 {
603 #if CAM_HAS_USER_TV_MODES
605  {
606  int cv = shooting_get_user_tv_id();
608  }
609 #endif
610 }
void shooting_set_zoom ( int  v)

Definiert in Zeile 1207 der Datei shooting.c.

1208 {
1210  {
1211 #if CAM_REFOCUS_AFTER_ZOOM
1212  int dist = shooting_get_subject_distance();
1214 #if defined(CAM_NEED_SET_ZOOM_DELAY)
1216 #endif
1217  shooting_set_focus(dist, SET_NOW);
1218 #else // CAM_REFOCUS_AFTER_ZOOM
1220 #endif // CAM_REFOCUS_AFTER_ZOOM
1221  }
1222 }
void shooting_set_zoom_rel ( int  v)

Definiert in Zeile 1224 der Datei shooting.c.

1225 {
1226  int cv = shooting_get_zoom();
1228  {
1229  shooting_set_zoom(cv+v);
1230  }
1231 }
void shooting_set_zoom_speed ( int  v)

Definiert in Zeile 1233 der Datei shooting.c.

1233  {
1235  {
1237  }
1238 }
short shooting_sv96_market_to_real ( short  isom)

Definiert in Zeile 301 der Datei shooting.c.

302 {
303  return sv96 - SV96_MARKET_OFFSET;
304 }
short shooting_sv96_real_to_market ( short  isor)

Definiert in Zeile 306 der Datei shooting.c.

307 {
308  return sv96 + SV96_MARKET_OFFSET;
309 }
void shooting_update_dof_values ( )

Definiert in Zeile 1048 der Datei shooting.c.

1049 {
1050  int hyp, hyp_1e3, av_1e3, v;
1051  int dist = shooting_get_subject_distance_();
1052  int zoom_point = lens_get_zoom_point();
1053  int fl = get_focal_length(zoom_point);
1054  short f_focus_ok = shooting_get_focus_ok();
1055  short f_hyp_calc = 0, f_dist_calc = 0;
1056  short min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];
1057  short av96 = shooting_get_user_av96();
1058  short curr_av96 = shooting_get_current_av96();
1059  short prop_av96 = shooting_get_av96();
1060  short min_av96;
1061 
1062  if (!min_av96_zoom_point_tbl) {
1063  min_av96_zoom_point_tbl = (short *) malloc(zoom_points * sizeof(short));
1065  memset(min_av96_zoom_point_tbl, 0, zoom_points * sizeof(short));
1066  min_av96_zoom_point = 0;
1067  }
1068  } else min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];
1069 
1070  if (min_av96_zoom_point==0 && shooting_in_progress()) {
1071  get_property_case(PROPCASE_MIN_AV, &min_av96, sizeof(min_av96));
1072  min_av96_zoom_point_tbl[zoom_point] = min_av96;
1073  }
1074 
1075  if ((camera_info.state.mode_shooting==MODE_M || camera_info.state.mode_shooting==MODE_AV) && (av96>0) && !f_focus_ok) {
1076  if (av96 < min_av96_zoom_point) av96 = min_av96_zoom_point;
1077  }
1078  else av96 = (abs(curr_av96-prop_av96)<2)?prop_av96:curr_av96;
1079 
1080  av_1e3 = shooting_get_aperture_from_av96(av96);
1083 
1084  if (camera_info.dof_values.aperture_value!=av_1e3 || camera_info.dof_values.focal_length!=fl || (hyp_1e3<0)) {
1085  //calc new hyperfocal distance and min stack distance
1086  f_hyp_calc = 1;
1087  hyp_1e3 = -1;
1088  hyp = -1;
1091  hyp_1e3 = shooting_get_hyperfocal_distance_1e3_f(av_1e3, fl);
1092  if (hyp_1e3>0) {
1093  hyp = (hyp_1e3+500)/1000;
1095  v = ((hyp_1e3 - fl)/250 + 2 + 1)/2;
1096  if (v>0) {
1097  int m = ((fl*((fl - hyp_1e3)/1000 - 1)/500)/v + 1)/2;
1098  int m2 = (int)((((double)hyp*(2*fl - hyp_1e3)/1000))/v + 0.5);
1100  }
1101  }
1102  }
1103 
1104  if ((camera_info.dof_values.subject_distance!=dist || (camera_info.dof_values.hyperfocal_distance_1e3!=hyp_1e3)) && (hyp_1e3>0)) {
1105  //calc new NEAR, FAR, DOF values
1106  f_dist_calc = 1;
1111  if ((av_1e3>0) && (fl>0) && (dist>0) && (shooting_is_infinity_distance()==0) && (hyp_1e3>0)) {
1112  double m = ((double)(hyp_1e3 - fl)/1000 * dist) + 0.5;
1115  } else {
1116  int v = ((((hyp_1e3 - 2*fl + 1000*dist)/500) + 1)/2);
1117  if (v>0) camera_info.dof_values.near_limit = (int)(m/v);
1118  }
1119  int v = ((((hyp_1e3 - 1000*dist)/500) + 1)/2);
1120  if (v>0) camera_info.dof_values.far_limit = (int)(m/v);
1123  }
1124  }
1125  }
1128  f_focus_ok = (f_focus_ok && shooting_get_focus_ok());
1131  return;
1132 }
void shooting_video_bitrate_change ( int  v)

Definiert in Zeile 1265 der Datei shooting.c.

1266 {
1267 #if CAM_CHDK_HAS_EXT_VIDEO_MENU
1268  int m[]={1,2,3,4,5,6,7,8,10,12}; // m[v]/4 = bitrate*1x
1269  if (v>=(sizeof(m)/sizeof(m[0])))
1270  v=(sizeof(m)/sizeof(m[0]))-1;
1271  change_video_tables(m[v],4);
1272 #endif
1273 }
void shooting_video_minbitrate_change ( int  )
void UnlockAE ( void  )

Definiert in Zeile 1212 der Datei wrappers.c.

1213 {
1215  {
1216  _UnlockAE();
1217  }
1218 }

Variablen-Dokumentation

int recreview_hold
const int zoom_points

Definiert in Zeile 43 der Datei main.c.

int zoom_status