CHDK_DE Vorschauversion  Trunk Rev. 5456
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
shooting.c-Dateireferenz
#include "platform.h"
#include "keyboard.h"
#include "math.h"
#include "stdlib.h"
#include "conf.h"
#include "histogram.h"
#include "usb_remote.h"
#include "autoiso.h"
#include "levent.h"
#include "script_api.h"
+ Include-Abhängigkeitsdiagramm für shooting.c:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  PHOTO_PARAM
 

Makrodefinitionen

#define PHOTO_PARAM_TV_NONE   32767
 
#define SV96_MARKET_OFFSET   69
 
#define ISO_MARKET_TO_REAL_MULT   9955
 
#define ISO_MARKET_TO_REAL_SHIFT   14
 
#define ISO_MARKET_TO_REAL_ROUND   8192
 
#define ISO_REAL_TO_MARKET_MULT   3371
 
#define ISO_REAL_TO_MARKET_SHIFT   11
 
#define ISO_REAL_TO_MARKET_ROUND   1024
 
#define ISO_MARKET_TO_REAL(x)   (((int)x * ISO_MARKET_TO_REAL_MULT + ISO_MARKET_TO_REAL_ROUND) >> ISO_MARKET_TO_REAL_SHIFT)
 
#define ISO_REAL_TO_MARKET(x)   (((int)x * ISO_REAL_TO_MARKET_MULT + ISO_REAL_TO_MARKET_ROUND) >> ISO_REAL_TO_MARKET_SHIFT)
 
#define tv_override_zero_shift   18
 
#define AV96_MIN   (aperture_sizes_table[0].prop_id)
 
#define AV96_MAX   (aperture_sizes_table[AS_SIZE-1].prop_id)
 

Funktionen

int rec_mode_active (void)
 
void shooting_update_state (void)
 
int shooting_get_prop (int id)
 
static int shooting_get_prop_int (int id)
 
void shooting_set_prop (int id, int v)
 
short shooting_get_is_mode ()
 
short shooting_get_bv96 ()
 
short shooting_get_canon_overexposure_value ()
 
short shooting_get_flash_mode ()
 
short shooting_get_focus_mode ()
 
short shooting_get_ev_correction1 ()
 
short shooting_get_ev_correction2 ()
 
short shooting_get_resolution ()
 
short shooting_get_display_mode ()
 
int shooting_get_exif_subject_dist ()
 
int shooting_is_flash ()
 
int shooting_in_progress ()
 
int shooting_get_canon_raw_enabled ()
 
int shooting_get_imager_active ()
 
int shooting_get_digital_zoom_state (void)
 
short shooting_get_real_focus_mode ()
 
short shooting_get_focus_state ()
 
short shooting_get_focus_ok ()
 
short shooting_get_drive_mode ()
 
int shooting_get_zoom ()
 
short shooting_get_canon_iso_mode ()
 
short shooting_get_sv96_market ()
 
short shooting_get_sv96_real ()
 
short shooting_get_sv96_delta ()
 
short shooting_get_sv96_from_iso (short iso)
 
short shooting_get_iso_from_sv96 (short sv96)
 
short shooting_iso_market_to_real (short isom)
 
short shooting_iso_real_to_market (short isor)
 
short shooting_sv96_market_to_real (short sv96)
 
short shooting_sv96_real_to_market (short sv96)
 
short shooting_get_iso_override_value ()
 
int shooting_get_iso_mode ()
 
short shooting_get_iso_real ()
 
short shooting_get_iso_market ()
 
static void set_iso_mode (int i)
 
void shooting_set_iso_mode (int v)
 
void shooting_set_sv96 (short sv96, short is_now)
 
void shooting_set_iso_real (short iso, short is_now)
 
static void iso_init ()
 
short shooting_get_tv96 ()
 
short shooting_get_tv96_from_shutter_speed (float t)
 
float shooting_get_shutter_speed_from_tv96 (short tv96)
 
static int shooting_get_tv96_override_value ()
 
static int find_nearest_shutter_speed_entry (short tv96)
 
static short find_canon_shutter_speed (short tv96)
 
void shooting_set_tv96_direct (short tv96, short is_now)
 
void shooting_set_tv96 (short tv96, short is_now)
 
short shooting_get_user_tv96 ()
 
int shooting_get_user_tv_id ()
 
void shooting_set_user_tv_by_id (int v)
 
void shooting_set_user_tv_by_id_rel (int v)
 
void shooting_set_user_tv96 (short tv96)
 
short shooting_get_av96 ()
 
short shooting_get_aperture_sizes_table_size ()
 
int shooting_get_aperture_from_av96 (short av96)
 
short shooting_get_av96_from_aperture (int aperture)
 
short shooting_get_av96_override_value ()
 
int shooting_get_real_aperture ()
 
static int shooting_get_min_real_aperture ()
 
void shooting_set_av96_direct (short av96, short is_now)
 
void shooting_set_av96 (short av96, short is_now)
 
short shooting_get_user_av96 ()
 
int shooting_get_user_av_id ()
 
void shooting_set_user_av_by_id (int v)
 
void shooting_set_user_av_by_id_rel (int v)
 
void shooting_set_user_av96 (short av96)
 
void shooting_set_nd_filter_state (short v, short is_now)
 
short shooting_get_min_av96 ()
 
short shooting_get_max_av96 ()
 
void shooting_init ()
 
long get_file_counter ()
 
long get_exposure_counter ()
 
void get_target_dir_name (char *dir)
 
int shooting_get_luminance ()
 
int shooting_get_subject_distance_override_value ()
 
int shooting_mode_canon2chdk (int canonmode)
 
int shooting_mode_chdk2canon (int hackmode)
 
int sd_over_modes ()
 
int shooting_get_lens_to_focal_plane_width ()
 
int shooting_get_hyperfocal_distance_1e3_f (int av, int fl)
 
int shooting_get_near_limit_f (int s, int av, int fl)
 
int shooting_get_far_limit_f (int s, int av, int fl)
 
short shooting_is_infinity_distance ()
 
int shooting_get_canon_subject_distance ()
 
int shooting_get_subject_distance_ ()
 
void shooting_update_dof_values ()
 
int shooting_get_subject_distance ()
 
int shooting_get_hyperfocal_distance ()
 
short shooting_can_focus ()
 
short shooting_get_common_focus_mode ()
 
int shooting_is_flash_ready ()
 
void shooting_set_zoom (int v)
 
void shooting_set_zoom_rel (int v)
 
void shooting_set_zoom_speed (int v)
 
void set_focus_bypass (int m)
 
void shooting_set_focus (int v, short is_now)
 
void shooting_video_bitrate_change (int v)
 
void unlock_optical_zoom (void)
 
int shooting_set_mode_canon (int canonmode)
 
int shooting_set_mode_chdk (int mode)
 
static void shooting_tv_bracketing (int when)
 
static void shooting_av_bracketing (int when)
 
static void shooting_iso_bracketing (int when)
 
static void shooting_subject_distance_bracketing (int when)
 
void bracketing_reset ()
 
void bracketing_step (int when)
 
void shooting_bracketing (void)
 
int captseq_hack_override_active ()
 
void set_movie_status (int status)
 
int get_movie_status ()
 
int is_video_recording ()
 
int mode_is_video (int m)
 
int __attribute__ ((weak))
 
int mode_get (void)
 
