CHDK_DE Vorschauversion  Trunk Rev. 5163
 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)
 
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 ()
 
static int find_nearest_aperture_entry (short av96)
 
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 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 641 der Datei shooting.c.

#define AV96_MIN   (aperture_sizes_table[0].prop_id)

Definiert in Zeile 640 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 274 der Datei shooting.c.

#define ISO_MARKET_TO_REAL_MULT   9955

Definiert in Zeile 266 der Datei shooting.c.

#define ISO_MARKET_TO_REAL_ROUND   8192

Definiert in Zeile 268 der Datei shooting.c.

#define ISO_MARKET_TO_REAL_SHIFT   14

Definiert in Zeile 267 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 275 der Datei shooting.c.

#define ISO_REAL_TO_MARKET_MULT   3371

Definiert in Zeile 269 der Datei shooting.c.

#define ISO_REAL_TO_MARKET_ROUND   1024

Definiert in Zeile 271 der Datei shooting.c.

#define ISO_REAL_TO_MARKET_SHIFT   11

Definiert in Zeile 270 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 261 der Datei shooting.c.

#define tv_override_zero_shift   18

Definiert in Zeile 496 der Datei shooting.c.

Dokumentation der Funktionen

int __attribute__ ( (weak)  )

Definiert in Zeile 1600 der Datei shooting.c.

1601 {
1602  return (playrec_mode==2 || playrec_mode==4 || playrec_mode==5);
1603 }
void bracketing_reset ( )

Definiert in Zeile 1449 der Datei shooting.c.

void bracketing_step ( int  when)

Definiert in Zeile 1456 der Datei shooting.c.

int captseq_hack_override_active ( )

Definiert in Zeile 1484 der Datei shooting.c.

1485 {
1488  return 1;
1489 #if CAM_HAS_IRIS_DIAPHRAGM
1491  return 1;
1492 #endif
1493  }
1494  if(conf.override_disable==1)
1495  return 0;
1497  return 1;
1499  return 1;
1500 #if CAM_HAS_IRIS_DIAPHRAGM
1502  return 1;
1503 #endif
1504  return 0;
1505 }
static short find_canon_shutter_speed ( short  tv96)
static

Definiert in Zeile 535 der Datei shooting.c.

static int find_nearest_aperture_entry ( short  av96)
static

Definiert in Zeile 685 der Datei shooting.c.

686 {
687  if (av96 <= aperture_sizes_table[0].prop_id)
688  return 0;
689 
690  int i;
691  for (i=0; i<AS_SIZE-1; i++)
692  {
693  if ((av96 > aperture_sizes_table[i].prop_id) && (av96 <= aperture_sizes_table[i+1].prop_id))
694  {
695  if ((av96 - aperture_sizes_table[i].prop_id) < (aperture_sizes_table[i+1].prop_id - av96))
696  return i;
697  else
698  return i+1;
699  }
700  }
701 
702  return AS_SIZE-1;
703 }
static int find_nearest_shutter_speed_entry ( short  tv96)
static

Definiert in Zeile 514 der Datei shooting.c.

515 {
516  if (tv96 <= shutter_speeds_table[0].prop_id)
517  return 0;
518 
519  int i;
520  for (i=0; i<SS_SIZE-1; i++)
521  {
522  if ((tv96 > shutter_speeds_table[i].prop_id) && (tv96 <= shutter_speeds_table[i+1].prop_id))
523  {
524  if ((tv96 - shutter_speeds_table[i].prop_id) < (shutter_speeds_table[i+1].prop_id - tv96))
525  return i;
526  else
527  return i+1;
528  }
529  }
530 
531  return SS_SIZE-1;
532 }
long get_exposure_counter ( )

Definiert in Zeile 914 der Datei shooting.c.

915 {
916  long v = 0;
918  v = ((v>>4)&0x3FFF);
919  return v;
920 }
long get_file_counter ( )

Definiert in Zeile 907 der Datei shooting.c.

908 {
909  long v = 0;
911  return v;
912 }
int get_movie_status ( )

Definiert in Zeile 1542 der Datei shooting.c.

