CHDK_DE Vorschauversion  Trunk Rev. 5426
 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 663 der Datei shooting.c.

#define AV96_MIN   (aperture_sizes_table[0].prop_id)

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

#define ISO_MARKET_TO_REAL_MULT   9955

Definiert in Zeile 284 der Datei shooting.c.

#define ISO_MARKET_TO_REAL_ROUND   8192

Definiert in Zeile 286 der Datei shooting.c.

#define ISO_MARKET_TO_REAL_SHIFT   14

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

#define ISO_REAL_TO_MARKET_MULT   3371

Definiert in Zeile 287 der Datei shooting.c.

#define ISO_REAL_TO_MARKET_ROUND   1024

Definiert in Zeile 289 der Datei shooting.c.

#define ISO_REAL_TO_MARKET_SHIFT   11

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

#define tv_override_zero_shift   18

Definiert in Zeile 518 der Datei shooting.c.

Dokumentation der Funktionen

int __attribute__ ( (weak)  )

Definiert in Zeile 1634 der Datei shooting.c.

1635 {
1636  return (playrec_mode==2 || playrec_mode==4 || playrec_mode==5);
1637 }
void bracketing_reset ( )

Definiert in Zeile 1483 der Datei shooting.c.

void bracketing_step ( int  when)

Definiert in Zeile 1490 der Datei shooting.c.

int captseq_hack_override_active ( )

Definiert in Zeile 1518 der Datei shooting.c.

1519 {
1522  return 1;
1523 #if CAM_HAS_IRIS_DIAPHRAGM
1525  return 1;
1526 #endif
1527  }
1528  if(conf.override_disable==1)
1529  return 0;
1531  return 1;
1533  return 1;
1534 #if CAM_HAS_IRIS_DIAPHRAGM
1536  return 1;
1537 #endif
1538  return 0;
1539 }
static short find_canon_shutter_speed ( short  tv96)
static

Definiert in Zeile 557 der Datei shooting.c.

static int find_nearest_shutter_speed_entry ( short  tv96)
static

Definiert in Zeile 536 der Datei shooting.c.

537 {
538  if (tv96 <= shutter_speeds_table[0].prop_id)
539  return 0;
540 
541  int i;
542  for (i=0; i<SS_SIZE-1; i++)
543  {
544  if ((tv96 > shutter_speeds_table[i].prop_id) && (tv96 <= shutter_speeds_table[i+1].prop_id))
545  {
546  if ((tv96 - shutter_speeds_table[i].prop_id) < (shutter_speeds_table[i+1].prop_id - tv96))
547  return i;
548  else
549  return i+1;
550  }
551  }
552 
553  return SS_SIZE-1;
554 }
long get_exposure_counter ( )

Definiert in Zeile 938 der Datei shooting.c.

939 {
940  long v = 0;
942  v = ((v>>4)&0x3FFF);
943  return v;
944 }
long get_file_counter ( )

Definiert in Zeile 931 der Datei shooting.c.

932 {
933  long v = 0;
935  return v;
936 }
int get_movie_status ( )

Definiert in Zeile 1576 der Datei shooting.c.

1577 {
1578 #ifndef CAM_SIMPLE_MOVIE_STATUS
1579  return movie_status;
1580 #else
1581  // firmware movie_status interpreted as: zero - not recording, nonzero - recording
1582  return simple_movie_status?VIDEO_RECORD_IN_PROGRESS:VIDEO_RECORD_STOPPED;
1583 #endif
1584 }
void get_target_dir_name ( char *  dir)

Definiert in Zeile 948 der Datei shooting.c.

948  {
949  extern long get_target_dir_num();
950  sprintf(dir,"A/DCIM/%03dCANON",get_target_dir_num());
951 }
int is_video_recording ( )

Definiert in Zeile 1587 der Datei shooting.c.

1588 {
1589 #ifndef CAM_SIMPLE_MOVIE_STATUS
1590 #if defined(CAM_HAS_MOVIE_DIGEST_MODE)
1591  // If camera has movie digest mode then movie_status values are different than previous models
1592  // 'movie_status' values
1593  // 0 - after startup
1594  // 1 - movie recording stopped
1595  // 4 - movie recording in progress, or in 'movie digest' scene mode
1596  // 5 - movie recording stopping
1597  // 6 - in video mode, not recording
1599 #else
1600  // 'movie_status' values
1601  // 0 - after startup
1602  // 1 - movie recording stopped
1603  // 4 - movie recording in progress
1604  // 5 - movie recording stopping
1605  return (movie_status > 1);
1606 #endif
1607 #else // CAM_SIMPLE_MOVIE_STATUS
1608  return (simple_movie_status!=0);
1609 #endif
1610 }
static void iso_init ( )
static

Definiert in Zeile 473 der Datei shooting.c.

474 {
475  // Get the camera ISO base value, store in global variable 'canon_iso_base'
476  if (iso_table[1-iso_table[0].id].prop_id == 50)
477  canon_iso_base = 50;
478  else
480 
481  // Get the SV96 value corresponding to the base Canon ISO for the camera
482  // Store in global variable 'canon_sv96_base'
484 }
int mode_get ( void  )

Definiert in Zeile 1639 der Datei shooting.c.

1640 {
1641  int mode, t=0xFF;
1642 
1643  mode = (rec_mode_active())?MODE_REC:MODE_PLAY;
1644 
1645 #ifdef CAM_SWIVEL_SCREEN
1646  extern int screen_opened(void); // 0 not open, non-zero open
1647  extern int screen_rotated(void); // 0 not rotated, non-zero rotated
1648 
1649  mode |= (screen_opened())?MODE_SCREEN_OPENED:0;
1650  mode |= (screen_rotated())?MODE_SCREEN_ROTATED:0;
1651 #endif
1652 
1653 #ifdef CAM_SUPPORT_BITMAP_RES_CHANGE
1654  extern void update_screen_dimensions();
1656 #endif
1657 
1659 #ifdef CAM_MASK_VID_REC_ACTIVE
1661 #else
1662  mode |= shooting_mode_canon2chdk(t);
1663 #endif
1664 
1665  // Set camera state variables from mode info
1669  camera_info.state.mode_rec = ((mode & MODE_MASK) == MODE_REC);
1671  camera_info.state.mode_play = ((mode & MODE_MASK) == MODE_PLAY);
1673 
1674 #ifdef CAM_CLEAN_OVERLAY
1675  extern void handle_clean_overlay();
1676  handle_clean_overlay();
1677 #endif
1678 
1679  return (mode);
1680 }
int mode_is_video ( int  m)

