CHDK_DE Vorschauversion  Trunk Rev. 5293
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
lens.h-Dateireferenz
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Funktionen

long lens_get_zoom_pos ()
 
long lens_get_zoom_point ()
 
void lens_set_zoom_point (long newpt)
 
void lens_set_zoom_speed (long newspd)
 
long lens_get_focus_pos ()
 
long lens_get_focus_pos_from_lens ()
 
void lens_set_focus_pos (long newpos)
 
long lens_get_target_distance ()
 
void DoAFLock (void)
 
void UnlockAF (void)
 
int DoMFLock (void)
 
int UnlockMF (void)
 
int sd_over_modes (void)
 

Dokumentation der Funktionen

void DoAFLock ( void  )

Definiert in Zeile 1220 der Datei wrappers.c.

1221 {
1223  {
1224  int af_lock=1;
1225  _DoAFLock();
1226  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1227  }
1228 }
int DoMFLock ( void  )

Definiert in Zeile 23 der Datei wrappers.c.

24 {
26  _PT_MFOn();
27  return(1);
28  }
29  return(0);
30 }
long lens_get_focus_pos ( )

Definiert in Zeile 3 der Datei wrappers.c.

4 {
6 }
long lens_get_focus_pos_from_lens ( )

Definiert in Zeile 8 der Datei wrappers.c.

9 {
11 }
long lens_get_target_distance ( )

Definiert in Zeile 14 der Datei wrappers.c.

15 {
17 }
long lens_get_zoom_point ( )

Definiert in Zeile 187 der Datei wrappers.c.

188 {
189  return _GetZoomLensCurrentPoint();
190 }
long lens_get_zoom_pos ( )

Definiert in Zeile 182 der Datei wrappers.c.

183 {
185 }
void lens_set_focus_pos ( long  newpos)

Definiert in Zeile 280 der Datei wrappers.c.

281 {
282  if (newpos >= CAMERA_MAX_DIST) newpos = INFINITY_DIST; // Set to infinity value that will work on all cameras
283  _MoveFocusLensToDistance((short*)&newpos);
284  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
285  newpos = _GetFocusLensSubjectDistance();
286  _SetPropertyCase(PROPCASE_SUBJECT_DIST1, &newpos, sizeof(newpos));
287  _SetPropertyCase(PROPCASE_SUBJECT_DIST2, &newpos, sizeof(newpos));
288 }
void lens_set_zoom_point ( long  newpt)

Definiert in Zeile 196 der Datei wrappers.c.

197 {
198  if (newpt < 0) {
199  newpt = 0;
200  } else if (newpt >= zoom_points) {
201  newpt = zoom_points-1;
202  }
203 
204 #if defined(CAM_USE_ALT_SET_ZOOM_POINT)
205 
206  if (lens_get_zoom_point() != newpt)
207  {
208  int digizoom_pos;
209  get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION,&digizoom_pos,sizeof(digizoom_pos));
210  // check current digital zoom mode & state
211  // state == 1 && mode == 0 --> Digital Zoom Standard
212  if ((shooting_get_digital_zoom_state() == 1) && (shooting_get_digital_zoom_mode() == 0) && (digizoom_pos != 0))
213  {
214  // reset digital zoom in case camera is in this zoom range
215  extern void _PT_MoveDigitalZoomToWide();
216  _PT_MoveDigitalZoomToWide();
217  }
218 
219  #if defined(CAM_USE_ALT_PT_MoveOpticalZoomAt)
220  // SX30 - _MoveZoomLensWithPoint crashes camera
221  // _PT_MoveOpticalZoomAt works, and updates PROPCASE_OPTICAL_ZOOM_POSITION; but doesn't wait for zoom to finish
222  // IXUS220, SX220/230 - _MoveZoomLensWithPoint does not notify the JPEG engine of the new focal length,
223  // causing incorrect lens distortion fixes to be applied; _PT_MoveOpticalZoomAt works
224  // _MoveOpticalZoom at is underlying function that accepts speed
225  extern void _MoveOpticalZoomAt(long pt,int speed);
226  _MoveOpticalZoomAt(newpt,mz_speed);
227  #else
228  _MoveZoomLensWithPoint((short*)&newpt);
229  #endif
230 
231  // have to sleep here, zoom_busy set in another task, without sleep this will hang
232  while (zoom_busy) msleep(10);
233 
234  // g10,g12 & sx30 only use this value for optical zoom
236 
237  #if !defined(CAM_USE_ALT_PT_MoveOpticalZoomAt)
238  _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt));
239  #endif
240  }
241 #else // !(CAM_USE_ALT_SET_ZOOM_POINT)
242  _MoveZoomLensWithPoint((short*)&newpt);
243 
244  // tight loop here hangs some cameras (the task that clears zoom_busy
245  // is starved; seen at least on S95 and IXUS 220), so stick in a sleep
246  while (zoom_busy) msleep(10);
247 
248  if (newpt==0) zoom_status=ZOOM_OPTICAL_MIN;
249  else if (newpt >= zoom_points) zoom_status=ZOOM_OPTICAL_MAX;
251  _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt));
252 #endif // !(CAM_USE_ALT_SET_ZOOM_POINT)
253 }
void lens_set_zoom_speed ( long  newspd)

CAM_USE_ALT_PT_MoveOpticalZoomAt

Definiert in Zeile 255 der Datei wrappers.c.

256 {
257 // translate % to speed values for _MoveOpticalZoomAt
258 // which correspond to different speeds varies by camera
259 #if defined(CAM_USE_ALT_PT_MoveOpticalZoomAt)
260  if (newspd < 25) {
261  mz_speed = 0;
262  } else if (newspd < 50) {
263  mz_speed = 1;
264  } else if (newspd < 75) {
265  mz_speed = 2;
266  } else {
267  mz_speed = 3;
268  }
269 #else // !CAM_USE_ALT_PT_MoveOpticalZoomAt
270  // a few old cameras support setting by %
271  if (newspd < 5) {
272  newspd = 5;
273  } else if (newspd > 100) {
274  newspd = 100;
275  }
276  _SetZoomActuatorSpeedPercent((short*)&newspd);
277 #endif
278 }
int sd_over_modes ( void  )

Definiert in Zeile 982 der Datei shooting.c.

983 { return ( 0
984 #ifdef CAM_SD_OVER_IN_AF
985  + 1
986 #endif
987 #ifdef CAM_SD_OVER_IN_AFL
988  + 2
989 #endif
990 #ifdef CAM_SD_OVER_IN_MF
991  + 4
992 #endif
993 ); }
void UnlockAF ( void  )

Definiert in Zeile 1230 der Datei wrappers.c.

1231 {
1233  {
1234  int af_lock=0;
1235  _UnlockAF();
1236  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1237  }
1238 }
int UnlockMF ( void  )

Definiert in Zeile 32 der Datei wrappers.c.

33 {
35  _PT_MFOff();
36  return(1);
37  }
38  return(0);
39 }