Public Member Functions

FCam::AutoFocus Class Reference

This class does autofocus, by sweeping the sensor back and forth until a nice thing to focus on is found. More...

#include <AutoFocus.h>

Collaboration diagram for FCam::AutoFocus:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AutoFocus (FCam::Lens *l, FCam::Rect r=FCam::Rect())
 Construct an AutoFocus helper object that uses the specified lens, and attempts to bring the target rectangle into focus.
void startSweep ()
 Start the autofocus routine.
void update (const FCam::Frame &f)
 Feed the autofocus routine a new frame.
bool focused ()
 Is the lens currently focused?
bool idle ()
 Is the lens currently focused, or ready to begin focusing?
void setTarget (Rect r)
 Set the target on the frame to look at in pixels.

Detailed Description

This class does autofocus, by sweeping the sensor back and forth until a nice thing to focus on is found.

You call startSweep, then feed it frames using update, until focused returns true.

Definition at line 18 of file AutoFocus.h.


Constructor & Destructor Documentation

FCam::AutoFocus::AutoFocus ( FCam::Lens l,
FCam::Rect  r = FCam::Rect() 
)

Construct an AutoFocus helper object that uses the specified lens, and attempts to bring the target rectangle into focus.

By default, the target rectangle is the entire region covered by the sharpness map of the frames that come in.

Definition at line 11 of file AutoFocus.cpp.


Member Function Documentation

void FCam::AutoFocus::startSweep (  ) 

Start the autofocus routine.

Returns immediately.

Definition at line 13 of file AutoFocus.cpp.

void FCam::AutoFocus::update ( const FCam::Frame f  ) 

Feed the autofocus routine a new frame.

It will have its sharpness map examined, and the autofocus will react appropriately. This function will ignore frames that aren't tagged by the lens this object was constructed with, and will also ignore frames with no sharpnes map.

Definition at line 22 of file AutoFocus.cpp.

void FCam::AutoFocus::setTarget ( Rect  r  )  [inline]

Set the target on the frame to look at in pixels.

Don't change this in the middle of a sweep.

Definition at line 45 of file AutoFocus.h.


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