MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

FCam::Sensor Class Reference

A base class for image sensors. More...

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

List of all members.

Public Types

enum   DropPolicy { DropNewest = 0, DropOldest }
 

Which frames should be dropped if there are too many frames in the frame Queue.

More...

Public Member Functions

virtual void  capture (const Shot &)=0
  Queue up the next shot.
virtual void  capture (const std::vector< Shot > &)=0
  Queue up a burst of shots.
virtual void  stream (const Shot &s)=0
  Set a shot to be captured when the sensor isn't busy capturing anything else.
virtual void  stream (const std::vector< Shot > &)=0
  Set a burst to be captured whenever the sensor isn't busy capturing anything else.
virtual bool  streaming ()=0
  Is there a shot or burst currently streaming?
virtual void  stopStreaming ()=0
  Stop the sensor from streaming a shot or burst set with stream.
virtual void  start ()=0
  Power up the sensor, image processor, and the FCam daemon This is done automatically when you call capture for the first time.
virtual int  initialize (int timeout)=0
  explicitly power up sensor.
virtual void  stop ()=0
  Shut down the sensor, image processor, and the FCam daemon.
void  setFrameLimit (int)
  Set the maximum number of frames that can exist in the frame queue.
int  getFrameLimit ()
  Get the current frame limit (see setFrameLimit).
void  setDropPolicy (DropPolicy)
  Set which frames should be dropped if the frame limit is exceeded.
DropPolicy  getDropPolicy ()
  Get which frames will be dropped if the frame limit is exceeded.
Frame  getFrame ()
  Get the next frame.
virtual int  framesPending () const =0
  How many frames are in the frame queue (i.e., how many times can you call getFrame before it blocks?
virtual int  shotsPending () const =0
  How many shots are pending.
void  attach (Device *)
  Allow a device to tag the frames that come from this sensor.
virtual int  maxExposure () const =0
  The maximum exposure time supported by this sensor.
virtual int  minExposure () const =0
  The minimum supported exposure time.
virtual int  maxFrameTime () const =0
  The maximum supported frame time.
virtual int  minFrameTime () const =0
  The minimum supported frame time.
virtual float  maxGain () const =0
  The maximum supported gain.
virtual float  minGain () const
  The minimum supported gain.
virtual Size  minImageSize () const =0
  The smallest image size.
virtual Size  maxImageSize () const
  The largest image size.
virtual int  maxHistogramRegions () const
  The maximum supported number of histogram regions.
virtual int  rollingShutterTime (const Shot &) const =0
  The time difference between the first line exposing and the last line in microseconds, for given shot parameters.
virtual const Platform platform () const =0
  Access to the static platform data about this sensor.
virtual void  tagFrame (Frame)
  The sensor has the option of tagging the frames it produces, just like any other device.

Detailed Description

A base class for image sensors.

Takes shots via Sensor::capture and Sensor::stream, and returns frames via Sensor::getFrame.


Member Enumeration Documentation

Which frames should be dropped if there are too many frames in the frame Queue.

Enumerator:
DropNewest 

Drop the newest frames.

DropOldest 

Drop the oldest frames.


Member Function Documentation

virtual void FCam::Sensor::capture ( const Shot  )  [pure virtual]

Queue up the next shot.

Makes a deep copy of the argument.

Implemented in FCam::N9::Sensor.

virtual void FCam::Sensor::capture ( const std::vector< Shot > &   )  [pure virtual]

Queue up a burst of shots.

Makes a deep copy of the argument.

Implemented in FCam::N9::Sensor.

virtual void FCam::Sensor::stream ( const Shot s  )  [pure virtual]

Set a shot to be captured when the sensor isn't busy capturing anything else.

Makes a deep copy of the argument.

Implemented in FCam::N9::Sensor.

virtual void FCam::Sensor::stream ( const std::vector< Shot > &   )  [pure virtual]

Set a burst to be captured whenever the sensor isn't busy capturing anything else.

Makes a deep copy of the argument.

Implemented in FCam::N9::Sensor.

virtual void FCam::Sensor::stopStreaming (  )  [pure virtual]

Stop the sensor from streaming a shot or burst set with stream.

The sensor will continue to run. To turn off the sensor completely see Sensor::stop

Implemented in FCam::N9::Sensor.

virtual void FCam::Sensor::start (  )  [pure virtual]

Power up the sensor, image processor, and the FCam daemon This is done automatically when you call capture for the first time.

Implemented in FCam::N9::Sensor.

virtual int FCam::Sensor::initialize ( int  timeout  )  [pure virtual]

explicitly power up sensor.

if timeout < 0, return immediately without waiting for initialization to finish, timeout == 0, wait forever, timeout > 0, wait max timeout seconds before returning error return 0 on success, -1 on error. Any possible initialization error can be get with getNextEvent

Implemented in FCam::N9::Sensor.

virtual void FCam::Sensor::stop (  )  [pure virtual]

Shut down the sensor, image processor, and the FCam daemon.

Call this to save power and/or processing cycles while your program is doing something unrelated to taking pictures.

Implemented in FCam::N9::Sensor.

void FCam::Sensor::setFrameLimit ( int   ) 

Set the maximum number of frames that can exist in the frame queue.

This a failsafe for memory management, not a rate control tool.

void FCam::Sensor::setDropPolicy ( DropPolicy   ) 

Set which frames should be dropped if the frame limit is exceeded.

DropPolicy FCam::Sensor::getDropPolicy (  ) 

Get which frames will be dropped if the frame limit is exceeded.

Frame FCam::Sensor::getFrame (  )  [inline]

Get the next frame.

We promise that precisely one frame will come back per time capture is called. A reference-counted shared pointer object is returned, so you don't need to worry about deleting it.

Reimplemented in FCam::N9::Sensor.

virtual int FCam::Sensor::shotsPending (  )  const [pure virtual]

How many shots are pending.

This includes frames in the frame queue, shots currently in the pipeline, and shots in the capture queue. Stop streaming (stopStreaming) and get frames (getFrame) until this hits zero to completely drain the system.

Implemented in FCam::N9::Sensor.

void FCam::Sensor::attach ( Device  ) 

Allow a device to tag the frames that come from this sensor.

virtual int FCam::Sensor::maxExposure (  )  const [pure virtual]

The maximum exposure time supported by this sensor.

Implemented in FCam::N9::Sensor.

virtual int FCam::Sensor::maxFrameTime (  )  const [pure virtual]

The maximum supported frame time.

Implemented in FCam::N9::Sensor.

virtual float FCam::Sensor::minGain (  )  const [inline, virtual]

The minimum supported gain.

Defaults to 1.0.

Reimplemented in FCam::N9::Sensor.

virtual int FCam::Sensor::rollingShutterTime ( const Shot  )  const [pure virtual]

The time difference between the first line exposing and the last line in microseconds, for given shot parameters.

Implemented in FCam::N9::Sensor.

virtual const Platform& FCam::Sensor::platform (  )  const [pure virtual]

Access to the static platform data about this sensor.

Implemented in FCam::N9::Sensor.

virtual void FCam::Sensor::tagFrame ( Frame   )  [inline, virtual]

The sensor has the option of tagging the frames it produces, just like any other device.

By default it doesn't add anything.

Implements FCam::Device.


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