MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

FCam::Frame Class Reference

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

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 Histogram histogram () const
  A histogram produced by the imaging pipe.
const SharpnessMap sharpness () const
  A sharpness map produced by the imaging pipe.
const Shot shot () const
  A const reference to the shot that generated this frame.
const TagMap tags () const
  A const reference to the tags that have been placed on this frame by any devices.
TagValue operator[] (const std::string &name) const
  Retrieve a reference to a tag placed on this frame by name.
virtual const Platform platform () const
  Access to the static platform data about the sensor 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.


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.


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.

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

The time the earliest pixel in the image started exposing.

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

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

This is exposureStart + exposure + rolling shutter time.

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

The time the image appeared out of the imaging pipe.

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.

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.

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.

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

The actual white balance setting used to produce this frame.

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

A histogram produced by the imaging pipe.

Check histogram.valid before using it.

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

A sharpness map produced by the imaging pipe.

Check sharpness.valid before using it.

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.

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

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;

virtual const Platform& FCam::Frame::platform (  )  const [inline, virtual]

Access to the static platform data about the sensor that produced this frame.

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().

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


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