1543 {
1544 #ifndef CAM_SIMPLE_MOVIE_STATUS
1545  return movie_status;
1546 #else
1547  // firmware movie_status interpreted as: zero - not recording, nonzero - recording
1548  return simple_movie_status?VIDEO_RECORD_IN_PROGRESS:VIDEO_RECORD_STOPPED;
1549 #endif
1550 }
void get_target_dir_name ( char *  dir)

Definiert in Zeile 924 der Datei shooting.c.

924  {
925  extern long get_target_dir_num();
926  sprintf(dir,"A/DCIM/%03dCANON",get_target_dir_num());
927 }
int is_video_recording ( )

Definiert in Zeile 1553 der Datei shooting.c.

1554 {
1555 #ifndef CAM_SIMPLE_MOVIE_STATUS
1556 #if defined(CAM_HAS_MOVIE_DIGEST_MODE)
1557  // If camera has movie digest mode then movie_status values are different than previous models
1558  // 'movie_status' values
1559  // 0 - after startup
1560  // 1 - movie recording stopped
1561  // 4 - movie recording in progress, or in 'movie digest' scene mode
1562  // 5 - movie recording stopping
1563  // 6 - in video mode, not recording
1565 #else
1566  // 'movie_status' values
1567  // 0 - after startup
1568  // 1 - movie recording stopped
1569  // 4 - movie recording in progress
1570  // 5 - movie recording stopping
1571  return (movie_status > 1);
1572 #endif
1573 #else // CAM_SIMPLE_MOVIE_STATUS
1574  return (simple_movie_status!=0);
1575 #endif
1576 }
static void iso_init ( )
static

Definiert in Zeile 451 der Datei shooting.c.

452 {
453  // Get the camera ISO base value, store in global variable 'canon_iso_base'
454  if (iso_table[1-iso_table[0].id].prop_id == 50)
455  canon_iso_base = 50;
456  else
458 
459  // Get the SV96 value corresponding to the base Canon ISO for the camera
460  // Store in global variable 'canon_sv96_base'
462 }
int mode_get ( void  )

Definiert in Zeile 1605 der Datei shooting.c.

1606 {
1607  int mode, t=0xFF;
1608 
1609  mode = (rec_mode_active())?MODE_REC:MODE_PLAY;
1610 
1611 #ifdef CAM_SWIVEL_SCREEN
1612  extern int screen_opened(void); // 0 not open, non-zero open
1613  extern int screen_rotated(void); // 0 not rotated, non-zero rotated
1614 
1615  mode |= (screen_opened())?MODE_SCREEN_OPENED:0;
1616  mode |= (screen_rotated())?MODE_SCREEN_ROTATED:0;
1617 #endif
1618 
1619 #ifdef CAM_SUPPORT_BITMAP_RES_CHANGE
1620  extern void update_screen_dimensions();
1621  update_screen_dimensions();
1622 #endif
1623 
1625 #ifdef CAM_MASK_VID_REC_ACTIVE
1627 #else
1628  mode |= shooting_mode_canon2chdk(t);
1629 #endif
1630 
1631  // Set camera state variables from mode info
1635  camera_info.state.mode_rec = ((mode & MODE_MASK) == MODE_REC);
1637  camera_info.state.mode_play = ((mode & MODE_MASK) == MODE_PLAY);
1639 
1640  return (mode);
1641 }
int mode_is_video ( int  m)

Definiert in Zeile 1579 der Datei shooting.c.

1580 {
1581  m = m & MODE_SHOOTING_MASK;
1582  return (m==MODE_VIDEO_STD ||
1583  m==MODE_VIDEO_SPEED ||
1584  m==MODE_VIDEO_COMPACT ||
1591  m==MODE_VIDEO_M ||
1594  // not clear if this should be considered a video mode ?
1595  // m==MODE_VIDEO_MOVIE_DIGEST
1596  );
1597 }
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 980 der Datei shooting.c.

981 { return ( 0
982 #ifdef CAM_SD_OVER_IN_AF
983  + 1
984 #endif
985 #ifdef CAM_SD_OVER_IN_AFL
986  + 2
987 #endif
988 #ifdef CAM_SD_OVER_IN_MF
989  + 4
990 #endif
991 ); }
void set_focus_bypass ( int  m)