Definiert in Zeile 1613 der Datei shooting.c.

1614 {
1615  m = m & MODE_SHOOTING_MASK;
1616  return (m==MODE_VIDEO_STD ||
1617  m==MODE_VIDEO_SPEED ||
1618  m==MODE_VIDEO_COMPACT ||
1625  m==MODE_VIDEO_M ||
1628  // not clear if this should be considered a video mode ?
1629  // m==MODE_VIDEO_MOVIE_DIGEST
1630  );
1631 }
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 1004 der Datei shooting.c.

1005 { return ( 0
1006 #ifdef CAM_SD_OVER_IN_AF
1007  + 1
1008 #endif
1009 #ifdef CAM_SD_OVER_IN_AFL
1010  + 2
1011 #endif
1012 #ifdef CAM_SD_OVER_IN_MF
1013  + 4
1014 #endif
1015 ); }
void set_focus_bypass ( int  m)

Definiert in Zeile 1269 der Datei shooting.c.

1270 {
1272 }
static void set_iso_mode ( int  i)
static

Definiert in Zeile 380 der Datei shooting.c.

381 {
382  short vv = iso_table[i].prop_id;
383  set_property_case(PROPCASE_ISO_MODE, &vv, sizeof(vv));
384 }
void set_movie_status ( int  status)

Definiert in Zeile 1547 der Datei shooting.c.

1548 {
1549 #ifndef CAM_SIMPLE_MOVIE_STATUS
1550  switch(status)
1551  {
1552  case 1:
1554  {
1556  }
1557  break;
1558  case 2:
1560  {
1562  }
1563  break;
1564  case 3:
1566  {
1568  }
1569  break;
1570  }
1571 #else // CAM_SIMPLE_MOVIE_STATUS
1572  // no known way to control the recording process
1573 #endif
1574 }
static void shooting_av_bracketing ( int  when)
static

Definiert in Zeile 1407 der Datei shooting.c.

1408 {
1409  // first shot? (actually this is called just after the first shot has been taken)
1410  if (bracketing.shoot_counter == 0)
1411  {
1414  else
1417  }
1418 
1419  // Adjust delta AV value for shot based on shot number
1421  // Calculate new AV (note, need to subtract delta because higher values are smaller apertures / darker images)
1423 
1424  // Inc for next shot
1426 
1427  // Apply value for next shot to be taken
1428  if (value != bracketing.av96)
1429  {
1430  shooting_set_av96_direct(value, when);
1431 #ifdef CAM_AV_OVERRIDE_IRIS_FIX
1432  extern int MoveIrisWithAv(short*);
1433  MoveIrisWithAv(&value);
1434 #endif
1435  }
1436 }
void shooting_bracketing ( void  )

Definiert in Zeile 1498 der Datei shooting.c.

short shooting_can_focus ( )

Definiert in Zeile 1177 der Datei shooting.c.

1178 {
1179  if(camera_info.state.mode_play) return 0 ; // don't focus in playback mode
1180 
1181  if(focus_interlock_bypass) return 1; // checks disabled, allow
1182 
1183  if( camera_info.state.mode_video == 1) return 1; // FIXME : default to MF enabled in video mode for now
1184 
1185 #ifdef CAM_SD_OVER_IN_AFL
1186  if (shooting_get_prop(PROPCASE_AF_LOCK)==1 ) return 1; // allow focus if AFL enabled and camera can focus that way?
1187 #endif
1188 #ifdef CAM_SD_OVER_IN_MF
1189  if (shooting_get_prop(PROPCASE_FOCUS_MODE)==1 ) return 1; // allow focus if MF enabled and camera can focus that way?
1190 #endif
1191 
1192 #ifdef CAM_SD_OVER_IN_AF
1193 #ifdef PROPCASE_CONTINUOUS_AF
1194  if (shooting_get_prop(PROPCASE_CONTINUOUS_AF)) return 0; // don't focus in continuous AF mode,
1195 #endif
1196 #ifdef PROPCASE_SERVO_AF
1197  if (shooting_get_prop(PROPCASE_SERVO_AF)) return 0; // don't focus in servo AF mode
1198 #endif
1199  if ( (shooting_get_prop(PROPCASE_AF_LOCK)==0) // allow focus when in AF mode (i.e AFL or MF not enabled)?
1200  && (shooting_get_prop(PROPCASE_FOCUS_MODE)==0 )) return 1;
1201 #endif
1202  return 0;
1203 }
void shooting_expo_iso_override_thumb ( void  )

Definiert in Zeile 1842 der Datei shooting.c.

1843 {
1845  {
1847  // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override
1848  }
1849  else if (is_iso_override_enabled)
1853 
1854 #if defined(CAM_HAS_ND_FILTER) && defined(CAM_HAS_NATIVE_ND_FILTER)
1856  {
1858  //photo_param_put_off.nd_filter=0;
1859  }
1860  else if (conf.nd_filter_state && !(conf.override_disable==1))
1862 #endif
1863 
1864  // Set flash mode & override
1866 }
void shooting_expo_param_override_thumb ( void  )

Definiert in Zeile 1776 der Datei shooting.c.

