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

1244 {
1246  {
1247  int af_lock=1;
1248  _DoAFLock();
1249  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1250  }
1251 }
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 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 204 der Datei wrappers.c.

205 {
206  if (newpt < 0) {
207  newpt = 0;
208  } else if (newpt >= zoom_points) {
209  newpt = zoom_points-1;
210  }
211 
212 #if defined(CAM_USE_ALT_SET_ZOOM_POINT)
213 
214  if (lens_get_zoom_point() != newpt)
215  {
216  int digizoom_pos;
217  get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION,&digizoom_pos,sizeof(digizoom_pos));
218  // check current digital zoom mode & state
219  // state == 1 && mode == 0 --> Digital Zoom Standard
220  if ((shooting_get_digital_zoom_state() == 1) && (shooting_get_digital_zoom_mode() == 0) && (digizoom_pos != 0))
221  {
222  // reset digital zoom in case camera is in this zoom range
223  extern void _PT_MoveDigitalZoomToWide();
224  _PT_MoveDigitalZoomToWide();
225  }
226 
227  // starting around digic 4 - _MoveZoomLensWithPoint crashes many cameras
228  // _PT_MoveOpticalZoomAt works, and updates PROPCASE_OPTICAL_ZOOM_POSITION; but doesn't wait for zoom to finish
229  // _MoveOpticalZoom at is underlying function that accepts speed
230  // updates jpeg engine distortion correction setting, maintains focus position
231  extern void _MoveOpticalZoomAt(long pt,int speed);
232  _MoveOpticalZoomAt(newpt,mz_speed);
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 #else // !(CAM_USE_ALT_SET_ZOOM_POINT)
241  _MoveZoomLensWithPoint((short*)&newpt);
242 
243  // tight loop here hangs some cameras (the task that clears zoom_busy
244  // is starved; seen at least on S95 and IXUS 220), so stick in a sleep
245  while (zoom_busy) msleep(10);
246 
247  if (newpt==0) zoom_status=ZOOM_OPTICAL_MIN;
248  else if (newpt >= zoom_points) zoom_status=ZOOM_OPTICAL_MAX;
250  _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt));
251 #endif // !(CAM_USE_ALT_SET_ZOOM_POINT)
252 }
void lens_set_zoom_speed ( long  newspd)

Definiert in Zeile 254 der Datei wrappers.c.

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

Definiert in Zeile 1118 der Datei shooting.c.

1119 { return ( 0
1120 #ifdef CAM_SD_OVER_IN_AF
1121  + 1
1122 #endif
1123 #ifdef CAM_SD_OVER_IN_AFL
1124  + 2
1125 #endif
1126 #ifdef CAM_SD_OVER_IN_MF
1127  + 4
1128 #endif
1129 ); }
void UnlockAF ( void  )

Definiert in Zeile 1253 der Datei wrappers.c.

1254 {
1256  {
1257  int af_lock=0;
1258  _UnlockAF();
1259  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1260  }
1261 }
int UnlockMF ( void  )

Definiert in Zeile 32 der Datei wrappers.c.

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