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

1184 {
1186  {
1187  int af_lock=1;
1188  _DoAFLock();
1189  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1190  }
1191 }
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 260 der Datei wrappers.c.

261 {
262  if (newpos >= CAMERA_MAX_DIST) newpos = INFINITY_DIST; // Set to infinity value that will work on all cameras
263  _MoveFocusLensToDistance((short*)&newpos);
264  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
265  newpos = _GetFocusLensSubjectDistance();
266  _SetPropertyCase(PROPCASE_SUBJECT_DIST1, &newpos, sizeof(newpos));
267  _SetPropertyCase(PROPCASE_SUBJECT_DIST2, &newpos, sizeof(newpos));
268 }
void lens_set_zoom_point ( long  newpt)

Definiert in Zeile 192 der Datei wrappers.c.

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

Definiert in Zeile 250 der Datei wrappers.c.

251 {
252  if (newspd < 5) {
253  newspd = 5;
254  } else if (newspd > 100) {
255  newspd = 100;
256  }
257  _SetZoomActuatorSpeedPercent((short*)&newspd);
258 }
int sd_over_modes ( void  )

Definiert in Zeile 980 der Datei shooting.c.

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

Definiert in Zeile 1193 der Datei wrappers.c.

1194 {
1196  {
1197  int af_lock=0;
1198  _UnlockAF();
1199  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1200  }
1201 }
int UnlockMF ( void  )

Definiert in Zeile 32 der Datei wrappers.c.

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