static void shooting_set_flash_override ()
 
void shooting_expo_param_override_thumb (void)
 
void shooting_expo_iso_override_thumb (void)
 
void shooting_set_playrec_mode (int mode)
 

Variablen

volatile long focus_busy
 
long playrec_mode
 
const ShutterSpeed shutter_speeds_table []
 
const unsigned int SS_SIZE
 
const ApertureSize aperture_sizes_table []
 pt=require'extras/proptools' Mehr ...
 
const unsigned int AS_SIZE
 
const CapturemodeMap modemap []
 
const unsigned int MODESCNT
 
static short * min_av96_zoom_point_tbl = NULL
 
static PHOTO_PARAM photo_param_put_off
 
static int iso_override_mode_save = 0
 
static const double inv_log_2 = 1.44269504088906
 
const ISOTable iso_table []
 
const unsigned int ISO_SIZE
 
static short canon_iso_base =0
 
static short canon_sv96_base =0
 
const unsigned int param_file_counter
 
static const double K = 12.5
 
static int focus_interlock_bypass = 0
 
EXPO_BRACKETING_VALUES bracketing
 
static int bracket_steps [4][2]
 
static int bracket_delta [4][2]
 
int movie_status
 

Makro-Dokumentation

#define AV96_MAX   (aperture_sizes_table[AS_SIZE-1].prop_id)

Definiert in Zeile 688 der Datei shooting.c.

#define AV96_MIN   (aperture_sizes_table[0].prop_id)

Definiert in Zeile 687 der Datei shooting.c.

#define ISO_MARKET_TO_REAL (   x)    (((int)x * ISO_MARKET_TO_REAL_MULT + ISO_MARKET_TO_REAL_ROUND) >> ISO_MARKET_TO_REAL_SHIFT)

Definiert in Zeile 317 der Datei shooting.c.

#define ISO_MARKET_TO_REAL_MULT   9955

Definiert in Zeile 309 der Datei shooting.c.

#define ISO_MARKET_TO_REAL_ROUND   8192

Definiert in Zeile 311 der Datei shooting.c.

#define ISO_MARKET_TO_REAL_SHIFT   14

Definiert in Zeile 310 der Datei shooting.c.

#define ISO_REAL_TO_MARKET (   x)    (((int)x * ISO_REAL_TO_MARKET_MULT + ISO_REAL_TO_MARKET_ROUND) >> ISO_REAL_TO_MARKET_SHIFT)

Definiert in Zeile 318 der Datei shooting.c.

#define ISO_REAL_TO_MARKET_MULT   3371

Definiert in Zeile 312 der Datei shooting.c.

#define ISO_REAL_TO_MARKET_ROUND   1024

Definiert in Zeile 314 der Datei shooting.c.

#define ISO_REAL_TO_MARKET_SHIFT   11

Definiert in Zeile 313 der Datei shooting.c.

#define PHOTO_PARAM_TV_NONE   32767

Definiert in Zeile 39 der Datei shooting.c.

#define SV96_MARKET_OFFSET   69

Definiert in Zeile 304 der Datei shooting.c.

#define tv_override_zero_shift   18

Definiert in Zeile 543 der Datei shooting.c.

Dokumentation der Funktionen

int __attribute__ ( (weak)  )

Definiert in Zeile 1659 der Datei shooting.c.

1660 {
1661  return (playrec_mode==2 || playrec_mode==4 || playrec_mode==5);
1662 }
void bracketing_reset ( )

Definiert in Zeile 1508 der Datei shooting.c.

void bracketing_step ( int  when)

Definiert in Zeile 1515 der Datei shooting.c.

int captseq_hack_override_active ( )

Definiert in Zeile 1543 der Datei shooting.c.

1544 {
1547  return 1;
1548 #if CAM_HAS_IRIS_DIAPHRAGM
1550  return 1;
1551 #endif
1552  }
1553  if(conf.override_disable==1)
1554  return 0;
1556  return 1;
1558  return 1;
1559 #if CAM_HAS_IRIS_DIAPHRAGM
1561  return 1;
1562 #endif
1563  return 0;
1564 }
static short find_canon_shutter_speed ( short  tv96)
static

Definiert in Zeile 582 der Datei shooting.c.

static int find_nearest_shutter_speed_entry ( short  tv96)
static

Definiert in Zeile 561 der Datei shooting.c.

562 {
563  if (tv96 <= shutter_speeds_table[0].prop_id)
564  return 0;
565 
566  int i;
567  for (i=0; i<SS_SIZE-1; i++)
568  {
569  if ((tv96 > shutter_speeds_table[i].prop_id) && (tv96 <= shutter_speeds_table[i+1].prop_id))
570  {
571  if ((tv96 - shutter_speeds_table[i].prop_id) < (shutter_speeds_table[i+1].prop_id - tv96))
572  return i;
573  else
574  return i+1;
575  }
576  }
577 
578  return SS_SIZE-1;
579 }
long get_exposure_counter ( )

Definiert in Zeile 963 der Datei shooting.c.

964 {
965  long v = 0;
967  v = ((v>>4)&0x3FFF);
968  return v;
969 }
long get_file_counter ( )

Definiert in Zeile 956 der Datei shooting.c.

957 {
958  long v = 0;
960  return v;
961 }
int get_movie_status ( )

Definiert in Zeile 1601 der Datei shooting.c.

1602 {
1603 #ifndef CAM_SIMPLE_MOVIE_STATUS
1604  return movie_status;
1605 #else
1606  // firmware movie_status interpreted as: zero - not recording, nonzero - recording
1607  return simple_movie_status?VIDEO_RECORD_IN_PROGRESS:VIDEO_RECORD_STOPPED;
1608 #endif
1609 }
void get_target_dir_name ( char *  dir)

Definiert in Zeile 973 der Datei shooting.c.

973  {
974  extern long get_target_dir_num();
975  sprintf(dir,"A/DCIM/%03dCANON",get_target_dir_num());
976 }
int is_video_recording ( )

Definiert in Zeile 1612 der Datei shooting.c.

1613 {
1614 #ifndef CAM_SIMPLE_MOVIE_STATUS
1615 #if defined(CAM_HAS_MOVIE_DIGEST_MODE)
1616  // If camera has movie digest mode then movie_status values are different than previous models
1617  // 'movie_status' values
1618  // 0 - after startup
1619  // 1 - movie recording stopped
1620  // 4 - movie recording in progress, or in 'movie digest' scene mode
1621  // 5 - movie recording stopping
1622  // 6 - in video mode, not recording
1624 #else
1625  // 'movie_status' values
1626  // 0 - after startup
1627  // 1 - movie recording stopped
1628  // 4 - movie recording in progress
1629  // 5 - movie recording stopping
1630  return (movie_status > 1);
1631 #endif
1632 #else // CAM_SIMPLE_MOVIE_STATUS
1633  return (simple_movie_status!=0);
1634 #endif
1635 }
static void iso_init ( )
static

Definiert in Zeile 498 der Datei shooting.c.

499 {
500  // Get the camera ISO base value, store in global variable 'canon_iso_base'
501  if (iso_table[1-iso_table[0].id].prop_id == 50)
502  canon_iso_base = 50;
503  else
505 
506  // Get the SV96 value corresponding to the base Canon ISO for the camera
507  // Store in global variable 'canon_sv96_base'
509 }
int mode_get ( void  )

