MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

FCam::Lens Class Reference

An abstract base class for lens devices, to establish a uniform interface to common lens functions. More...

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

List of all members.

Classes

class   FocusAction
  An Action to initiate a change in focus during an exposure (for example, for rubber focus). More...
struct   Tags
  A lens adds the following tags to a frame: "lens.focus", "lens.focusSpeed", "lens.initialFocus", "lens.finalFocus", "lens.zoom", "lens.zoomSpeed", "lens.initialZoom", "lens.finalZoom", "lens.aperture", "lens.apertureSpeed", "lens.initialAperture", "lens.finalAperture". More...

Public Member Functions

virtual void  tagFrame (Frame)=0
  Attach tags describing the state of the lens during a frame to a Frame.
Focus

Functions to affect the focus of the lens. Units are diopters or diopters per second. Diopters are inverse meters, so zero corresponds to infinity, and a large number corresponds to very close. This is a good unit to use for focus for many reasons: It accurately expresses the precision with which focus is set; lens movements are often linear in diopters; defocus blur size in pixels is proportional to how many diopters you're misfocused by; and depth of field is fixed number of diopters independent of the depth you're focused at.

virtual void  setFocus (float, float speed=-1)=0
  Set the focus of the lens in diopters.
virtual float  getFocus () const =0
  Get the current focus of the lens in diopters.
virtual float  farFocus () const =0
  Get the farthest focus of the lens in diopters.
virtual float  nearFocus () const =0
  Get the closest focus of the lens in diopters.
virtual bool  focusChanging () const =0
  Is the focus currently changing?
virtual int  focusLatency () const =0
  if I call setFocus, how long will it take before the lens starts moving?
virtual float  minFocusSpeed () const =0
  How slowly can I move the lens (in diopters per second).
virtual float  maxFocusSpeed () const =0
  How quickly can I move the lens (in diopters per second).
Zoom

Functions to zoom the lens (change its focal length).

The units are focal length in mm, and mm per second.

virtual void  setZoom (float, float speed=-1)=0
  Initiate a move to the desired focal length.
virtual float  getZoom () const =0
  The current focal length.
virtual float  minZoom () const =0
  The minimum focal length (widest-angle view).
virtual float  maxZoom () const =0
  The maximum focal length (narrowest-angle view).
virtual bool  zoomChanging () const =0
  Is the focal length currently changing?
virtual int  zoomLatency () const =0
  How long after I call setZoom will the lens start moving?
virtual float  minZoomSpeed () const =0
  The slowest the lens can zoom in mm per second.
virtual float  maxZoomSpeed () const =0
  The fastest the lens can zoom in mm per second.
Aperture

Functions to change the size of the aperture.

The units are F/numbers or F/numbers per second. To get the actual physical size of the aperture, use getFocalLength()/getAperture.

virtual void  setAperture (float, float speed=-1)=0
  Initiate a change in the aperture.
virtual float  getAperture () const =0
  Get the current aperture.
virtual float  wideAperture (float zoom) const =0
  Get the widest aperture (smallest F/number) the lens supports at a given focal length.
virtual float  narrowAperture (float zoom) const =0
  Get the narrowest aperture (largest F/number) the lens supports at a given focal length.
virtual bool  apertureChanging () const =0
  Is the aperture currently changing?
virtual int  apertureLatency () const =0
  How long after I call setAperture does the aperture actually start moving?
virtual float  minApertureSpeed () const =0
  The minimum speed with which the aperture can move in F/numbers per second.
virtual float  maxApertureSpeed () const =0
  The maximum speed with which the aperture can move in F/numbers per second.

Detailed Description

An abstract base class for lens devices, to establish a uniform interface to common lens functions.


Member Function Documentation

virtual void FCam::Lens::setFocus ( float  ,
float  speed = -1  
) [pure 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.

Implemented in FCam::N9::Lens.

virtual float FCam::Lens::getFocus (  )  const [pure virtual]

Get the current focus of the lens in diopters.

Implemented in FCam::N9::Lens.

virtual float FCam::Lens::farFocus (  )  const [pure virtual]

Get the farthest focus of the lens in diopters.

Implemented in FCam::N9::Lens.

virtual float FCam::Lens::nearFocus (  )  const [pure virtual]

Get the closest focus of the lens in diopters.

Implemented in FCam::N9::Lens.

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

Initiate a move to the desired focal length.

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

Implemented in FCam::N9::Lens.

virtual void FCam::Lens::setAperture ( float  ,
float  speed = -1  
) [pure 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.

Implemented in FCam::N9::Lens.

virtual void FCam::Lens::tagFrame ( Frame   )  [pure virtual]

Attach tags describing the state of the lens during a frame to a Frame.

You should never need to call this function - it's done for you by the Sensor.

Implements FCam::Device.

Implemented in FCam::N9::Lens.


Copyright (c) 2012, Nokia Corporation and/or its subsidiary(-ies). All rights reserved. See Copyright.
MeeGo 1.2 Harmattan API