A base class for image sensors. More...
#include <Sensor.h>
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 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 BayerPattern | bayerPattern () const =0 |
Get the bayer pattern of this sensor when in raw mode. | |
virtual void | rawToRGBColorMatrix (int kelvin, float *matrix) const =0 |
Produce a 3x4 affine matrix that maps from sensor RGB to linear-luminance sRGB at the given white balance. | |
virtual const std::string & | manufacturer () const =0 |
The camera's manufacturer. | |
virtual const std::string & | model () const =0 |
The camera's model. | |
virtual unsigned short | minRawValue () const =0 |
The smallest value to expect when in raw mode. | |
virtual unsigned short | maxRawValue () const =0 |
The largest value to expect when in raw mode. | |
virtual void | tagFrame (Frame) |
The sensor has the option of tagging the frames it produces, just like any other device. |
A base class for image sensors.
Takes shots via Sensor::capture and Sensor::stream, and returns frames via Sensor::getFrame.
Definition at line 17 of file Sensor.h.
virtual void FCam::Sensor::capture | ( | const Shot & | ) | [pure virtual] |
Queue up the next shot.
Makes a deep copy of the argument.
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
void FCam::Sensor::setFrameLimit | ( | int | l | ) |
Set the maximum number of frames that can exist in the frame queue.
This a failsafe for memory management, not a rate control tool.
Definition at line 25 of file Sensor.cpp.
void FCam::Sensor::setDropPolicy | ( | Sensor::DropPolicy | d | ) |
Set which frames should be dropped if the frame limit is exceeded.
Definition at line 34 of file Sensor.cpp.
Sensor::DropPolicy FCam::Sensor::getDropPolicy | ( | ) |
Get which frames will be dropped if the frame limit is exceeded.
Definition at line 38 of file Sensor.cpp.
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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
void FCam::Sensor::attach | ( | Device * | d | ) |
Allow a device to tag the frames that come from this sensor.
Definition at line 21 of file Sensor.cpp.
virtual int FCam::Sensor::maxExposure | ( | ) | const [pure virtual] |
The maximum exposure time supported by this sensor.
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
virtual int FCam::Sensor::maxFrameTime | ( | ) | const [pure virtual] |
The maximum supported frame time.
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
virtual float FCam::Sensor::minGain | ( | ) | const [inline, virtual] |
The minimum supported gain.
Defaults to 1.0.
Reimplemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
virtual BayerPattern FCam::Sensor::bayerPattern | ( | ) | const [pure virtual] |
Get the bayer pattern of this sensor when in raw mode.
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
virtual void FCam::Sensor::rawToRGBColorMatrix | ( | int | kelvin, | |
float * | matrix | |||
) | const [pure virtual] |
Produce a 3x4 affine matrix that maps from sensor RGB to linear-luminance sRGB at the given white balance.
Given in row-major order.
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
virtual const std::string& FCam::Sensor::manufacturer | ( | ) | const [pure virtual] |
The camera's manufacturer.
(e.g. Canon).
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
virtual const std::string& FCam::Sensor::model | ( | ) | const [pure virtual] |
The camera's model.
Should also include manufacturer (e.g. Canon 400D).
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
virtual unsigned short FCam::Sensor::minRawValue | ( | ) | const [pure virtual] |
The smallest value to expect when in raw mode.
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::Sensor.
virtual unsigned short FCam::Sensor::maxRawValue | ( | ) | const [pure virtual] |
The largest value to expect when in raw mode.
Implemented in FCam::Dummy::Sensor, FCam::F2::Sensor, and FCam::N900::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.