Definiert in Zeile 1664 der Datei shooting.c.

1665 {
1666  int mode, t=0xFF;
1667 
1668  mode = (rec_mode_active())?MODE_REC:MODE_PLAY;
1669 
1670 #ifdef CAM_SWIVEL_SCREEN
1671  extern int screen_opened(void); // 0 not open, non-zero open
1672  extern int screen_rotated(void); // 0 not rotated, non-zero rotated
1673 
1674  mode |= (screen_opened())?MODE_SCREEN_OPENED:0;
1675  mode |= (screen_rotated())?MODE_SCREEN_ROTATED:0;
1676 #endif
1677 
1678 #ifdef CAM_SUPPORT_BITMAP_RES_CHANGE
1679  extern void update_screen_dimensions();
1681 #endif
1682 
1684 #ifdef CAM_MASK_VID_REC_ACTIVE
1686 #else
1687  mode |= shooting_mode_canon2chdk(t);
1688 #endif
1689 
1690  // Set camera state variables from mode info
1694  camera_info.state.mode_rec = ((mode & MODE_MASK) == MODE_REC);
1696  camera_info.state.mode_play = ((mode & MODE_MASK) == MODE_PLAY);
1698 
1699  return (mode);
1700 }
int mode_is_video ( int  m)

Definiert in Zeile 1638 der Datei shooting.c.

1639 {
1640  m = m & MODE_SHOOTING_MASK;
1641  return (m==MODE_VIDEO_STD ||
1642  m==MODE_VIDEO_SPEED ||
1643  m==MODE_VIDEO_COMPACT ||
1650  m==MODE_VIDEO_M ||
1653  // not clear if this should be considered a video mode ?
1654  // m==MODE_VIDEO_MOVIE_DIGEST
1655  );
1656 }
int rec_mode_active ( void  )

Definiert in Zeile 221 der Datei main.c.

221  {
222 // return ((physw_status[0]&0x03)==0x01) ? 0 : 1;
223  return (playrec_mode==1); //(0 in play, 1 in record, 2 in record review)
224 }
int sd_over_modes ( void  )

Definiert in Zeile 1029 der Datei shooting.c.

1030 { return ( 0
1031 #ifdef CAM_SD_OVER_IN_AF
1032  + 1
1033 #endif
1034 #ifdef CAM_SD_OVER_IN_AFL
1035  + 2
1036 #endif
1037 #ifdef CAM_SD_OVER_IN_MF
1038  + 4
1039 #endif
1040 ); }
void set_focus_bypass ( int  m)

Definiert in Zeile 1294 der Datei shooting.c.

1295 {
1297 }
static void set_iso_mode ( int  i)
static

Definiert in Zeile 405 der Datei shooting.c.

406 {
407  short vv = iso_table[i].prop_id;
408  set_property_case(PROPCASE_ISO_MODE, &vv, sizeof(vv));
409 }
void set_movie_status ( int  status)

Definiert in Zeile 1572 der Datei shooting.c.

1573 {
1574 #ifndef CAM_SIMPLE_MOVIE_STATUS
1575  switch(status)
1576  {
1577  case 1:
1579  {
1581  }
1582  break;
1583  case 2:
1585  {
1587  }
1588  break;
1589  case 3:
1591  {
1593  }
1594  break;
1595  }
1596 #else // CAM_SIMPLE_MOVIE_STATUS
1597  // no known way to control the recording process
1598 #endif
1599 }
static void shooting_av_bracketing ( int  when)
static

Definiert in Zeile 1432 der Datei shooting.c.

1433 {
1434  // first shot? (actually this is called just after the first shot has been taken)
1435  if (bracketing.shoot_counter == 0)
1436  {
1439  else
1442  }
1443 
1444  // Adjust delta AV value for shot based on shot number
1446  // Calculate new AV (note, need to subtract delta because higher values are smaller apertures / darker images)
1448 
1449  // Inc for next shot
1451 
1452  // Apply value for next shot to be taken
1453  if (value != bracketing.av96)
1454  {
1455  shooting_set_av96_direct(value, when);
1456 #ifdef CAM_AV_OVERRIDE_IRIS_FIX
1457  extern int MoveIrisWithAv(short*);
1458  MoveIrisWithAv(&value);
1459 #endif
1460  }
1461 }
void shooting_bracketing ( void  )

Definiert in Zeile 1523 der Datei shooting.c.

short shooting_can_focus ( )

Definiert in Zeile 1202 der Datei shooting.c.

1203 {
1204  if(camera_info.state.mode_play) return 0 ; // don't focus in playback mode
1205 
1206  if(focus_interlock_bypass) return 1; // checks disabled, allow
1207 
1208  if( camera_info.state.mode_video == 1) return 1; // FIXME : default to MF enabled in video mode for now
1209 
1210 #ifdef CAM_SD_OVER_IN_AFL
1211  if (shooting_get_prop(PROPCASE_AF_LOCK)==1 ) return 1; // allow focus if AFL enabled and camera can focus that way?
1212 #endif
1213 #ifdef CAM_SD_OVER_IN_MF
1214  if (shooting_get_prop(PROPCASE_FOCUS_MODE)==1 ) return 1; // allow focus if MF enabled and camera can focus that way?
1215 #endif
1216 
1217 #ifdef CAM_SD_OVER_IN_AF
1218 #ifdef PROPCASE_CONTINUOUS_AF
1219  if (shooting_get_prop(PROPCASE_CONTINUOUS_AF)) return 0; // don't focus in continuous AF mode,
1220 #endif
1221 #ifdef PROPCASE_SERVO_AF
1222  if (shooting_get_prop(PROPCASE_SERVO_AF)) return 0; // don't focus in servo AF mode
1223 #endif
1224  if ( (shooting_get_prop(PROPCASE_AF_LOCK)==0) // allow focus when in AF mode (i.e AFL or MF not enabled)?
1225  && (shooting_get_prop(PROPCASE_FOCUS_MODE)==0 )) return 1;
1226 #endif
1227  return 0;
1228 }
void shooting_expo_iso_override_thumb ( void  )

Definiert in Zeile 1862 der Datei shooting.c.

1863 {
1865  {
1867  // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override
1868  }
1869  else if (is_iso_override_enabled)
1873 
1874 #if defined(CAM_HAS_ND_FILTER) && defined(CAM_HAS_NATIVE_ND_FILTER)
1876  {
1878  //photo_param_put_off.nd_filter=0;
1879  }
1880  else if (conf.nd_filter_state && !(conf.override_disable==1))
1882 #endif
1883 
1884  // Set flash mode & override
1886 }
void shooting_expo_param_override_thumb ( void  )

Definiert in Zeile 1796 der Datei shooting.c.

1797 {
1799  {
1802  }
1803  else if (is_tv_override_enabled)
1804  {
1806  }
1807 
1809  {
1812  }
1813  else if (is_iso_override_enabled)
1817 
1819  {
1822  }
1823  else if (is_av_override_enabled)
1825 
1827  {
1830  }
1831  else if (is_sd_override_enabled)
1833 
1834 #if CAM_HAS_ND_FILTER
1836  {
1839  }
1840  else if (conf.nd_filter_state && !(conf.override_disable==1))
1842 #endif
1843 
1844 #if CAM_REAR_CURTAIN
1845  shooting_set_flash_sync_curtain(conf.flash_sync_curtain);
1846 #endif
1847 
1848  // Set flash mode & override
1850 
1851 #if CAM_QUALITY_OVERRIDE
1852  // this doesn't really need to be set in the override hook.
1853  // should only need to be set once if the users doesn't change back, but doing it here ensures it is set
1854  shooting_set_image_quality(conf.fast_image_quality);
1855 #endif
1856 
1858 }
int shooting_get_aperture_from_av96 ( short  av96)

