Public Types | Public Member Functions

FCam::F2::Lens Class Reference

The F2 Lens device. More...

#include <Lens.h>

Inheritance diagram for FCam::F2::Lens:
Inheritance graph
[legend]
Collaboration diagram for FCam::F2::Lens:
Collaboration graph
[legend]

List of all members.

Public Types

enum  LensState
 

The states the lens controller can be in.


Public Member Functions

void setFocus (float diopters, float speed=-1)
 Set the focus of the lens in diopters.
void setZoom (float focal_length_mm, float speed=-1)
 Initiate a move to the desired focal length.
void setAperture (float f_number, float speed=-1)
 Initiate a change in the aperture.
void tagFrame (FCam::Frame)
 Tags frames with the generic Lens::Tags defined in the base FCam::Lens class.
LensState getState ()
 Read the current state of the lens.
void reset ()
 Attempt to reinitialize the lens controller.

Detailed Description

The F2 Lens device.

The device communicates with the Birger Engineering EF-232 Canon EOS lens controller, over the serial port. The class runs a separate control thread to avoid blocking on slow RS-232 transactions. There is no way to programmatically zoom Canon EOS lenses, although their focal length can be manually changed. This means that changing zoom is impossible, but it may change on its own due to user actions. Similarly, focus may be altered manually by the user, and if the user toggles on manual focus, it is impossible to focus automatically. The lenses are also removable, so the lens controller may not be able to do anything, if no lens is connected to it.

Todo:
Hook up events for user-made changes to focal length, focus distance, and lens detach/attach.
Todo:
Expose image stabilization to the API

Definition at line 36 of file Lens.h.


Member Function Documentation

void FCam::F2::Lens::setFocus ( float  ,
float  speed = -1 
) [virtual]

Set the focus of the lens in diopters.

See Focus for a discussion of diopters.

The second argument is the focus speed in diopters per second. Numbers less than zero (like the default), get mapped to max speed. This function initiates the change in focus and returns. It may take some time before the focus actually reaches the target position (or as close as it can get). Use FCam::Lens::focusChanging to see if the lens is still moving.

Implements FCam::Lens.

Definition at line 56 of file Lens.cpp.

void FCam::F2::Lens::setZoom ( float  ,
float  speed = -1 
) [virtual]

Initiate a move to the desired focal length.

The second argument is the speed to move, in mm per second

Implements FCam::Lens.

Definition at line 113 of file Lens.cpp.

void FCam::F2::Lens::setAperture ( float  ,
float  speed = -1 
) [virtual]

Initiate a change in the aperture.

The second argument is the desired speed with which to open or close the aperture in F/numbers per second. I know of no lenses that support this, so the second argument may disappear from the API in the near future.

Implements FCam::Lens.

Definition at line 161 of file Lens.cpp.

void FCam::F2::Lens::tagFrame ( FCam::Frame  f  )  [virtual]

Tags frames with the generic Lens::Tags defined in the base FCam::Lens class.

Implements FCam::Lens.

Definition at line 223 of file Lens.cpp.


The documentation for this class was generated from the following files: