Public Member Functions

FCam::Frame Class Reference

Data returned by the sensor as a result of a shot. More...

#include <Frame.h>

Inheritance diagram for FCam::Frame:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Frame (_Frame *f=NULL)
 Frames are normally acquired by sensor::getFrame().
virtual ~Frame ()
 Virtual destructor to allow derived frames to delete themselves properly when accessed as base frames.
bool valid () const
 Does this Frame refer to a valid frame?
bool operator== (const Frame &other) const
 Equality operator, to see if two frames point to the same underlying data.
Image image () const
 The actual image data.
Time exposureStartTime () const
 The time the earliest pixel in the image started exposing.
Time exposureEndTime () const
 The time the latest pixel in the rolling shutter finished exposing.
Time processingDoneTime () const
 The time the image appeared out of the imaging pipe.
int exposure () const
 The actual exposure time for this frame in microseconds.
int frameTime () const
 The actual number of microseconds between the start of this frame and the start of the next one.
float gain () const
 The actual gain used to produce this frame.
int whiteBalance () const
 The actual white balance setting used to produce this frame.
const Histogramhistogram () const
 A histogram produced by the imaging pipe.
const SharpnessMapsharpness () const
 A sharpness map produced by the imaging pipe.
const Shotshot () const
 A const reference to the shot that generated this frame.
const TagMaptags () const
 A const reference to the tags that have been placed on this frame by any devices.
TagValueoperator[] (const std::string &name) const
 Retrieve a reference to a tag placed on this frame by name.
void rawToRGBColorMatrix (float *matrix) const
 Produce a 3x4 affine matrix that maps from RAW sensor RGB to linear-luminance sRGB using the white balance value stored in this frame.
virtual BayerPattern bayerPattern () const
 Get the bayer pattern of this frame (only meaningful if type() is RAW).
virtual unsigned short minRawValue () const
 The smallest value to expect in the image.
virtual unsigned short maxRawValue () const
 The largest value to expect in the image.
virtual void rawToRGBColorMatrix (int kelvin, float *matrix) const
 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
 The manufacturer of the camera that produced this frame.
virtual const std::string & model () const
 The model of camera that produced this frame.
 operator EventGenerator * ()
 Treat a frame as an EventGenerator pointer.
void debug (const char *name="") const
 A Frame debugging dump function.

Detailed Description

Data returned by the sensor as a result of a shot.

May contain image data, a histogram, sharpness map, and assorted tags placed there by devices attached to the sensor from whence this frame came. It may also contain none of these, so check each component is valid before using it. This class is a reference counted pointer type to the real data, so pass it by copy.

Definition at line 80 of file Frame.h.


Constructor & Destructor Documentation

FCam::Frame::Frame ( _Frame f = NULL  )  [inline]

Frames are normally acquired by sensor::getFrame().

The Frame constructor can be used to construct dummy frames for testing purposes. The Frame takes ownership of the _Frame passed in.

Definition at line 90 of file Frame.h.


Member Function Documentation

Image FCam::Frame::image (  )  const [inline]

The actual image data.

Check image().valid() before using it, image data can be dropped in a variety of cases.

Definition at line 104 of file Frame.h.

Time FCam::Frame::exposureStartTime (  )  const [inline]

The time the earliest pixel in the image started exposing.

Definition at line 107 of file Frame.h.

Time FCam::Frame::exposureEndTime (  )  const [inline]

The time the latest pixel in the rolling shutter finished exposing.

This is exposureStart + exposure + rolling shutter time.

Definition at line 111 of file Frame.h.

Time FCam::Frame::processingDoneTime (  )  const [inline]

The time the image appeared out of the imaging pipe.

Definition at line 114 of file Frame.h.

int FCam::Frame::exposure (  )  const [inline]

The actual exposure time for this frame in microseconds.

Note that exposureEndTime - exposureStartTime may be more than this for rolling shutter sensors.

Definition at line 119 of file Frame.h.

int FCam::Frame::frameTime (  )  const [inline]

The actual number of microseconds between the start of this frame and the start of the next one.

