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

1141 {
1143  {
1144  int af_lock=1;
1145  _DoAFLock();
1146  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1147  }
1148 }
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 181 der Datei wrappers.c.

182 {
183  return _GetZoomLensCurrentPoint();
184 }
long lens_get_zoom_pos ( )

Definiert in Zeile 176 der Datei wrappers.c.

177 {
179 }
void lens_set_focus_pos ( long  newpos)

Definiert in Zeile 254 der Datei wrappers.c.

255 {
256  if (newpos >= CAMERA_MAX_DIST) newpos = INFINITY_DIST; // Set to infinity value that will work on all cameras
257  _MoveFocusLensToDistance((short*)&newpos);
258  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
259  newpos = _GetFocusLensSubjectDistance();
260  _SetPropertyCase(PROPCASE_SUBJECT_DIST1, &newpos, sizeof(newpos));
261  _SetPropertyCase(PROPCASE_SUBJECT_DIST2, &newpos, sizeof(newpos));
262 }
void lens_set_zoom_point ( long  newpt)

Definiert in Zeile 186 der Datei wrappers.c.

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

Definiert in Zeile 244 der Datei wrappers.c.

245 {
246  if (newspd < 5) {
247  newspd = 5;
248  } else if (newspd > 100) {
249  newspd = 100;
250  }
251  _SetZoomActuatorSpeedPercent((short*)&newspd);
252 }
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 1150 der Datei wrappers.c.

1151 {
1153  {
1154  int af_lock=0;
1155  _UnlockAF();
1156  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1157  }
1158 }
int UnlockMF ( void  )

Definiert in Zeile 32 der Datei wrappers.c.

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