Definiert in Zeile 1235 der Datei shooting.c.

1236 {
1238 }
static void set_iso_mode ( int  i)
static

Definiert in Zeile 362 der Datei shooting.c.

363 {
364  short vv = iso_table[i].prop_id;
365  set_property_case(PROPCASE_ISO_MODE, &vv, sizeof(vv));
366 }
void set_movie_status ( int  status)

Definiert in Zeile 1513 der Datei shooting.c.

1514 {
1515 #ifndef CAM_SIMPLE_MOVIE_STATUS
1516  switch(status)
1517  {
1518  case 1:
1520  {
1522  }
1523  break;
1524  case 2:
1526  {
1528  }
1529  break;
1530  case 3:
1532  {
1534  }
1535  break;
1536  }
1537 #else // CAM_SIMPLE_MOVIE_STATUS
1538  // no known way to control the recording process
1539 #endif
1540 }
static void shooting_av_bracketing ( int  when)
static

Definiert in Zeile 1373 der Datei shooting.c.

1374 {
1375  // first shot? (actually this is called just after the first shot has been taken)
1376  if (bracketing.shoot_counter == 0)
1377  {
1380  else
1383  }
1384 
1385  // Adjust delta AV value for shot based on shot number
1387  // Calculate new AV (note, need to subtract delta because higher values are smaller apertures / darker images)
1389 
1390  // Inc for next shot
1392 
1393  // Apply value for next shot to be taken
1394  if (value != bracketing.av96)
1395  {
1396  shooting_set_av96_direct(value, when);
1397 #ifdef CAM_AV_OVERRIDE_IRIS_FIX
1398  extern int MoveIrisWithAv(short*);
1399  MoveIrisWithAv(&value);
1400 #endif
1401  }
1402 }
void shooting_bracketing ( void  )

Definiert in Zeile 1464 der Datei shooting.c.

short shooting_can_focus ( )

Definiert in Zeile 1146 der Datei shooting.c.

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

Definiert in Zeile 1803 der Datei shooting.c.

1804 {
1806  {
1808  // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override
1809  }
1810  else if (is_iso_override_enabled)
1814 
1815 #if defined(CAM_HAS_ND_FILTER) && defined(CAM_HAS_NATIVE_ND_FILTER)
1817  {
1819  //photo_param_put_off.nd_filter=0;
1820  }
1821  else if (conf.nd_filter_state && !(conf.override_disable==1))
1823 #endif
1824 
1825  // Set flash mode & override
1827 }
void shooting_expo_param_override_thumb ( void  )

Definiert in Zeile 1737 der Datei shooting.c.

1738 {
1740  {
1743  }
1744  else if (is_tv_override_enabled)
1745  {
1747  }
1748 
1750  {
1753  }
1754  else if (is_iso_override_enabled)
1758 
1760  {
1763  }
1764  else if (is_av_override_enabled)
1766 
1768  {
1771  }
1772  else if (is_sd_override_enabled)
1774 
1775 #if CAM_HAS_ND_FILTER
1777  {
1780  }
1781  else if (conf.nd_filter_state && !(conf.override_disable==1))
1783 #endif
1784 
1785 #if CAM_REAR_CURTAIN
1786  shooting_set_flash_sync_curtain(conf.flash_sync_curtain);
1787 #endif
1788 
1789  // Set flash mode & override
1791 
1792 #if CAM_QUALITY_OVERRIDE
1793  // this doesn't really need to be set in the override hook.
1794  // should only need to be set once if the users doesn't change back, but doing it here ensures it is set
1795  shooting_set_image_quality(conf.fast_image_quality);
1796 #endif
1797 
1799 }
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_iso_mode ( )

Definiert in Zeile 250 der Datei shooting.c.

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

Definiert in Zeile 1030 der Datei shooting.c.

1031 {
1034  else
1035  return (lens_get_focus_pos_from_lens());
1036 }
short shooting_get_common_focus_mode ( )

Definiert in Zeile 1174 der Datei shooting.c.

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

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

Definiert in Zeile 1015 der Datei shooting.c.