1777 {
1779  {
1782  }
1783  else if (is_tv_override_enabled)
1784  {
1786  }
1787 
1789  {
1792  }
1793  else if (is_iso_override_enabled)
1797 
1799  {
1802  }
1803  else if (is_av_override_enabled)
1805 
1807  {
1810  }
1811  else if (is_sd_override_enabled)
1813 
1814 #if CAM_HAS_ND_FILTER
1816  {
1819  }
1820  else if (conf.nd_filter_state && !(conf.override_disable==1))
1822 #endif
1823 
1824 #if CAM_REAR_CURTAIN
1825  shooting_set_flash_sync_curtain(conf.flash_sync_curtain);
1826 #endif
1827 
1828  // Set flash mode & override
1830 
1831 #if CAM_QUALITY_OVERRIDE
1832  // this doesn't really need to be set in the override hook.
1833  // should only need to be set once if the users doesn't change back, but doing it here ensures it is set
1834  shooting_set_image_quality(conf.fast_image_quality);
1835 #endif
1836 
1838 }
int shooting_get_aperture_from_av96 ( short  av96)

Definiert in Zeile 670 der Datei shooting.c.

671 {
672  if (av96)
673  return (short)((pow(2, ((double)av96)/192.0))*1000.0 + 0.5);
674  return -1;
675 }
short shooting_get_aperture_sizes_table_size ( )

Definiert in Zeile 666 der Datei shooting.c.

666 { return AS_SIZE; }
short shooting_get_av96 ( )

Definiert in Zeile 665 der Datei shooting.c.

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

Definiert in Zeile 677 der Datei shooting.c.

678 {
679  return (int)((log((double)aperture/1000.0) * 192 * inv_log_2) + 0.5);
680 }
short shooting_get_av96_override_value ( )

Definiert in Zeile 683 der Datei shooting.c.

684 {
687  return (short) (AV96_MAX+32*(conf.av_override_value-AS_SIZE+1));
688 }
short shooting_get_bv96 ( )

Definiert in Zeile 100 der Datei shooting.c.

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

Definiert in Zeile 268 der Datei shooting.c.

short shooting_get_canon_overexposure_value ( )

Definiert in Zeile 101 der Datei shooting.c.

int shooting_get_canon_raw_enabled ( )

Definiert in Zeile 114 der Datei shooting.c.

114  {
115 #ifdef CAM_HAS_CANON_RAW
116 #ifdef PROPCASE_IMAGE_FORMAT
117  return (shooting_get_prop(PROPCASE_IMAGE_FORMAT) != 1); // 0 = raw, 2 = raw+jpeg
118 #else
119  return (shooting_get_prop(PROPCASE_RESOLUTION) == 5); // resolution 5 = raw, jpeg controlled with another prop
120 #endif
121 #else
122  return 0;
123 #endif
124 }
int shooting_get_canon_subject_distance ( )

Definiert in Zeile 1054 der Datei shooting.c.

1055 {
1058  else
1059  return (lens_get_focus_pos_from_lens());
1060 }
short shooting_get_common_focus_mode ( )

Definiert in Zeile 1205 der Datei shooting.c.

1206 {
1207 #if !CAM_HAS_MANUAL_FOCUS
1208  return conf.subj_dist_override_koef; // SD override state 0=OFF, 1=ON, 2=Infinity if camera has no native MF mode
1209 #else
1210  return shooting_get_focus_mode(); // 0=Auto, 1=manual
1211 #endif
1212 }
int shooting_get_digital_zoom_state ( void  )

Definiert in Zeile 147 der Datei shooting.c.

148 {
149 #if CAM_PROPSET == 7 || CAM_PROPSET == 9 || CAM_PROPSET == 10 || CAM_PROPSET == 11 || CAM_PROPSET == 12
150  // PS7 doesn't have _STATE, combines values
152  if(x==1) {
153  return 1;
154  }
155  return 0;
156 #else
158 #endif
159 }
short shooting_get_display_mode ( )

Definiert in Zeile 107 der Datei shooting.c.

short shooting_get_drive_mode ( )

Definiert in Zeile 188 der Datei shooting.c.

189 {
190  // these cameras do not set PROPCASE_DRIVE_MODE when in custom timer mode
191  // SX 200 IS 0,1,2,3,4=Off, 2 Second, Custom, Face Detection
192 #if defined (CAM_DRIVE_MODE_FROM_TIMER_MODE)
194  // note we return this only in custom mode.
195  // Other cameras would return 3 if any timer mode is set (?) even if it doesn't do multiple exposures
196  // note that face detect does multiple exposure
197  if (m == 3)
198  return m;
199 #endif
200 
202 }
short shooting_get_ev_correction1 ( )

Definiert in Zeile 104 der Datei shooting.c.

short shooting_get_ev_correction2 ( )

Definiert in Zeile 105 der Datei shooting.c.

int shooting_get_exif_subject_dist ( )

Definiert in Zeile 109 der Datei shooting.c.

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

Definiert in Zeile 1039 der Datei shooting.c.

1040 {
1041  if (shooting_is_infinity_distance()) return (-1);
1042  int h_1e3 = shooting_get_hyperfocal_distance_1e3_f(av, fl);
1043  double m = ((double)(h_1e3 - fl)+500)/1000*s;
1044  int v = ((h_1e3 - 1000*s)+500)/1000;
1045  if ((m>0) && (v>0)) return (int)((2*m/v+1)/2);
1046  else return (-1);
1047 }
short shooting_get_flash_mode ( )

Definiert in Zeile 102 der Datei shooting.c.

short shooting_get_focus_mode ( )

Definiert in Zeile 103 der Datei shooting.c.

short shooting_get_focus_ok ( )

Definiert in Zeile 183 der Datei shooting.c.

184 {
185  return ((shooting_get_focus_state()!=0) && shooting_in_progress());
186 }
short shooting_get_focus_state ( )

Definiert in Zeile 176 der Datei shooting.c.

177 {
178  if (shooting_get_focus_mode()==1) return -1;
180  return (short) m;
181 }
int shooting_get_hyperfocal_distance ( )

Definiert in Zeile 1169 der Datei shooting.c.

1170 {
1173 }
int shooting_get_hyperfocal_distance_1e3_f ( int  av,
int  fl 
)

Definiert in Zeile 1022 der Datei shooting.c.