Note that exposureEndTime - exposureStartTime may be more than this for rolling shutter sensors. The frame time will be at least the exposure time, typically plus a small overhead of several hundred microseconds.

Definition at line 127 of file Frame.h.

float FCam::Frame::gain (  )  const [inline]

The actual gain used to produce this frame.

This may be a combination of analog and digital gain. Analog gain is preferred, and low gain settings should use only analog gain.

Definition at line 133 of file Frame.h.

int FCam::Frame::whiteBalance (  )  const [inline]

The actual white balance setting used to produce this frame.

Definition at line 137 of file Frame.h.

const Histogram& FCam::Frame::histogram (  )  const [inline]

A histogram produced by the imaging pipe.

Check histogram.valid before using it.

Definition at line 142 of file Frame.h.

const SharpnessMap& FCam::Frame::sharpness (  )  const [inline]

A sharpness map produced by the imaging pipe.

Check sharpness.valid before using it.

Definition at line 147 of file Frame.h.

const Shot& FCam::Frame::shot (  )  const [inline]

A const reference to the shot that generated this frame.

If you have a fancy sensor that takes more parameters, and a corresponding fancy shot that inherits from the base shot, this method should be overridden to return a const reference to your derived shot type instead. It is not a virtual method, so if your fancy frame is cast to a base frame, this method will return a base shot.

Reimplemented in FCam::F2::Frame.

Definition at line 157 of file Frame.h.

const TagMap& FCam::Frame::tags (  )  const [inline]

A const reference to the tags that have been placed on this frame by any devices.

In general you use frame["tagName"] to get and set tags, rather than directory accessing this map. If you wish to iterate over tags, however, you can use this TagMap, which is an std::unordered_map

Definition at line 167 of file Frame.h.

TagValue& FCam::Frame::operator[] ( const std::string &  name  )  const [inline]

Retrieve a reference to a tag placed on this frame by name.

This can be used to lookup tags like so: double x = frame["focus"]; Or to attach new tags that will survive being saved to a file and loaded again like so: frame["mySpecialTag"] = 42;

Definition at line 178 of file Frame.h.

void FCam::Frame::rawToRGBColorMatrix ( float *  matrix  )  const [inline]

Produce a 3x4 affine matrix that maps from RAW sensor RGB to linear-luminance sRGB using the white balance value stored in this frame.

Given in row-major order. This function is necessary to be able to correctly interpret the color data in raw frames.

Definition at line 187 of file Frame.h.

virtual BayerPattern FCam::Frame::bayerPattern (  )  const [inline, virtual]

Get the bayer pattern of this frame (only meaningful if type() is RAW).

Definition at line 193 of file Frame.h.

virtual unsigned short FCam::Frame::minRawValue (  )  const [inline, virtual]

The smallest value to expect in the image.

Only meaningful is type() is RAW.

Definition at line 199 of file Frame.h.

virtual unsigned short FCam::Frame::maxRawValue (  )  const [inline, virtual]

The largest value to expect in the image.

Only meaningful if type() is RAW.

Definition at line 205 of file Frame.h.

virtual void FCam::Frame::rawToRGBColorMatrix ( int  kelvin,
float *  matrix 
) const [inline, 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.

Definition at line 212 of file Frame.h.

virtual const std::string& FCam::Frame::manufacturer (  )  const [inline, virtual]

The manufacturer of the camera that produced this frame.

(e.g. Canon).

Definition at line 218 of file Frame.h.

virtual const std::string& FCam::Frame::model (  )  const [inline, virtual]

The model of camera that produced this frame.

Should also include manufacturer (e.g. Canon 400D).

Definition at line 224 of file Frame.h.

FCam::Frame::operator EventGenerator * (  )  [inline]

Treat a frame as an EventGenerator pointer.

This allows us to associate events (such as failing to load a DNG) with a frame and look for them later in the event queue using getNextEvent().

Definition at line 232 of file Frame.h.

void FCam::Frame::debug ( const char *  name = ""  )  const [inline]

A Frame debugging dump function.

Prints out all Frame fields and details of the included Image

Definition at line 238 of file Frame.h.


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