1016 {
1017  if (shooting_is_infinity_distance()) return (-1);
1018  int h_1e3 = shooting_get_hyperfocal_distance_1e3_f(av, fl);
1019  double m = ((double)(h_1e3 - fl)+500)/1000*s;
1020  int v = ((h_1e3 - 1000*s)+500)/1000;
1021  if ((m>0) && (v>0)) return (int)((2*m/v+1)/2);
1022  else return (-1);
1023 }
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 1138 der Datei shooting.c.

1139 {
1142 }
int shooting_get_hyperfocal_distance_1e3_f ( int  av,
int  fl 
)

Definiert in Zeile 998 der Datei shooting.c.

999 {
1000  if ((av>0) && (fl>0) && (camera_info.circle_of_confusion>0))
1001  return (int)(((((double)fl*fl)/(av*camera_info.circle_of_confusion)*1000)+fl)+0.5);
1002  else return (-1);
1003 }
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 993 der Datei shooting.c.

994 {
996 }
int shooting_get_luminance ( )

Definiert in Zeile 935 der Datei shooting.c.

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

Definiert in Zeile 862 der Datei shooting.c.

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

Definiert in Zeile 848 der Datei shooting.c.

849 {
850 #if CAM_HAS_IRIS_DIAPHRAGM
851  extern short GetUsableMaxAv(void);
853  {
854  return -1;
855  }
856  return GetUsableMaxAv();
857 #else
858  return -1;
859 #endif
860 }
static int shooting_get_min_real_aperture ( )
static

Definiert in Zeile 673 der Datei shooting.c.

674 {
675  short av96;
676  get_property_case(PROPCASE_MIN_AV, &av96, sizeof(av96));
677  if (av96)
678  return shooting_get_aperture_from_av96(av96);
680 }
int shooting_get_near_limit_f ( int  s,
int  av,
int  fl 
)

Definiert in Zeile 1005 der Datei shooting.c.

1006 {
1007  if (shooting_is_infinity_distance()) return (-1);
1008  int h_1e3 = shooting_get_hyperfocal_distance_1e3_f(av, fl);
1009  double m = ((double)(h_1e3 - fl)+500)/1000*s;
1010  int v = ((h_1e3 - 2*fl + 1000*s)+500)/1000;
1011  if ((m>0) && (v>0)) return (int)((2*m/v+1)/2);
1012  else return (-1);
1013 }
int shooting_get_prop ( int  id)

Definiert in Zeile 60 der Datei shooting.c.

61 {
62  short vv;
63  get_property_case(id, &vv, sizeof(vv));
64  return vv;
65 }
static int shooting_get_prop_int ( int  id)
static

Definiert in Zeile 67 der Datei shooting.c.

68 {
69  int vv;
70  get_property_case(id, &vv, sizeof(vv));
71  return vv;
72 }
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 1132 der Datei shooting.c.

1133 {
1136 }
int shooting_get_subject_distance_ ( )
int shooting_get_subject_distance_override_value ( )
short shooting_get_sv96_delta ( )

Definiert in Zeile 253 der Datei shooting.c.

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

Definiert in Zeile 500 der Datei shooting.c.

501 {
502  // Calculate the tv96 value for the tv override
507  else
509 }
short shooting_get_user_av96 ( )

Definiert in Zeile 741 der Datei shooting.c.

742 {
743 #if CAM_HAS_IRIS_DIAPHRAGM
745 #else
746  return 0;
747 #endif
748 }
int shooting_get_user_av_id ( )

Definiert in Zeile 750 der Datei shooting.c.

751 {
752 #if CAM_HAS_IRIS_DIAPHRAGM
754 #else
755  return 0;
756 #endif
757 }
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 }
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 883 der Datei shooting.c.

884 {
886  iso_init();
887 }
int shooting_is_flash ( )

Definiert in Zeile 92 der Datei shooting.c.

int shooting_is_flash_ready ( )

Definiert in Zeile 1183 der Datei shooting.c.

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

Definiert in Zeile 1025 der Datei shooting.c.

1026 {
1027  return (shooting_get_lens_to_focal_plane_width() == 0)?1:0;
1028 }
static void shooting_iso_bracketing ( int  when)
static

Definiert in Zeile 1404 der Datei shooting.c.