1023 {
1024  if ((av>0) && (fl>0) && (camera_info.circle_of_confusion>0))
1025  return (int)(((((double)fl*fl)/(av*camera_info.circle_of_confusion)*1000)+fl)+0.5);
1026  else return (-1);
1027 }
int shooting_get_imager_active ( )

Definiert in Zeile 126 der Datei shooting.c.

126  {
127  extern int imager_active;
128  return imager_active;
129 }
short shooting_get_is_mode ( )

Definiert in Zeile 99 der Datei shooting.c.

short shooting_get_iso_from_sv96 ( short  sv96)

Definiert in Zeile 303 der Datei shooting.c.

304 {
305  // APEX equation --> (int)(POWER(2,(iso/96)) * 3.125) + 0.5)
306  return (short)( (double)pow(2, (((double)sv96)/96.0))*100.0/32.0 + 0.5 );
307 }
short shooting_get_iso_market ( )

Definiert in Zeile 372 der Datei shooting.c.

373 {
375  if (sv == 0)
376  return 0;
377  return shooting_get_iso_from_sv96(sv);
378 }
int shooting_get_iso_mode ( )

Definiert in Zeile 351 der Datei shooting.c.

352 {
353  short isov = shooting_get_canon_iso_mode();
354  long i;
355  for (i=0;i<ISO_SIZE;i++)
356  {
357  if (iso_table[i].prop_id == isov)
358  return iso_table[i].id;
359  }
360  return 0;
361 }
short shooting_get_iso_override_value ( )

Definiert in Zeile 329 der Datei shooting.c.

330 {
331  short iso = conf.iso_override_value; // Start with market value
332  // Apply limits if needed
333 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
334  // Limit max ISO in HQ burst mode (also done in shooting_set_iso_real; but done here so OSD display value is correct)
337 #endif
338 #ifdef CAM_MIN_ISO_OVERRIDE
339  // Limit min (non-zero) ISO
340  // Some cameras will crash if flash used and ISO set lower than this value (most easily tested in AUTO mode)
341  if ((iso > 0) && (iso < CAM_MIN_ISO_OVERRIDE)) iso = CAM_MIN_ISO_OVERRIDE;
342 #endif
343 #ifdef CAM_MAX_ISO_OVERRIDE
344  // Limit max ISO
345  // Some cameras will crash if ISO set higher than this value (dependence on flash is unclear)
347 #endif
348  return shooting_iso_market_to_real(iso); // return real value (after limits applied)
349 }
short shooting_get_iso_real ( )

Definiert in Zeile 363 der Datei shooting.c.

364 {
365  short sv = shooting_get_sv96_real();
366  if (sv == 0)
367  return 0;
368  return shooting_get_iso_from_sv96(sv);
369 }
int shooting_get_lens_to_focal_plane_width ( )

Definiert in Zeile 1017 der Datei shooting.c.

1018 {
1020 }
int shooting_get_luminance ( )

Definiert in Zeile 959 der Datei shooting.c.

960 {
961  short bv = shooting_get_bv96();
962  int b = (int)(100 * K * pow(2.0,((double)(bv-168)/96.0)));
963  return b;
964 }
short shooting_get_max_av96 ( )

Definiert in Zeile 886 der Datei shooting.c.

887 {
888 #if CAM_HAS_IRIS_DIAPHRAGM
889  extern short GetUsableMinAv(void);
891  {
892  return -1;
893  }
894  return GetUsableMinAv();
895 #else
896  return -1;
897 #endif
898 }
short shooting_get_min_av96 ( )

Definiert in Zeile 872 der Datei shooting.c.

873 {
874 #if CAM_HAS_IRIS_DIAPHRAGM
875  extern short GetUsableMaxAv(void);
877  {
878  return -1;
879  }
880  return GetUsableMaxAv();
881 #else
882  return -1;
883 #endif
884 }
static int shooting_get_min_real_aperture ( )
static

Definiert in Zeile 695 der Datei shooting.c.

696 {
697  short av96;
698  get_property_case(PROPCASE_MIN_AV, &av96, sizeof(av96));
699  if (av96)
700  return shooting_get_aperture_from_av96(av96);
702 }
int shooting_get_near_limit_f ( int  s,
int  av,
int  fl 
)

Definiert in Zeile 1029 der Datei shooting.c.

1030 {
1031  if (shooting_is_infinity_distance()) return (-1);
1032  int h_1e3 = shooting_get_hyperfocal_distance_1e3_f(av, fl);
1033  double m = ((double)(h_1e3 - fl)+500)/1000*s;
1034  int v = ((h_1e3 - 2*fl + 1000*s)+500)/1000;
1035  if ((m>0) && (v>0)) return (int)((2*m/v+1)/2);
1036  else return (-1);
1037 }
int shooting_get_prop ( int  id)

Definiert in Zeile 78 der Datei shooting.c.

79 {
80  short vv;
81  get_property_case(id, &vv, sizeof(vv));
82  return vv;
83 }
static int shooting_get_prop_int ( int  id)
static

Definiert in Zeile 85 der Datei shooting.c.

86 {
87  int vv;
88  get_property_case(id, &vv, sizeof(vv));
89  return vv;
90 }
int shooting_get_real_aperture ( )

Definiert in Zeile 690 der Datei shooting.c.

short shooting_get_real_focus_mode ( )

Definiert in Zeile 168 der Datei shooting.c.

169 {
170  short f = shooting_get_focus_mode();
172  if (f==0 && m!=0) f=(m==1)?4:m;
173  return f;
174 }
short shooting_get_resolution ( )

Definiert in Zeile 106 der Datei shooting.c.

float shooting_get_shutter_speed_from_tv96 ( short  tv96)

Definiert in Zeile 509 der Datei shooting.c.

510 {
511  return pow(2,((float)(-tv96))/96.0);
512 }
int shooting_get_subject_distance ( )

Definiert in Zeile 1163 der Datei shooting.c.

1164 {
1167 }
int shooting_get_subject_distance_ ( )
int shooting_get_subject_distance_override_value ( )
short shooting_get_sv96_delta ( )