Definiert in Zeile 695 der Datei shooting.c.

696 {
697  if (av96)
698  return (short)((pow(2, ((double)av96)/192.0))*1000.0 + 0.5);
699  return -1;
700 }
short shooting_get_aperture_sizes_table_size ( )

Definiert in Zeile 691 der Datei shooting.c.

691 { return AS_SIZE; }
short shooting_get_av96 ( )

Definiert in Zeile 690 der Datei shooting.c.

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

Definiert in Zeile 702 der Datei shooting.c.

703 {
704  return (int)((log((double)aperture/1000.0) * 192 * inv_log_2) + 0.5);
705 }
short shooting_get_av96_override_value ( )

Definiert in Zeile 708 der Datei shooting.c.

709 {
712  return (short) (AV96_MAX+32*(conf.av_override_value-AS_SIZE+1));
713 }
short shooting_get_bv96 ( )

Definiert in Zeile 125 der Datei shooting.c.

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

Definiert in Zeile 293 der Datei shooting.c.

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 }
int shooting_get_canon_subject_distance ( )

Definiert in Zeile 1079 der Datei shooting.c.

1080 {
1083  else
1084  return (lens_get_focus_pos_from_lens());
1085 }
short shooting_get_common_focus_mode ( )

Definiert in Zeile 1230 der Datei shooting.c.

1231 {
1232 #if !CAM_HAS_MANUAL_FOCUS
1233  return conf.subj_dist_override_koef; // SD override state 0=OFF, 1=ON, 2=Infinity if camera has no native MF mode
1234 #else
1235  return shooting_get_focus_mode(); // 0=Auto, 1=manual
1236 #endif
1237 }
int shooting_get_digital_zoom_state ( void  )

Definiert in Zeile 172 der Datei shooting.c.

173 {
174 #if CAM_PROPSET == 7 || CAM_PROPSET == 9 || CAM_PROPSET == 10 || CAM_PROPSET == 11 || CAM_PROPSET == 12
175  // PS7 doesn't have _STATE, combines values
177  if(x==1) {
178  return 1;
179  }
180  return 0;
181 #else
183 #endif
184 }
short shooting_get_display_mode ( )

Definiert in Zeile 132 der Datei shooting.c.

short shooting_get_drive_mode ( )

Definiert in Zeile 213 der Datei shooting.c.

214 {
215  // these cameras do not set PROPCASE_DRIVE_MODE when in custom timer mode
216  // SX 200 IS 0,1,2,3,4=Off, 2 Second, Custom, Face Detection
217 #if defined (CAM_DRIVE_MODE_FROM_TIMER_MODE)
219  // note we return this only in custom mode.
220  // Other cameras would return 3 if any timer mode is set (?) even if it doesn't do multiple exposures
221  // note that face detect does multiple exposure
222  if (m == 3)
223  return m;
224 #endif
225 
227 }
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.

int shooting_get_far_limit_f ( int  s,
int  av,
int  fl 
)

Definiert in Zeile 1064 der Datei shooting.c.

1065 {
1066  if (shooting_is_infinity_distance()) return (-1);
1067  int h_1e3 = shooting_get_hyperfocal_distance_1e3_f(av, fl);
1068  double m = ((double)(h_1e3 - fl)+500)/1000*s;
1069  int v = ((h_1e3 - 1000*s)+500)/1000;
1070  if ((m>0) && (v>0)) return (int)((2*m/v+1)/2);
1071  else return (-1);
1072 }
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 208 der Datei shooting.c.

209 {
210  return ((shooting_get_focus_state()!=0) && shooting_in_progress());
211 }
short shooting_get_focus_state ( )

Definiert in Zeile 201 der Datei shooting.c.

202 {
203  if (shooting_get_focus_mode()==1) return -1;
205  return (short) m;
206 }
int shooting_get_hyperfocal_distance ( )

Definiert in Zeile 1194 der Datei shooting.c.

1195 {
1198 }
int shooting_get_hyperfocal_distance_1e3_f ( int  av,
int  fl 
)

Definiert in Zeile 1047 der Datei shooting.c.

1048 {
1049  if ((av>0) && (fl>0) && (camera_info.circle_of_confusion>0))
1050  return (int)(((((double)fl*fl)/(av*camera_info.circle_of_confusion)*1000)+fl)+0.5);
1051  else return (-1);
1052 }
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 328 der Datei shooting.c.

329 {
330  // APEX equation --> (int)(POWER(2,(iso/96)) * 3.125) + 0.5)
331  return (short)( (double)pow(2, (((double)sv96)/96.0))*100.0/32.0 + 0.5 );
332 }
short shooting_get_iso_market ( )

Definiert in Zeile 397 der Datei shooting.c.

398 {
400  if (sv == 0)
401  return 0;
402  return shooting_get_iso_from_sv96(sv);
403 }
int shooting_get_iso_mode ( )

Definiert in Zeile 376 der Datei shooting.c.

377 {
378  short isov = shooting_get_canon_iso_mode();
379  long i;
380  for (i=0;i<ISO_SIZE;i++)
381  {
382  if (iso_table[i].prop_id == isov)
383  return iso_table[i].id;
384  }
385  return 0;
386 }
short shooting_get_iso_override_value ( )

Definiert in Zeile 354 der Datei shooting.c.

355 {
356  short iso = conf.iso_override_value; // Start with market value
357  // Apply limits if needed
358 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
359  // Limit max ISO in HQ burst mode (also done in shooting_set_iso_real; but done here so OSD display value is correct)
362 #endif
363 #ifdef CAM_MIN_ISO_OVERRIDE
364  // Limit min (non-zero) ISO
365  // Some cameras will crash if flash used and ISO set lower than this value (most easily tested in AUTO mode)
366  if ((iso > 0) && (iso < CAM_MIN_ISO_OVERRIDE)) iso = CAM_MIN_ISO_OVERRIDE;
367 #endif
368 #ifdef CAM_MAX_ISO_OVERRIDE
369  // Limit max ISO
370  // Some cameras will crash if ISO set higher than this value (dependence on flash is unclear)
372 #endif
373  return shooting_iso_market_to_real(iso); // return real value (after limits applied)
374 }
short shooting_get_iso_real ( )

Definiert in Zeile 388 der Datei shooting.c.

389 {
390  short sv = shooting_get_sv96_real();
391  if (sv == 0)
392  return 0;
393  return shooting_get_iso_from_sv96(sv);
394 }
int shooting_get_lens_to_focal_plane_width ( )

Definiert in Zeile 1042 der Datei shooting.c.

1043 {
1045 }
int shooting_get_luminance ( )

Definiert in Zeile 984 der Datei shooting.c.

985 {
986  short bv = shooting_get_bv96();
987  int b = (int)(100 * K * pow(2.0,((double)(bv-168)/96.0)));
988  return b;
989 }
short shooting_get_max_av96 ( )

Definiert in Zeile 911 der Datei shooting.c.