1405 {
1406  // first shot? (actually this is called just after the first shot has been taken)
1407  if (bracketing.shoot_counter == 0)
1408  {
1411  }
1412 
1413  // Adjust delta ISO value for shot based on shot number
1415  // Calculate new ISO (higher ISO = brighter image)
1417  if (value <= 0) value = 50;
1418 
1419  // Inc for next shot
1421 
1422  // Apply value for next shot to be taken
1423  shooting_set_iso_real(value, when);
1424 }
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 956 der Datei shooting.c.

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

Definiert in Zeile 967 der Datei shooting.c.

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

Definiert in Zeile 731 der Datei shooting.c.

732 {
733 #if CAM_HAS_IRIS_DIAPHRAGM
735  shooting_set_av96_direct(find_canon_aperture(av96), is_now);
736 #endif
737 }
void shooting_set_av96_direct ( short  av96,
short  is_now 
)

Definiert in Zeile 713 der Datei shooting.c.

714 {
715 #if CAM_HAS_IRIS_DIAPHRAGM
717  {
718  if(is_now)
719  {
720  set_property_case(PROPCASE_AV, &av96, sizeof(av96));
721 #ifdef PROPCASE_AV2
722  set_property_case(PROPCASE_AV2, &av96, sizeof(av96)); // Save override to property that will update JPEG header & Canon OSD
723 #endif
724  }
725  else
726  photo_param_put_off.av96 = av96;
727  }
728 #endif
729 }
static void shooting_set_flash_override ( )
static

Definiert in Zeile 1705 der Datei shooting.c.

1706 {
1707  int mode, flash, power;
1708  flash = 1;
1709 
1710  // Set flash mode & override
1712  {
1714  {
1715  mode = 1; // Manual flash
1717  set_property_case(PROPCASE_FLASH_ADJUST_MODE, &mode, sizeof(mode));
1718  set_property_case(PROPCASE_FLASH_FIRE, &flash, sizeof(flash));
1719  set_property_case(PROPCASE_FLASH_MANUAL_OUTPUT, &power, sizeof(power));
1720  }
1721  else if (conf.flash_enable_exp_comp)
1722  {
1723  mode = 0; // Auto flash
1724  power = (conf.flash_exp_comp - 9) * 32;
1725  set_property_case(PROPCASE_FLASH_ADJUST_MODE, &mode, sizeof(mode));
1726  set_property_case(PROPCASE_FLASH_FIRE, &flash, sizeof(flash));
1727 #if defined(PROPCASE_FLASH_EXP_COMP)
1728  set_property_case(PROPCASE_FLASH_EXP_COMP, &power, sizeof(power));
1729 #endif
1730 #if defined(PROPCASE_EXT_FLASH_EXP_COMP)
1731  set_property_case(PROPCASE_EXT_FLASH_EXP_COMP, &power, sizeof(power));
1732 #endif
1733  }
1734  }
1735 }
void shooting_set_focus ( int  v,
short  is_now 
)

Definiert in Zeile 1240 der Datei shooting.c.

1241 {
1242  int s=v;
1244  {
1245  if (is_now && shooting_can_focus())
1246  {
1248  {
1250  }
1251  if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST))
1253  lens_set_focus_pos(s);
1254  }
1255  else
1257  }
1258 }
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  canonmode)

Definiert in Zeile 1305 der Datei shooting.c.

1306 {
1307  if (canonmode == -1 || !rec_mode_active())
1308  return 0;
1309  SetCurrentCaptureModeType(canonmode);
1310  // updated cached mode information immediately
1311  mode_get();
1312  return 1;
1313 }
int shooting_set_mode_chdk ( int  mode)

Definiert in Zeile 1315 der Datei shooting.c.

1316 {
1318 }
void shooting_set_nd_filter_state ( short  v,
short  is_now 
)

Definiert in Zeile 809 der Datei shooting.c.

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

Definiert in Zeile 1833 der Datei shooting.c.

1834 {
1835  // use PTP compatible switch if usb bit power detected, and USB remote not configured to use USB
1836  // TODO should just check the USB bit seen by canon firmware (after masking)
1838  {
1840  return;
1841  }
1842  if(mode)
1844  else
1845  levent_set_play();
1846 }
void shooting_set_prop ( int  id,
int  v 
)