Definiert in Zeile 271 der Datei shooting.c.

short shooting_get_sv96_from_iso ( short  iso)

Definiert in Zeile 295 der Datei shooting.c.

296 {
297  // Equivalent to (short)(log2(iso/3.125)*96+0.5) [APEX equation]
298  if (iso > 0)
299  return (short)( log((double)(iso)*32.0/100.0)*96.0*(inv_log_2)+0.5 );
300  return 0;
301 }
short shooting_get_sv96_market ( )

Definiert in Zeile 269 der Datei shooting.c.

short shooting_get_sv96_real ( )

Definiert in Zeile 270 der Datei shooting.c.

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

Definiert in Zeile 493 der Datei shooting.c.

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

Definiert in Zeile 497 der Datei shooting.c.

498 {
499  if (t > 0)
500  {
501  t = ((96.0 * -log(t)) * inv_log_2);
502  if (t < 0)
503  return (short)(t - 0.5);
504  return (short)(t + 0.5);
505  }
506  return SHOOTING_TV96_INVALID;
507 }
static int shooting_get_tv96_override_value ( )
static

Definiert in Zeile 522 der Datei shooting.c.

523 {
524  // Calculate the tv96 value for the tv override
529  else
531 }
short shooting_get_user_av96 ( )

Definiert in Zeile 765 der Datei shooting.c.

766 {
767 #if CAM_HAS_IRIS_DIAPHRAGM
769 #else
770  return 0;
771 #endif
772 }
int shooting_get_user_av_id ( )

Definiert in Zeile 774 der Datei shooting.c.

775 {
776 #if CAM_HAS_IRIS_DIAPHRAGM
777  return aperture_sizes_table[find_nearest_aperture_entry(shooting_get_user_av96())].prop_id;
778 #else
779  return 0;
780 #endif
781 }
short shooting_get_user_tv96 ( )

Definiert in Zeile 586 der Datei shooting.c.

587 {
588 #if CAM_HAS_USER_TV_MODES
590 #else
591  return 0;
592 #endif
593 }
int shooting_get_user_tv_id ( )

Definiert in Zeile 595 der Datei shooting.c.

596 {
597 #if CAM_HAS_USER_TV_MODES
599 #else
600  return 0;
601 #endif
602 }
int shooting_get_zoom ( )

Definiert in Zeile 204 der Datei shooting.c.

205 {
206  return lens_get_zoom_point();
207 }
int shooting_in_progress ( )

Definiert in Zeile 111 der Datei shooting.c.

void shooting_init ( )

Definiert in Zeile 907 der Datei shooting.c.

908 {
910  iso_init();
911 }
int shooting_is_flash ( )

Definiert in Zeile 110 der Datei shooting.c.

int shooting_is_flash_ready ( )

Definiert in Zeile 1214 der Datei shooting.c.

1215 {
1216  int t = shooting_get_flash_mode();
1217  if ((t != 2) && (shooting_in_progress()))
1218  if (shooting_is_flash())
1219  return IsStrobeChargeCompleted();
1220  return 1;
1221 }
short shooting_is_infinity_distance ( )

Definiert in Zeile 1049 der Datei shooting.c.

1050 {
1051  return (shooting_get_lens_to_focal_plane_width() == 0)?1:0;
1052 }
static void shooting_iso_bracketing ( int  when)
static

Definiert in Zeile 1438 der Datei shooting.c.

1439 {
1440  // first shot? (actually this is called just after the first shot has been taken)
1441  if (bracketing.shoot_counter == 0)
1442  {
1445  }
1446 
1447  // Adjust delta ISO value for shot based on shot number
1449  // Calculate new ISO (higher ISO = brighter image)
1451  if (value <= 0) value = 50;
1452 
1453  // Inc for next shot
1455 
1456  // Apply value for next shot to be taken
1457  shooting_set_iso_real(value, when);
1458 }
short shooting_iso_market_to_real ( short  isom)

Definiert in Zeile 309 der Datei shooting.c.

310 {
311  return ISO_MARKET_TO_REAL(isom);
312 }
short shooting_iso_real_to_market ( short  isor)

Definiert in Zeile 314 der Datei shooting.c.

315 {
316  return ISO_REAL_TO_MARKET(isor);
317 }
int shooting_mode_canon2chdk ( int  canonmode)

Definiert in Zeile 980 der Datei shooting.c.

981 {
982  int i;
983  for (i=0; i < MODESCNT; i++)
984  {
985  if (modemap[i].canonmode == canonmode)
986  return modemap[i].hackmode;
987  }
988  return 0;
989 }
int shooting_mode_chdk2canon ( int  hackmode)

Definiert in Zeile 991 der Datei shooting.c.

992 {
993  int i;
994  for (i=0; i < MODESCNT; i++)
995  {
996  if (modemap[i].hackmode == hackmode)
997  return modemap[i].canonmode;
998  }
999  return -1; // 0 is a valid mode on old cameras!
1000 }
void shooting_set_av96 ( short  av96,
short  is_now 
)

Definiert in Zeile 755 der Datei shooting.c.

756 {
757 #if CAM_HAS_IRIS_DIAPHRAGM
759  shooting_set_av96_direct(find_canon_aperture(av96), is_now);
760 #endif
761 }
void shooting_set_av96_direct ( short  av96,
short  is_now 
)

Definiert in Zeile 737 der Datei shooting.c.

738 {
739 #if CAM_HAS_IRIS_DIAPHRAGM
741  {
742  if(is_now)
743  {
744  set_property_case(PROPCASE_AV, &av96, sizeof(av96));
745 #ifdef PROPCASE_AV2
746  set_property_case(PROPCASE_AV2, &av96, sizeof(av96)); // Save override to property that will update JPEG header & Canon OSD
747 #endif
748  }
749  else
750  photo_param_put_off.av96 = av96;
751  }
752 #endif
753 }
static void shooting_set_flash_override ( )
static

Definiert in Zeile 1744 der Datei shooting.c.