912 {
913 #if CAM_HAS_IRIS_DIAPHRAGM
914  extern short GetUsableMinAv(void);
916  {
917  return -1;
918  }
919  return GetUsableMinAv();
920 #else
921  return -1;
922 #endif
923 }
short shooting_get_min_av96 ( )

Definiert in Zeile 897 der Datei shooting.c.

898 {
899 #if CAM_HAS_IRIS_DIAPHRAGM
900  extern short GetUsableMaxAv(void);
902  {
903  return -1;
904  }
905  return GetUsableMaxAv();
906 #else
907  return -1;
908 #endif
909 }
static int shooting_get_min_real_aperture ( )
static

Definiert in Zeile 720 der Datei shooting.c.

721 {
722  short av96;
723  get_property_case(PROPCASE_MIN_AV, &av96, sizeof(av96));
724  if (av96)
725  return shooting_get_aperture_from_av96(av96);
727 }
int shooting_get_near_limit_f ( int  s,
int  av,
int  fl 
)

Definiert in Zeile 1054 der Datei shooting.c.

1055 {
1056  if (shooting_is_infinity_distance()) return (-1);
1057  int h_1e3 = shooting_get_hyperfocal_distance_1e3_f(av, fl);
1058  double m = ((double)(h_1e3 - fl)+500)/1000*s;
1059  int v = ((h_1e3 - 2*fl + 1000*s)+500)/1000;
1060  if ((m>0) && (v>0)) return (int)((2*m/v+1)/2);
1061  else return (-1);
1062 }
int shooting_get_prop ( int  id)

Definiert in Zeile 103 der Datei shooting.c.

104 {
105  short vv;
106  get_property_case(id, &vv, sizeof(vv));
107  return vv;
108 }
static int shooting_get_prop_int ( int  id)
static

Definiert in Zeile 110 der Datei shooting.c.

111 {
112  int vv;
113  get_property_case(id, &vv, sizeof(vv));
114  return vv;
115 }
int shooting_get_real_aperture ( )

Definiert in Zeile 715 der Datei shooting.c.

short shooting_get_real_focus_mode ( )

Definiert in Zeile 193 der Datei shooting.c.

194 {
195  short f = shooting_get_focus_mode();
197  if (f==0 && m!=0) f=(m==1)?4:m;
198  return f;
199 }
short shooting_get_resolution ( )

Definiert in Zeile 131 der Datei shooting.c.

float shooting_get_shutter_speed_from_tv96 ( short  tv96)

Definiert in Zeile 534 der Datei shooting.c.

535 {
536  return pow(2,((float)(-tv96))/96.0);
537 }
int shooting_get_subject_distance ( )

Definiert in Zeile 1188 der Datei shooting.c.

1189 {
1192 }
int shooting_get_subject_distance_ ( )
int shooting_get_subject_distance_override_value ( )
short shooting_get_sv96_delta ( )

Definiert in Zeile 296 der Datei shooting.c.

short shooting_get_sv96_from_iso ( short  iso)

Definiert in Zeile 320 der Datei shooting.c.

321 {
322  // Equivalent to (short)(log2(iso/3.125)*96+0.5) [APEX equation]
323  if (iso > 0)
324  return (short)( log((double)(iso)*32.0/100.0)*96.0*(inv_log_2)+0.5 );
325  return 0;
326 }
short shooting_get_sv96_market ( )

Definiert in Zeile 294 der Datei shooting.c.

short shooting_get_sv96_real ( )

Definiert in Zeile 295 der Datei shooting.c.

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

Definiert in Zeile 518 der Datei shooting.c.

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

Definiert in Zeile 522 der Datei shooting.c.

523 {
524  if (t > 0)
525  {
526  t = ((96.0 * -log(t)) * inv_log_2);
527  if (t < 0)
528  return (short)(t - 0.5);
529  return (short)(t + 0.5);
530  }
531  return SHOOTING_TV96_INVALID;
532 }
static int shooting_get_tv96_override_value ( )
static

Definiert in Zeile 547 der Datei shooting.c.

548 {
549  // Calculate the tv96 value for the tv override
554  else
556 }
short shooting_get_user_av96 ( )

Definiert in Zeile 790 der Datei shooting.c.

791 {
792 #if CAM_HAS_IRIS_DIAPHRAGM
794 #else
795  return 0;
796 #endif
797 }
int shooting_get_user_av_id ( )

Definiert in Zeile 799 der Datei shooting.c.

800 {
801 #if CAM_HAS_IRIS_DIAPHRAGM
802  return aperture_sizes_table[find_nearest_aperture_entry(shooting_get_user_av96())].prop_id;
803 #else
804  return 0;
805 #endif
806 }
short shooting_get_user_tv96 ( )

Definiert in Zeile 611 der Datei shooting.c.

612 {
613 #if CAM_HAS_USER_TV_MODES
615 #else
616  return 0;
617 #endif
618 }
int shooting_get_user_tv_id ( )

Definiert in Zeile 620 der Datei shooting.c.

621 {
622 #if CAM_HAS_USER_TV_MODES
624 #else
625  return 0;
626 #endif
627 }
int shooting_get_zoom ( )

Definiert in Zeile 229 der Datei shooting.c.

230 {
231  return lens_get_zoom_point();
232 }
int shooting_in_progress ( )

Definiert in Zeile 136 der Datei shooting.c.

void shooting_init ( )

Definiert in Zeile 932 der Datei shooting.c.

933 {
935  iso_init();
936 }
int shooting_is_flash ( )

Definiert in Zeile 135 der Datei shooting.c.

int shooting_is_flash_ready ( )

Definiert in Zeile 1239 der Datei shooting.c.

1240 {
1241  int t = shooting_get_flash_mode();
1242  if ((t != 2) && (shooting_in_progress()))
1243  if (shooting_is_flash())
1244  return IsStrobeChargeCompleted();
1245  return 1;
1246 }
short shooting_is_infinity_distance ( )

Definiert in Zeile 1074 der Datei shooting.c.

1075 {
1076  return (shooting_get_lens_to_focal_plane_width() == 0)?1:0;
1077 }
static void shooting_iso_bracketing ( int  when)
static

Definiert in Zeile 1463 der Datei shooting.c.

1464 {
1465  // first shot? (actually this is called just after the first shot has been taken)
1466  if (bracketing.shoot_counter == 0)
1467  {
1470  }
1471 
1472  // Adjust delta ISO value for shot based on shot number
1474  // Calculate new ISO (higher ISO = brighter image)
1476  if (value <= 0) value = 50;
1477 
1478  // Inc for next shot
1480 
1481  // Apply value for next shot to be taken
1482  shooting_set_iso_real(value, when);
1483 }
short shooting_iso_market_to_real ( short  isom)

Definiert in Zeile 334 der Datei shooting.c.

335 {
336  return ISO_MARKET_TO_REAL(isom);
337 }
short shooting_iso_real_to_market ( short  isor)

Definiert in Zeile 339 der Datei shooting.c.

340 {
341  return ISO_REAL_TO_MARKET(isor);
342 }
int shooting_mode_canon2chdk ( int  canonmode)

Definiert in Zeile 1005 der Datei shooting.c.

1006 {
1007  int i;
1008  for (i=0; i < MODESCNT; i++)
1009  {
1010  if (modemap[i].canonmode == canonmode)
1011  return modemap[i].hackmode;
1012  }
1013  return 0;
1014 }
int shooting_mode_chdk2canon ( int  hackmode)

