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

1254 {
1256  {
1257  int af_lock=1;
1258  _DoAFLock();
1259  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1260  }
1261 }
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 191 der Datei wrappers.c.

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

Definiert in Zeile 186 der Datei wrappers.c.

187 {
189 }
void lens_set_focus_pos ( long  newpos)

Definiert in Zeile 281 der Datei wrappers.c.

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

Definiert in Zeile 205 der Datei wrappers.c.

206 {
207  if (newpt < 0) {
208  newpt = 0;
209  } else if (newpt >= zoom_points) {
210  newpt = zoom_points-1;
211  }
212 
213 #if defined(CAM_USE_ALT_SET_ZOOM_POINT)
214 
215  if (lens_get_zoom_point() != newpt)
216  {
217  int digizoom_pos;
218  get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION,&digizoom_pos,sizeof(digizoom_pos));
219  // check current digital zoom mode & state
220  // state == 1 && mode == 0 --> Digital Zoom Standard
221  if ((shooting_get_digital_zoom_state() == 1) && (shooting_get_digital_zoom_mode() == 0) && (digizoom_pos != 0))
222  {
223  // reset digital zoom in case camera is in this zoom range
224  extern void _PT_MoveDigitalZoomToWide();
225  _PT_MoveDigitalZoomToWide();
226  }
227 
228  // starting around digic 4 - _MoveZoomLensWithPoint crashes many cameras
229  // _PT_MoveOpticalZoomAt works, and updates PROPCASE_OPTICAL_ZOOM_POSITION; but doesn't wait for zoom to finish
230  // _MoveOpticalZoom at is underlying function that accepts speed
231  // updates jpeg engine distortion correction setting, maintains focus position
232  extern void _MoveOpticalZoomAt(long pt,int speed);
233  _MoveOpticalZoomAt(newpt,mz_speed);
234 
235  // have to sleep here, zoom_busy set in another task, without sleep this will hang
236  while (zoom_busy) msleep(10);
237 
238  // g10,g12 & sx30 only use this value for optical zoom
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)

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_SET_ZOOM_POINT)
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_SET_ZOOM_POINT
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 // !CAM_USE_ALT_SET_ZOOM_POINT
278 }
int sd_over_modes ( void  )

Definiert in Zeile 1135 der Datei shooting.c.

1136 { return ( 0
1137 #ifdef CAM_SD_OVER_IN_AF
1138  + 1
1139 #endif
1140 #ifdef CAM_SD_OVER_IN_AFL
1141  + 2
1142 #endif
1143 #ifdef CAM_SD_OVER_IN_MF
1144  + 4
1145 #endif
1146 ); }
void UnlockAF ( void  )

Definiert in Zeile 1263 der Datei wrappers.c.

1264 {
1266  {
1267  int af_lock=0;
1268  _UnlockAF();
1269  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1270  }
1271 }
int UnlockMF ( void  )

Definiert in Zeile 32 der Datei wrappers.c.

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