Definiert in Zeile 74 der Datei shooting.c.

75 {
76  short vv = v;
77  set_property_case(id, &vv, sizeof(vv));
78  return;
79 }
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 789 der Datei shooting.c.

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

Definiert in Zeile 759 der Datei shooting.c.

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

Definiert in Zeile 778 der Datei shooting.c.

779 {
780 #if CAM_HAS_IRIS_DIAPHRAGM
782  {
783  int cv = shooting_get_user_av_id();
785  }
786 #endif
787 }
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 1205 der Datei shooting.c.

1206 {
1207  int dist;
1209  {
1212 #if defined(CAM_NEED_SET_ZOOM_DELAY)
1214 #endif
1215  shooting_set_focus(dist, SET_NOW);
1216  }
1217 }
void shooting_set_zoom_rel ( int  v)

Definiert in Zeile 1219 der Datei shooting.c.

1220 {
1221  int cv = shooting_get_zoom();
1223  {
1224  shooting_set_zoom(cv+v);
1225  }
1226 }
void shooting_set_zoom_speed ( int  v)

Definiert in Zeile 1228 der Datei shooting.c.

1228  {
1230  {
1232  }
1233 }
static void shooting_subject_distance_bracketing ( int  when)
static

Definiert in Zeile 1426 der Datei shooting.c.

1427 {
1428  // first shot? (actually this is called just after the first shot has been taken)
1429  if (bracketing.shoot_counter == 0)
1430  {
1433  }
1434 
1435  // Adjust delta SD value for shot based on shot number
1437  // Calculate new SD
1439  if (value < CAMERA_MIN_DIST) value = CAMERA_MIN_DIST;
1440  else if (value > CAMERA_MAX_DIST) value = CAMERA_MAX_DIST;
1441 
1442  // Inc for next shot
1444 
1445  // Apply value for next shot to be taken
1446  shooting_set_focus(value, when);
1447 }
short shooting_sv96_market_to_real ( short  sv96)

Definiert in Zeile 301 der Datei shooting.c.

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

Definiert in Zeile 306 der Datei shooting.c.

307 {
308  return sv96 + SV96_MARKET_OFFSET;
309 }
static void shooting_tv_bracketing ( int  when)
static

Definiert in Zeile 1339 der Datei shooting.c.

1340 {
1341  // first shot? (actually this is called just after the first shot has been taken)
1342  if (bracketing.shoot_counter == 0)
1343  {
1344  // if Tv override is enabled... (this was adapted from function shooting_expo_param_override() )
1346  {
1347  // ...use Tv override value as seed for bracketing:
1349  }
1350  // Tv override is disabled, use camera's opinion of Tv for bracketing seed value.
1351  else
1352  {
1355  else
1357  }
1359  }
1360 
1361  // Adjust delta TV value for shot based on shot number
1363  // Calculate new TV (note, need to subtract delta because higher values are shorter shutter speeds / darker images)
1365 
1366  // Inc for next shot
1368 
1369  // Apply value for next shot to be taken
1370  shooting_set_tv96_direct(value, when);
1371 }
void shooting_update_dof_values ( )

Definiert in Zeile 1046 der Datei shooting.c.