1745 {
1746  int mode, flash, power;
1747  flash = 1;
1748 
1749  // Set flash mode & override
1751  {
1753  {
1754  mode = 1; // Manual flash
1756  set_property_case(PROPCASE_FLASH_ADJUST_MODE, &mode, sizeof(mode));
1757  set_property_case(PROPCASE_FLASH_FIRE, &flash, sizeof(flash));
1758  set_property_case(PROPCASE_FLASH_MANUAL_OUTPUT, &power, sizeof(power));
1759  }
1760  else if (conf.flash_enable_exp_comp)
1761  {
1762  mode = 0; // Auto flash
1763  power = (conf.flash_exp_comp - 9) * 32;
1764  set_property_case(PROPCASE_FLASH_ADJUST_MODE, &mode, sizeof(mode));
1765  set_property_case(PROPCASE_FLASH_FIRE, &flash, sizeof(flash));
1766 #if defined(PROPCASE_FLASH_EXP_COMP)
1767  set_property_case(PROPCASE_FLASH_EXP_COMP, &power, sizeof(power));
1768 #endif
1769 #if defined(PROPCASE_EXT_FLASH_EXP_COMP)
1770  set_property_case(PROPCASE_EXT_FLASH_EXP_COMP, &power, sizeof(power));
1771 #endif
1772  }
1773  }
1774 }
void shooting_set_focus ( int  v,
short  is_now 
)

Definiert in Zeile 1274 der Datei shooting.c.

1275 {
1276  int s=v;
1278  {
1279  if (is_now && shooting_can_focus())
1280  {
1282  {
1284  }
1285  if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST))
1287  lens_set_focus_pos(s);
1288  }
1289  else
1291  }
1292 }
void shooting_set_iso_mode ( int  v)

Definiert in Zeile 386 der Datei shooting.c.

387 {
388  int i;
389  if (v < 50) // CHDK ID
390  {
391  for (i=0; i<ISO_SIZE; i++)
392  {
393  if (iso_table[i].id == v)
394  {
395  set_iso_mode(i);
396  return;
397  }
398  }
399  }
400  else // ISO value - find nearest entry in iso_table and set iso mode to that value
401  {
402  if (v <= iso_table[0].prop_id) // In case no AUTO (0) entry
403  {
404  set_iso_mode(0);
405  return;
406  }
407  for (i=0; i<ISO_SIZE-1; i++)
408  {
409  if ((v > iso_table[i].prop_id) && (v <= iso_table[i+1].prop_id))
410  {
411  if ((v - iso_table[i].prop_id) < (iso_table[i+1].prop_id - v))
412  set_iso_mode(i);
413  else
414  set_iso_mode(i+1);
415  return;
416  }
417  }
418  set_iso_mode(ISO_SIZE-1);
419  }
420 }
void shooting_set_iso_real ( short  iso,
short  is_now 
)

Definiert in Zeile 449 der Datei shooting.c.

450 {
452  {
453  if (iso > 0)
454  {
455 #ifdef CAM_ISO_LIMIT_IN_HQ_BURST
456  // Limit max ISO in HQ burst mode
459 #endif
460 #ifdef CAM_MIN_ISO_OVERRIDE
461  // Limit min (non-zero) ISO
463 #endif
464 #ifdef CAM_MAX_ISO_OVERRIDE
465  // Limit max ISO
467 #endif
469  }
470  }
471 }
int shooting_set_mode_canon ( int  canonmode)

Definiert in Zeile 1339 der Datei shooting.c.

1340 {
1341  if (canonmode == -1 || !rec_mode_active())
1342  return 0;
1343  SetCurrentCaptureModeType(canonmode);
1344  // updated cached mode information immediately
1345  mode_get();
1346  return 1;
1347 }
int shooting_set_mode_chdk ( int  mode)

Definiert in Zeile 1349 der Datei shooting.c.

1350 {
1352 }
void shooting_set_nd_filter_state ( short  v,
short  is_now 
)

Definiert in Zeile 833 der Datei shooting.c.

834 {
835 #if CAM_HAS_ND_FILTER
837  {
838  if (is_now)
839  {
840 #if defined(CAM_ND_SET_AV_VALUE)
841  short av;
842  get_property_case(PROPCASE_MIN_AV,&av,sizeof(av));
843  if(v==1) {
845  }
846  set_property_case(PROPCASE_AV, &av, sizeof(av));
847 #if defined(PROPCASE_AV2)
848  set_property_case(PROPCASE_AV2, &av, sizeof(av));
849 #endif
850 #endif
851  if (v==1) {
852  PutInNdFilter();
853  }
854  else if (v==2)
855  PutOutNdFilter();
856 #if defined(CAM_HAS_NATIVE_ND_FILTER) && defined(PROPCASE_ND_FILTER_STATE)
857  int n = (v==1) ? 1 : 0;
859 #endif
860  }
861  else
863  }
864 #endif
865 }
void shooting_set_playrec_mode ( int  mode)

Definiert in Zeile 1872 der Datei shooting.c.

1873 {
1874  // use PTP compatible switch if usb bit power detected, and USB remote not configured to use USB
1875  // TODO should just check the USB bit seen by canon firmware (after masking)
1877  {
1879  return;
1880  }
1881  if(mode)
1883  else
1884  levent_set_play();
1885 }
void shooting_set_prop ( int  id,
int  v 
)

Definiert in Zeile 92 der Datei shooting.c.

93 {
94  short vv = v;
95  set_property_case(id, &vv, sizeof(vv));
96  return;
97 }
void shooting_set_sv96 ( short  sv96,
short  is_now 
)

Definiert in Zeile 422 der Datei shooting.c.

