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

1224 {
1226  {
1227  int af_lock=1;
1228  _DoAFLock();
1229  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1230  }
1231 }
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 190 der Datei wrappers.c.

191 {
192  return _GetZoomLensCurrentPoint();
193 }
long lens_get_zoom_pos ( )

Definiert in Zeile 185 der Datei wrappers.c.

186 {
188 }
void lens_set_focus_pos ( long  newpos)

Definiert in Zeile 283 der Datei wrappers.c.

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

Definiert in Zeile 199 der Datei wrappers.c.

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

CAM_USE_ALT_PT_MoveOpticalZoomAt

Definiert in Zeile 258 der Datei wrappers.c.

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

Definiert in Zeile 1233 der Datei wrappers.c.

1234 {
1236  {
1237  int af_lock=0;
1238  _UnlockAF();
1239  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1240  }
1241 }
int UnlockMF ( void  )

Definiert in Zeile 32 der Datei wrappers.c.

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