1047 {
1048  int hyp, hyp_1e3, av_1e3, v;
1049  int dist = shooting_get_subject_distance_();
1050  int zoom_point = lens_get_zoom_point();
1051  int fl = get_focal_length(zoom_point);
1052  short f_focus_ok = shooting_get_focus_ok();
1053  short f_hyp_calc = 0, f_dist_calc = 0;
1054  short min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];
1055  short av96 = shooting_get_user_av96();
1056  short curr_av96 = shooting_get_current_av96();
1057  short prop_av96 = shooting_get_av96();
1058  short min_av96;
1059 
1060  if (!min_av96_zoom_point_tbl) {
1061  min_av96_zoom_point_tbl = (short *) malloc(zoom_points * sizeof(short));
1063  memset(min_av96_zoom_point_tbl, 0, zoom_points * sizeof(short));
1064  min_av96_zoom_point = 0;
1065  }
1066  } else min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];
1067 
1068  if (min_av96_zoom_point==0 && shooting_in_progress()) {
1069  get_property_case(PROPCASE_MIN_AV, &min_av96, sizeof(min_av96));
1070  min_av96_zoom_point_tbl[zoom_point] = min_av96;
1071  }
1072 
1073  if ((camera_info.state.mode_shooting==MODE_M || camera_info.state.mode_shooting==MODE_AV) && (av96>0) && !f_focus_ok) {
1074  if (av96 < min_av96_zoom_point) av96 = min_av96_zoom_point;
1075  }
1076  else av96 = (abs(curr_av96-prop_av96)<2)?prop_av96:curr_av96;
1077 
1078  av_1e3 = shooting_get_aperture_from_av96(av96);
1081 
1082  if (camera_info.dof_values.aperture_value!=av_1e3 || camera_info.dof_values.focal_length!=fl || (hyp_1e3<0)) {
1083  //calc new hyperfocal distance and min stack distance
1084  f_hyp_calc = 1;
1085  hyp_1e3 = -1;
1086  hyp = -1;
1089  hyp_1e3 = shooting_get_hyperfocal_distance_1e3_f(av_1e3, fl);
1090  if (hyp_1e3>0) {
1091  hyp = (hyp_1e3+500)/1000;
1093  v = ((hyp_1e3 - fl)/250 + 2 + 1)/2;
1094  if (v>0) {
1095  int m = ((fl*((fl - hyp_1e3)/1000 - 1)/500)/v + 1)/2;
1096  int m2 = (int)((((double)hyp*(2*fl - hyp_1e3)/1000))/v + 0.5);
1098  }
1099  }
1100  }
1101 
1102  if ((camera_info.dof_values.subject_distance!=dist || (camera_info.dof_values.hyperfocal_distance_1e3!=hyp_1e3)) && (hyp_1e3>0)) {
1103  //calc new NEAR, FAR, DOF values
1104  f_dist_calc = 1;
1109  if ((av_1e3>0) && (fl>0) && (dist>0) && (shooting_is_infinity_distance()==0) && (hyp_1e3>0)) {
1110  double m = ((double)(hyp_1e3 - fl)/1000 * dist) + 0.5;
1113  } else {
1114  int v = ((((hyp_1e3 - 2*fl + 1000*dist)/500) + 1)/2);
1115  if (v>0) camera_info.dof_values.near_limit = (int)(m/v);
1116  }
1117  int v = ((((hyp_1e3 - 1000*dist)/500) + 1)/2);
1118  if (v>0) camera_info.dof_values.far_limit = (int)(m/v);
1121  }
1122  }
1123  }
1126  f_focus_ok = (f_focus_ok && shooting_get_focus_ok());
1129  return;
1130 }
void shooting_video_bitrate_change ( int  v)

Definiert in Zeile 1260 der Datei shooting.c.

1261 {
1262 #if CAM_CHDK_HAS_EXT_VIDEO_MENU
1263  int m[]={1,2,3,4,5,6,7,8,10,12}; // m[v]/4 = bitrate*1x
1264  if (v>=(sizeof(m)/sizeof(m[0])))
1265  v=(sizeof(m)/sizeof(m[0]))-1;
1266  change_video_tables(m[v],4);
1267 #endif
1268 }
void unlock_optical_zoom ( void  )

Definiert in Zeile 1292 der Datei shooting.c.

1293 {
1294 #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1295  extern void UnsetZoomForMovie();
1297  UnsetZoomForMovie();
1298 #endif
1299 
1300 #if CAM_EV_IN_VIDEO
1301  set_ev_video_avail(0);
1302 #endif
1303 }

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 1332 der Datei shooting.c.

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

Definiert in Zeile 1326 der Datei shooting.c.

Definiert in Zeile 1323 der Datei shooting.c.

short canon_iso_base =0
static

Definiert in Zeile 256 der Datei shooting.c.

short canon_sv96_base =0
static

Definiert in Zeile 257 der Datei shooting.c.

volatile long focus_busy
int focus_interlock_bypass = 0
static

Definiert in Zeile 1144 der Datei shooting.c.

const double inv_log_2 = 1.44269504088906
static

Definiert in Zeile 55 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 933 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.