423 {
425  {
426  if (is_now)
427  {
428  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
429 
430  short iso_mode = shooting_get_canon_iso_mode();
431  if (iso_mode >= 50) {
432  // save current ISO mode, to avoid leaving in auto after override done
433  // only needed for non-auto
434  iso_override_mode_save = iso_mode;
435  shooting_set_iso_mode(0); // Force AUTO mode on camera
436  }
437 
438  short dsv96 = sv96 + SV96_MARKET_OFFSET - canon_sv96_base;
439 
440  set_property_case(PROPCASE_SV_MARKET, &canon_sv96_base, sizeof(canon_sv96_base));
441  set_property_case(PROPCASE_SV, &sv96, sizeof(sv96));
442  set_property_case(PROPCASE_DELTA_SV, &dsv96, sizeof(dsv96));
443  }
444  else
445  photo_param_put_off.sv96 = sv96;
446  }
447 }
void shooting_set_tv96 ( short  tv96,
short  is_now 
)

Definiert in Zeile 578 der Datei shooting.c.

579 {
582 }
void shooting_set_tv96_direct ( short  tv96,
short  is_now 
)

Definiert in Zeile 562 der Datei shooting.c.

563 {
565  {
566  if(is_now)
567  {
568  set_property_case(PROPCASE_TV, &tv96, sizeof(tv96));
569 #ifdef PROPCASE_TV2
570  set_property_case(PROPCASE_TV2, &tv96, sizeof(tv96)); // Save override to property that will update JPEG header & Canon OSD
571 #endif
572  }
573  else
574  photo_param_put_off.tv96 = tv96;
575  }
576 }
void shooting_set_user_av96 ( short  av96)

Definiert in Zeile 813 der Datei shooting.c.

814 {
815 #if CAM_HAS_IRIS_DIAPHRAGM
817  {
818  av96 = find_canon_aperture(av96);
819  set_property_case(PROPCASE_USER_AV, &av96, sizeof(av96));
820  }
821 #endif
822 }
void shooting_set_user_av_by_id ( int  v)

Definiert in Zeile 783 der Datei shooting.c.

784 {
785 #if CAM_HAS_IRIS_DIAPHRAGM
786  long i;
788  {
789  for (i=0;i<AS_SIZE;i++)
790  {
791  if (aperture_sizes_table[i].id == v)
792  {
793  short vv = aperture_sizes_table[i].prop_id;
794  set_property_case(PROPCASE_USER_AV, &vv, sizeof(vv));
795  return;
796  }
797  }
798  }
799 #endif
800 }
void shooting_set_user_av_by_id_rel ( int  v)

Definiert in Zeile 802 der Datei shooting.c.

803 {
804 #if CAM_HAS_IRIS_DIAPHRAGM
806  {
807  int cv = shooting_get_user_av_id();
809  }
810 #endif
811 }
void shooting_set_user_tv96 ( short  tv96)

Definiert in Zeile 634 der Datei shooting.c.

635 {
636 #if CAM_HAS_USER_TV_MODES
638  {
639  tv96 = find_canon_shutter_speed(tv96);
640  set_property_case(PROPCASE_USER_TV, &tv96, sizeof(tv96));
641  }
642 #endif
643 }
void shooting_set_user_tv_by_id ( int  v)

Definiert in Zeile 604 der Datei shooting.c.

605 {
606 #if CAM_HAS_USER_TV_MODES
608  {
609  long i;
610  for (i=0;i<SS_SIZE;i++)
611  {
612  if (shutter_speeds_table[i].id == v)
613  {
614  short vv = shutter_speeds_table[i].prop_id;
615  set_property_case(PROPCASE_USER_TV, &vv, sizeof(vv));
616  return;
617  }
618  }
619  }
620 #endif
621 }
void shooting_set_user_tv_by_id_rel ( int  v)

Definiert in Zeile 623 der Datei shooting.c.

624 {
625 #if CAM_HAS_USER_TV_MODES
627  {
628  int cv = shooting_get_user_tv_id();
630  }
631 #endif
632 }
void shooting_set_zoom ( int  v)

Definiert in Zeile 1236 der Datei shooting.c.

1237 {
1239  {
1240 #if CAM_REFOCUS_AFTER_ZOOM
1241  int dist = shooting_get_subject_distance();
1243 #if defined(CAM_NEED_SET_ZOOM_DELAY)
1245 #endif
1246  shooting_set_focus(dist, SET_NOW);
1247 #else // CAM_REFOCUS_AFTER_ZOOM
1249 #endif // CAM_REFOCUS_AFTER_ZOOM
1250  }
1251 }
void shooting_set_zoom_rel ( int  v)

Definiert in Zeile 1253 der Datei shooting.c.

1254 {
1255  int cv = shooting_get_zoom();
1257  {
1258  shooting_set_zoom(cv+v);
1259  }
1260 }
void shooting_set_zoom_speed ( int  v)

Definiert in Zeile 1262 der Datei shooting.c.

1262  {
1264  {
1266  }
1267 }
static void shooting_subject_distance_bracketing ( int  when)
static

Definiert in Zeile 1460 der Datei shooting.c.

1461 {
1462  // first shot? (actually this is called just after the first shot has been taken)
1463  if (bracketing.shoot_counter == 0)
1464  {
1467  }
1468 
1469  // Adjust delta SD value for shot based on shot number
1471  // Calculate new SD
1473  if (value < CAMERA_MIN_DIST) value = CAMERA_MIN_DIST;
1474  else if (value > CAMERA_MAX_DIST) value = CAMERA_MAX_DIST;
1475 
1476  // Inc for next shot
1478 
1479  // Apply value for next shot to be taken
1480  shooting_set_focus(value, when);
1481 }
short shooting_sv96_market_to_real ( short  sv96)

Definiert in Zeile 319 der Datei shooting.c.

320 {
321  return sv96 - SV96_MARKET_OFFSET;
322 }
short shooting_sv96_real_to_market ( short  sv96)

Definiert in Zeile 324 der Datei shooting.c.