Definiert in Zeile 1016 der Datei shooting.c.

1017 {
1018  int i;
1019  for (i=0; i < MODESCNT; i++)
1020  {
1021  if (modemap[i].hackmode == hackmode)
1022  return modemap[i].canonmode;
1023  }
1024  return -1; // 0 is a valid mode on old cameras!
1025 }
void shooting_set_av96 ( short  av96,
short  is_now 
)

Definiert in Zeile 780 der Datei shooting.c.

781 {
782 #if CAM_HAS_IRIS_DIAPHRAGM
784  shooting_set_av96_direct(find_canon_aperture(av96), is_now);
785 #endif
786 }
void shooting_set_av96_direct ( short  av96,
short  is_now 
)

Definiert in Zeile 762 der Datei shooting.c.

763 {
764 #if CAM_HAS_IRIS_DIAPHRAGM
766  {
767  if(is_now)
768  {
769  set_property_case(PROPCASE_AV, &av96, sizeof(av96));
770 #ifdef PROPCASE_AV2
771  set_property_case(PROPCASE_AV2, &av96, sizeof(av96)); // Save override to property that will update JPEG header & Canon OSD
772 #endif
773  }
774  else
775  photo_param_put_off.av96 = av96;
776  }
777 #endif
778 }
static void shooting_set_flash_override ( )
static

Definiert in Zeile 1764 der Datei shooting.c.

1765 {
1766  int mode, flash, power;
1767  flash = 1;
1768 
1769  // Set flash mode & override
1771  {
1773  {
1774  mode = 1; // Manual flash
1776  set_property_case(PROPCASE_FLASH_ADJUST_MODE, &mode, sizeof(mode));
1777  set_property_case(PROPCASE_FLASH_FIRE, &flash, sizeof(flash));
1778  set_property_case(PROPCASE_FLASH_MANUAL_OUTPUT, &power, sizeof(power));
1779  }
1780  else if (conf.flash_enable_exp_comp)
1781  {
1782  mode = 0; // Auto flash
1783  power = (conf.flash_exp_comp - 9) * 32;
1784  set_property_case(PROPCASE_FLASH_ADJUST_MODE, &mode, sizeof(mode));
1785  set_property_case(PROPCASE_FLASH_FIRE, &flash, sizeof(flash));
1786 #if defined(PROPCASE_FLASH_EXP_COMP)
1787  set_property_case(PROPCASE_FLASH_EXP_COMP, &power, sizeof(power));
1788 #endif
1789 #if defined(PROPCASE_EXT_FLASH_EXP_COMP)
1790  set_property_case(PROPCASE_EXT_FLASH_EXP_COMP, &power, sizeof(power));
1791 #endif
1792  }
1793  }
1794 }
void shooting_set_focus ( int  v,
short  is_now 
)

Definiert in Zeile 1299 der Datei shooting.c.

1300 {
1301  int s=v;
1303  {
1304  if (is_now && shooting_can_focus())
1305  {
1307  {
1309  }
1310  if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST))
1312  lens_set_focus_pos(s);
1313  }
1314  else
1316  }
1317 }
void shooting_set_iso_mode ( int  v)

Definiert in Zeile 411 der Datei shooting.c.

412 {
413  int i;
414  if (v < 50) // CHDK ID
415  {
416  for (i=0; i<ISO_SIZE; i++)
417  {
418  if (iso_table[i].id == v)
419  {
420  set_iso_mode(i);
421  return;
422  }
423  }
424  }
425  else // ISO value - find nearest entry in iso_table and set iso mode to that value
426  {
427  if (v <= iso_table[0].prop_id) // In case no AUTO (0) entry
428  {
429  set_iso_mode(0);
430  return;
431  }
432  for (i=0; i<ISO_SIZE-1; i++)
433  {
434  if ((v > iso_table[i].prop_id) && (v <= iso_table[i+1].prop_id))
435  {
436  if ((v - iso_table[i].prop_id) < (iso_table[i+1].prop_id - v))
437  set_iso_mode(i);
438  else
439  set_iso_mode(i+1);
440  return;
441  }
442  }
443  set_iso_mode(ISO_SIZE-1);
444  }
445 }
void shooting_set_iso_real ( short  iso,
short  is_now 
)

Definiert in Zeile 474 der Datei shooting.c.

475 {
477  {
478  if (iso > 0)
479  {
480 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
481  // Limit max ISO in HQ burst mode
484 #endif
485 #ifdef CAM_MIN_ISO_OVERRIDE
486  // Limit min (non-zero) ISO
488 #endif
489 #ifdef CAM_MAX_ISO_OVERRIDE
490  // Limit max ISO
492 #endif
494  }
495  }
496 }
int shooting_set_mode_canon ( int  canonmode)

Definiert in Zeile 1364 der Datei shooting.c.

1365 {
1366  if (canonmode == -1 || !rec_mode_active())
1367  return 0;
1368  SetCurrentCaptureModeType(canonmode);
1369  // updated cached mode information immediately
1370  mode_get();
1371  return 1;
1372 }
int shooting_set_mode_chdk ( int  mode)

Definiert in Zeile 1374 der Datei shooting.c.

1375 {
1377 }
void shooting_set_nd_filter_state ( short  v,
short  is_now 
)

Definiert in Zeile 858 der Datei shooting.c.

859 {
860 #if CAM_HAS_ND_FILTER
862  {
863  if (is_now)
864  {
865 #if defined(CAM_ND_SET_AV_VALUE)
866  short av;
867  get_property_case(PROPCASE_MIN_AV,&av,sizeof(av));
868  if(v==1) {
870  }
871  set_property_case(PROPCASE_AV, &av, sizeof(av));
872 #if defined(PROPCASE_AV2)
873  set_property_case(PROPCASE_AV2, &av, sizeof(av));
874 #endif
875 #endif
876  if (v==1) {
877  PutInNdFilter();
878  }
879  else if (v==2)
880  PutOutNdFilter();
881 #if defined(CAM_HAS_NATIVE_ND_FILTER) && defined(PROPCASE_ND_FILTER_STATE)
882  int n = (v==1) ? 1 : 0;
884 #endif
885  }
886  else
888  }
889 #endif
890 }
void shooting_set_playrec_mode ( int  mode)

Definiert in Zeile 1892 der Datei shooting.c.

1893 {
1894  // use PTP compatible switch if usb bit power detected, and USB remote not configured to use USB
1895  // TODO should just check the USB bit seen by canon firmware (after masking)
1897  {
1899  return;
1900  }
1901  if(mode)
1903  else
1904  levent_set_play();
1905 }
void shooting_set_prop ( int  id,
int  v 
)

Definiert in Zeile 117 der Datei shooting.c.

118 {
119  short vv = v;
120  set_property_case(id, &vv, sizeof(vv));
121  return;
122 }
void shooting_set_sv96 ( short  sv96,
short  is_now 
)

Definiert in Zeile 447 der Datei shooting.c.