325 {
326  return sv96 + SV96_MARKET_OFFSET;
327 }
static void shooting_tv_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  {
1378  // if Tv override is enabled... (this was adapted from function shooting_expo_param_override() )
1380  {
1381  // ...use Tv override value as seed for bracketing:
1383  }
1384  // Tv override is disabled, use camera's opinion of Tv for bracketing seed value.
1385  else
1386  {
1389  else
1391  }
1393  }
1394 
1395  // Adjust delta TV value for shot based on shot number
1397  // Calculate new TV (note, need to subtract delta because higher values are shorter shutter speeds / darker images)
1399 
1400  // Inc for next shot
1402 
1403  // Apply value for next shot to be taken
1404  shooting_set_tv96_direct(value, when);
1405 }
void shooting_update_dof_values ( )

Definiert in Zeile 1070 der Datei shooting.c.

1071 {
1072  int hyp, hyp_1e3, av_1e3, v;
1073  int dist = shooting_get_subject_distance_();
1074  int zoom_point = lens_get_zoom_point();
1075  int fl = get_focal_length(zoom_point);
1076  short f_focus_ok = shooting_get_focus_ok();
1077  short f_hyp_calc = 0, f_dist_calc = 0;
1078  short min_av96_zoom_point = 0;
1079  short av96 = shooting_get_user_av96();
1080  short curr_av96 = shooting_get_current_av96();
1081  short prop_av96 = shooting_get_av96();
1082  short min_av96;
1083 
1084  if (!min_av96_zoom_point_tbl) {
1085  min_av96_zoom_point_tbl = (short *) malloc(zoom_points * sizeof(short));
1087  memset(min_av96_zoom_point_tbl, 0, zoom_points * sizeof(short));
1088  }
1089  else {
1090  return;
1091  }
1092  } else min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];
1093 
1094  if (min_av96_zoom_point==0 && shooting_in_progress()) {
1095  get_property_case(PROPCASE_MIN_AV, &min_av96, sizeof(min_av96));
1096  min_av96_zoom_point_tbl[zoom_point] = min_av96;
1097  }
1098 
1099  if ((camera_info.state.mode_shooting==MODE_M || camera_info.state.mode_shooting==MODE_AV) && (av96>0) && !f_focus_ok) {
1100  if (av96 < min_av96_zoom_point) av96 = min_av96_zoom_point;
1101  }
1102  else av96 = (abs(curr_av96-prop_av96)<2)?prop_av96:curr_av96;
1103 
1104  av_1e3 = shooting_get_aperture_from_av96(av96);
1107 
1108  if (camera_info.dof_values.aperture_value!=av_1e3 || camera_info.dof_values.focal_length!=fl || (hyp_1e3<0)) {
1109  //calc new hyperfocal distance and min stack distance
1110  f_hyp_calc = 1;
1111  hyp_1e3 = -1;
1112  hyp = -1;
1115  hyp_1e3 = shooting_get_hyperfocal_distance_1e3_f(av_1e3, fl);
1116  if (hyp_1e3>0) {
1117  hyp = (hyp_1e3+500)/1000;
1119  v = ((hyp_1e3 - fl)/250 + 2 + 1)/2;
1120  if (v>0) {
1121  int m = ((fl*((fl - hyp_1e3)/1000 - 1)/500)/v + 1)/2;
1122  int m2 = (int)((((double)hyp*(2*fl - hyp_1e3)/1000))/v + 0.5);
1124  }
1125  }
1126  }
1127 
1128  if ((camera_info.dof_values.subject_distance!=dist || (camera_info.dof_values.hyperfocal_distance_1e3!=hyp_1e3)) && (hyp_1e3>0)) {
1129  //calc new NEAR, FAR, DOF values
1130  f_dist_calc = 1;
1135  if ((av_1e3>0) && (fl>0) && (dist>0) && (shooting_is_infinity_distance()==0) && (hyp_1e3>0)) {
1136  double m = ((double)(hyp_1e3 - fl)/1000 * dist) + 0.5;
1139  } else {
1140  int v = ((((hyp_1e3 - 2*fl + 1000*dist)/500) + 1)/2);
1141  if (v>0) camera_info.dof_values.near_limit = (int)(m/v);
1142  }
1143  int v = ((((hyp_1e3 - 1000*dist)/500) + 1)/2);
1144  if (v>0) camera_info.dof_values.far_limit = (int)(m/v);
1147  }
1148  }
1149  // if at infinity then set near to hyperfocal value
1150  // note focus beyond infinity is not distinguished from infinity
1153  }
1154  }
1157  f_focus_ok = (f_focus_ok && shooting_get_focus_ok());
1160  return;
1161 }
void shooting_update_state ( void  )

Definiert in Zeile 63 der Datei shooting.c.

64 {
65  // ISO override will set ISO_MODE to auto in halfpress when get_shooting becomes true
66  // or immediately if already in shooting or raw hook for bracketing
67  // if existing ISO mode is not auto, it will be saved to iso_override_mode_save
68  // restore when shooting goes to false
72  }
73 }
void shooting_video_bitrate_change ( int  v)

Definiert in Zeile 1294 der Datei shooting.c.

1295 {
1296 #if CAM_CHDK_HAS_EXT_VIDEO_MENU
1297  int m[]={1,2,3,4,5,6,7,8,10,12}; // m[v]/4 = bitrate*1x
1298  if (v>=(sizeof(m)/sizeof(m[0])))
1299  v=(sizeof(m)/sizeof(m[0]))-1;
1300  change_video_tables(m[v],4);
1301 #endif
1302 }
void unlock_optical_zoom ( void  )

Definiert in Zeile 1326 der Datei shooting.c.

1327 {
1328 #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1329  extern void UnsetZoomForMovie();
1331  UnsetZoomForMovie();
1332 #endif
1333 
1334 #if CAM_EV_IN_VIDEO
1335  set_ev_video_avail(0);
1336 #endif
1337 }

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

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

Definiert in Zeile 1360 der Datei shooting.c.

Definiert in Zeile 1357 der Datei shooting.c.

short canon_iso_base =0
static

Definiert in Zeile 274 der Datei shooting.c.

short canon_sv96_base =0
static

Definiert in Zeile 275 der Datei shooting.c.

volatile long focus_busy
int focus_interlock_bypass = 0
static

Definiert in Zeile 1175 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 957 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.