448 {
450  {
451  if (is_now)
452  {
453  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
454 
455  short iso_mode = shooting_get_canon_iso_mode();
456  if (iso_mode >= 50) {
457  // save current ISO mode, to avoid leaving in auto after override done
458  // only needed for non-auto
459  iso_override_mode_save = iso_mode;
460  shooting_set_iso_mode(0); // Force AUTO mode on camera
461  }
462 
463  short dsv96 = sv96 + SV96_MARKET_OFFSET - canon_sv96_base;
464 
465  set_property_case(PROPCASE_SV_MARKET, &canon_sv96_base, sizeof(canon_sv96_base));
466  set_property_case(PROPCASE_SV, &sv96, sizeof(sv96));
467  set_property_case(PROPCASE_DELTA_SV, &dsv96, sizeof(dsv96));
468  }
469  else
470  photo_param_put_off.sv96 = sv96;
471  }
472 }
void shooting_set_tv96 ( short  tv96,
short  is_now 
)

Definiert in Zeile 603 der Datei shooting.c.

604 {
607 }
void shooting_set_tv96_direct ( short  tv96,
short  is_now 
)

Definiert in Zeile 587 der Datei shooting.c.

588 {
590  {
591  if(is_now)
592  {
593  set_property_case(PROPCASE_TV, &tv96, sizeof(tv96));
594 #ifdef PROPCASE_TV2
595  set_property_case(PROPCASE_TV2, &tv96, sizeof(tv96)); // Save override to property that will update JPEG header & Canon OSD
596 #endif
597  }
598  else
599  photo_param_put_off.tv96 = tv96;
600  }
601 }
void shooting_set_user_av96 ( short  av96)

Definiert in Zeile 838 der Datei shooting.c.

839 {
840 #if CAM_HAS_IRIS_DIAPHRAGM
842  {
843  av96 = find_canon_aperture(av96);
844  set_property_case(PROPCASE_USER_AV, &av96, sizeof(av96));
845  }
846 #endif
847 }
void shooting_set_user_av_by_id ( int  v)

Definiert in Zeile 808 der Datei shooting.c.

809 {
810 #if CAM_HAS_IRIS_DIAPHRAGM
811  long i;
813  {
814  for (i=0;i<AS_SIZE;i++)
815  {
816  if (aperture_sizes_table[i].id == v)
817  {
818  short vv = aperture_sizes_table[i].prop_id;
819  set_property_case(PROPCASE_USER_AV, &vv, sizeof(vv));
820  return;
821  }
822  }
823  }
824 #endif
825 }
void shooting_set_user_av_by_id_rel ( int  v)

Definiert in Zeile 827 der Datei shooting.c.

828 {
829 #if CAM_HAS_IRIS_DIAPHRAGM
831  {
832  int cv = shooting_get_user_av_id();
834  }
835 #endif
836 }
void shooting_set_user_tv96 ( short  tv96)

Definiert in Zeile 659 der Datei shooting.c.

660 {
661 #if CAM_HAS_USER_TV_MODES
663  {
664  tv96 = find_canon_shutter_speed(tv96);
665  set_property_case(PROPCASE_USER_TV, &tv96, sizeof(tv96));
666  }
667 #endif
668 }
void shooting_set_user_tv_by_id ( int  v)

Definiert in Zeile 629 der Datei shooting.c.

630 {
631 #if CAM_HAS_USER_TV_MODES
633  {
634  long i;
635  for (i=0;i<SS_SIZE;i++)
636  {
637  if (shutter_speeds_table[i].id == v)
638  {
639  short vv = shutter_speeds_table[i].prop_id;
640  set_property_case(PROPCASE_USER_TV, &vv, sizeof(vv));
641  return;
642  }
643  }
644  }
645 #endif
646 }
void shooting_set_user_tv_by_id_rel ( int  v)

Definiert in Zeile 648 der Datei shooting.c.

649 {
650 #if CAM_HAS_USER_TV_MODES
652  {
653  int cv = shooting_get_user_tv_id();
655  }
656 #endif
657 }
void shooting_set_zoom ( int  v)

Definiert in Zeile 1261 der Datei shooting.c.

1262 {
1264  {
1265 #if CAM_REFOCUS_AFTER_ZOOM
1266  int dist = shooting_get_subject_distance();
1268 #if defined(CAM_NEED_SET_ZOOM_DELAY)
1270 #endif
1271  shooting_set_focus(dist, SET_NOW);
1272 #else // CAM_REFOCUS_AFTER_ZOOM
1274 #endif // CAM_REFOCUS_AFTER_ZOOM
1275  }
1276 }
void shooting_set_zoom_rel ( int  v)

Definiert in Zeile 1278 der Datei shooting.c.

1279 {
1280  int cv = shooting_get_zoom();
1282  {
1283  shooting_set_zoom(cv+v);
1284  }
1285 }
void shooting_set_zoom_speed ( int  v)

Definiert in Zeile 1287 der Datei shooting.c.

1287  {
1289  {
1291  }
1292 }
static void shooting_subject_distance_bracketing ( int  when)
static

Definiert in Zeile 1485 der Datei shooting.c.

1486 {
1487  // first shot? (actually this is called just after the first shot has been taken)
1488  if (bracketing.shoot_counter == 0)
1489  {
1492  }
1493 
1494  // Adjust delta SD value for shot based on shot number
1496  // Calculate new SD
1498  if (value < CAMERA_MIN_DIST) value = CAMERA_MIN_DIST;
1499  else if (value > CAMERA_MAX_DIST) value = CAMERA_MAX_DIST;
1500 
1501  // Inc for next shot
1503 
1504  // Apply value for next shot to be taken
1505  shooting_set_focus(value, when);
1506 }
short shooting_sv96_market_to_real ( short  sv96)

Definiert in Zeile 344 der Datei shooting.c.

345 {
346  return sv96 - SV96_MARKET_OFFSET;
347 }
short shooting_sv96_real_to_market ( short  sv96)

Definiert in Zeile 349 der Datei shooting.c.

350 {
351  return sv96 + SV96_MARKET_OFFSET;
352 }
static void shooting_tv_bracketing ( int  when)
static

Definiert in Zeile 1398 der Datei shooting.c.

1399 {
1400  // first shot? (actually this is called just after the first shot has been taken)
1401  if (bracketing.shoot_counter == 0)
1402  {
1403  // if Tv override is enabled... (this was adapted from function shooting_expo_param_override() )
1405  {
1406  // ...use Tv override value as seed for bracketing:
1408  }
1409  // Tv override is disabled, use camera's opinion of Tv for bracketing seed value.
1410  else
1411  {
1414  else
1416  }
1418  }
1419 
1420  // Adjust delta TV value for shot based on shot number
1422  // Calculate new TV (note, need to subtract delta because higher values are shorter shutter speeds / darker images)
1424 
1425  // Inc for next shot
1427 
1428  // Apply value for next shot to be taken
1429  shooting_set_tv96_direct(value, when);
1430 }
void shooting_update_dof_values ( )

Definiert in Zeile 1095 der Datei shooting.c.

1096 {
1097  int hyp, hyp_1e3, av_1e3, v;
1098  int dist = shooting_get_subject_distance_();
1099  int zoom_point = lens_get_zoom_point();
1100  int fl = get_focal_length(zoom_point);
1101  short f_focus_ok = shooting_get_focus_ok();
1102  short f_hyp_calc = 0, f_dist_calc = 0;
1103  short min_av96_zoom_point = 0;
1104  short av96 = shooting_get_user_av96();
1105  short curr_av96 = shooting_get_current_av96();
1106  short prop_av96 = shooting_get_av96();
1107  short min_av96;
1108 
1109  if (!min_av96_zoom_point_tbl) {
1110  min_av96_zoom_point_tbl = (short *) malloc(zoom_points * sizeof(short));
1112  memset(min_av96_zoom_point_tbl, 0, zoom_points * sizeof(short));
1113  }
1114  else {
1115  return;
1116  }
1117  } else min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];
1118 
1119  if (min_av96_zoom_point==0 && shooting_in_progress()) {
1120  get_property_case(PROPCASE_MIN_AV, &min_av96, sizeof(min_av96));
1121  min_av96_zoom_point_tbl[zoom_point] = min_av96;
1122  }
1123 
1124  if ((camera_info.state.mode_shooting==MODE_M || camera_info.state.mode_shooting==MODE_AV) && (av96>0) && !f_focus_ok) {
1125  if (av96 < min_av96_zoom_point) av96 = min_av96_zoom_point;
1126  }
1127  else av96 = (abs(curr_av96-prop_av96)<2)?prop_av96:curr_av96;
1128 
1129  av_1e3 = shooting_get_aperture_from_av96(av96);
1132 
1133  if (camera_info.dof_values.aperture_value!=av_1e3 || camera_info.dof_values.focal_length!=fl || (hyp_1e3<0)) {
1134  //calc new hyperfocal distance and min stack distance
1135  f_hyp_calc = 1;
1136  hyp_1e3 = -1;
1137  hyp = -1;
1140  hyp_1e3 = shooting_get_hyperfocal_distance_1e3_f(av_1e3, fl);
1141  if (hyp_1e3>0) {
1142  hyp = (hyp_1e3+500)/1000;
1144  v = ((hyp_1e3 - fl)/250 + 2 + 1)/2;
1145  if (v>0) {
1146  int m = ((fl*((fl - hyp_1e3)/1000 - 1)/500)/v + 1)/2;
1147  int m2 = (int)((((double)hyp*(2*fl - hyp_1e3)/1000))/v + 0.5);
1149  }
1150  }
1151  }
1152 
1153  if ((camera_info.dof_values.subject_distance!=dist || (camera_info.dof_values.hyperfocal_distance_1e3!=hyp_1e3)) && (hyp_1e3>0)) {
1154  //calc new NEAR, FAR, DOF values
1155  f_dist_calc = 1;
1160  if ((av_1e3>0) && (fl>0) && (dist>0) && (shooting_is_infinity_distance()==0) && (hyp_1e3>0)) {
1161  double m = ((double)(hyp_1e3 - fl)/1000 * dist) + 0.5;
1164  } else {
1165  int v = ((((hyp_1e3 - 2*fl + 1000*dist)/500) + 1)/2);
1166  if (v>0) camera_info.dof_values.near_limit = (int)(m/v);
1167  }
1168  int v = ((((hyp_1e3 - 1000*dist)/500) + 1)/2);
1169  if (v>0) camera_info.dof_values.far_limit = (int)(m/v);
1172  }
1173  }
1174  // if at infinity then set near to hyperfocal value
1175  // note focus beyond infinity is not distinguished from infinity
1178  }
1179  }
1182  f_focus_ok = (f_focus_ok && shooting_get_focus_ok());
1185  return;
1186 }
void shooting_update_state ( void  )

Definiert in Zeile 72 der Datei shooting.c.

73 {
74  // ISO override will set ISO_MODE to auto in halfpress when get_shooting becomes true
75  // or immediately if already in shooting or raw hook for bracketing
76  // if existing ISO mode is not auto, it will be saved to iso_override_mode_save
77  // restore when shooting goes to false
81  }
82 
83 #ifdef OPT_VIEWPORT_DEBUG
84  extern volatile char active_viewport_buffer;
85  long avb_ts;
86  char avb_v;
87  avb_ts = get_tick_count();
88  avb_v = active_viewport_buffer;
89  if (avb_v != avb_pv) {
90  avb_history[avb_hp] = avb_v;
91  avb_times[avb_hp] = avb_ts - avb_pts;
92  avb_hp = (avb_hp+1) & 31;
93  avb_pts = avb_ts;
94  avb_pv = avb_v;
95  }
96 #endif
97 
98 }
void shooting_video_bitrate_change ( int  v)

Definiert in Zeile 1319 der Datei shooting.c.

1320 {
1321 #if CAM_CHDK_HAS_EXT_VIDEO_MENU
1322  int m[]={1,2,3,4,5,6,7,8,10,12}; // m[v]/4 = bitrate*1x
1323  if (v>=(sizeof(m)/sizeof(m[0])))
1324  v=(sizeof(m)/sizeof(m[0]))-1;
1325  change_video_tables(m[v],4);
1326 #endif
1327 }
void unlock_optical_zoom ( void  )

Definiert in Zeile 1351 der Datei shooting.c.

1352 {
1353 #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1354  extern void UnsetZoomForMovie();
1356  UnsetZoomForMovie();
1357 #endif
1358 
1359 #if CAM_EV_IN_VIDEO
1360  set_ev_video_avail(0);
1361 #endif
1362 }

Variablen-Dokumentation

const ApertureSize aperture_sizes_table[]

pt=require'extras/proptools'

Definiert in Zeile 9 der Datei shooting.c.

const unsigned int AS_SIZE

Definiert in Zeile 18 der Datei shooting.c.

int bracket_delta[4][2]
static
Initialisierung:
= {
{ 1, 0 },
{ 1, 1 },
{ 1, 1 },
{ 1, 0 },
}

Definiert in Zeile 1391 der Datei shooting.c.

int bracket_steps[4][2]
static
Initialisierung:
= {
{ 1, -1 },
{ -1, -1 },
{ 1, 1 },
{ -1, 1 },
}

Definiert in Zeile 1385 der Datei shooting.c.

Definiert in Zeile 1382 der Datei shooting.c.

short canon_iso_base =0
static

Definiert in Zeile 299 der Datei shooting.c.

short canon_sv96_base =0
static

Definiert in Zeile 300 der Datei shooting.c.

volatile long focus_busy
int focus_interlock_bypass = 0
static

Definiert in Zeile 1200 der Datei shooting.c.

const double inv_log_2 = 1.44269504088906
static

Definiert in Zeile 59 der Datei shooting.c.

int iso_override_mode_save = 0
static

Definiert in Zeile 53 der Datei shooting.c.

const unsigned int ISO_SIZE

Definiert in Zeile 19 der Datei shooting.c.

const ISOTable iso_table[]

Definiert in Zeile 71 der Datei shooting.c.

const double K = 12.5
static

Definiert in Zeile 982 der Datei shooting.c.

short* min_av96_zoom_point_tbl = NULL
static

Definiert in Zeile 36 der Datei shooting.c.

const CapturemodeMap modemap[]

Definiert in Zeile 82 der Datei shooting.c.

const unsigned int MODESCNT

Definiert in Zeile 20 der Datei shooting.c.

int movie_status

Definiert in Zeile 72 der Datei lib.c.

const unsigned int param_file_counter

Definiert in Zeile 23 der Datei shooting.c.

PHOTO_PARAM photo_param_put_off
static

Definiert in Zeile 49 der Datei shooting.c.

long playrec_mode
const ShutterSpeed shutter_speeds_table[]

Definiert in Zeile 22 der Datei shooting.c.

const unsigned int SS_SIZE

Definiert in Zeile 17 der Datei shooting.c.