Public Member Functions

FCam::Histogram Class Reference

A histogram returned by the histogram generator. More...

#include <Histogram.h>

Collaboration diagram for FCam::Histogram:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Histogram ()
 The default constructor is an invalid histogram storing no data.
 Histogram (unsigned buckets, unsigned channels, Rect region)
 Make a new empty histogram of the given number of buckets and channels.
unsigned operator() (int b, int c) const
 Sample the histogram at a particular bucket in a particular image channel.
unsigned & operator() (int b, int c)
 Acquire a reference to a particular histogram entry.
unsigned operator() (int b) const
 Sample the histogram at a particular bucket, summed over all channels.
bool valid () const
 Is it safe to dereference data and/or call operator().
unsigned * data ()
 Access to the raw histogram data.
unsigned buckets () const
 How many buckets does this histogram have.
unsigned channels () const
 How many channels does this histogram have.
Rect region () const
 What region of the image was this histogram computed over.
 Histogram ()
 The default constructor is an invalid histogram storing no data.
 Histogram (unsigned buckets, unsigned channels, Rect region)
 Make a new empty histogram of the given number of buckets and channels.
unsigned operator() (int b, int c) const
 Sample the histogram at a particular bucket in a particular image channel.
unsigned & operator() (int b, int c)
 Acquire a reference to a particular histogram entry.
unsigned operator() (int b) const
 Sample the histogram at a particular bucket, summed over all channels.
bool valid () const
 Is it safe to dereference data and/or call operator().
unsigned * data ()
 Access to the raw histogram data.
unsigned buckets () const
 How many buckets does this histogram have.
unsigned channels () const
 How many channels does this histogram have.
Rect region () const
 What region of the image was this histogram computed over.
void debug (const char *name="") const
 Print out some debugging info about the histogram, optionally taking in a name to identify it.

Detailed Description

A histogram returned by the histogram generator.

Before you dereference the data, check if valid is true. Even if you requested a histogram, you're not guaranteed to get one back in all cases.

Definition at line 51 of file Histogram.h.


Constructor & Destructor Documentation

FCam::Histogram::Histogram (  )  [inline]

The default constructor is an invalid histogram storing no data.

Definition at line 60 of file Histogram.h.

FCam::Histogram::Histogram ( unsigned  buckets,
unsigned  channels,
Rect  region 
) [inline]

Make a new empty histogram of the given number of buckets and channels.

Definition at line 64 of file Histogram.h.

FCam::Histogram::Histogram (  )  [inline]

The default constructor is an invalid histogram storing no data.

Definition at line 61 of file Histogram.h.

FCam::Histogram::Histogram ( unsigned  buckets,
unsigned  channels,
Rect  region 
) [inline]

Make a new empty histogram of the given number of buckets and channels.

Definition at line 65 of file Histogram.h.


Member Function Documentation

unsigned FCam::Histogram::operator() ( int  b,
int  c 
) const [inline]

Sample the histogram at a particular bucket in a particular image channel.

The absolute number should not be relied on, because the histogram is computed over the bayer-mosaiced raw sensor data, which may be a different resolution to the actual output image if the imaging pipe is doing some resizing. If color histograms are available, the order of the channels is RGB, which will be in the sensor's raw color space. Despite there being twice as many green samples on the raw sensor, the green channel is normalized to have roughly the same total count as red and blue.

Definition at line 80 of file Histogram.h.

unsigned& FCam::Histogram::operator() ( int  b,
int  c 
) [inline]

Acquire a reference to a particular histogram entry.

Useful for creating your own histograms.

Definition at line 86 of file Histogram.h.

unsigned FCam::Histogram::operator() ( int  b  )  const [inline]

Sample the histogram at a particular bucket, summed over all channels.

Definition at line 92 of file Histogram.h.

bool FCam::Histogram::valid (  )  const [inline]

Is it safe to dereference data and/or call operator().

Definition at line 101 of file Histogram.h.

unsigned* FCam::Histogram::data (  )  [inline]

Access to the raw histogram data.

Stored similarly to an image: first bucket, then color channel.

Definition at line 107 of file Histogram.h.

unsigned FCam::Histogram::buckets (  )  const [inline]

How many buckets does this histogram have.

Definition at line 110 of file Histogram.h.

unsigned FCam::Histogram::channels (  )  const [inline]

How many channels does this histogram have.

Definition at line 113 of file Histogram.h.

Rect FCam::Histogram::region (  )  const [inline]

What region of the image was this histogram computed over.

Definition at line 116 of file Histogram.h.

unsigned FCam::Histogram::operator() ( int  b,
int  c 
) const [inline]

Sample the histogram at a particular bucket in a particular image channel.

The absolute number should not be relied on, because the histogram is computed over the bayer-mosaiced raw sensor data, which may be a different resolution to the actual output image if the imaging pipe is doing some resizing. If color histograms are available, the order of the channels is RGB, which will be in the sensor's raw color space. Despite there being twice as many green samples on the raw sensor, the green channel is normalized to have roughly the same total count as red and blue.

Definition at line 81 of file Histogram.h.

unsigned& FCam::Histogram::operator() ( int  b,
int  c 
) [inline]

Acquire a reference to a particular histogram entry.

Useful for creating your own histograms.

Definition at line 87 of file Histogram.h.

unsigned FCam::Histogram::operator() ( int  b  )  const [inline]

Sample the histogram at a particular bucket, summed over all channels.

Definition at line 93 of file Histogram.h.

bool FCam::Histogram::valid (  )  const [inline]

Is it safe to dereference data and/or call operator().

Definition at line 102 of file Histogram.h.

unsigned* FCam::Histogram::data (  )  [inline]

Access to the raw histogram data.

Stored similarly to an image: first bucket, then color channel.

Definition at line 108 of file Histogram.h.

unsigned FCam::Histogram::buckets (  )  const [inline]

How many buckets does this histogram have.

Definition at line 111 of file Histogram.h.

unsigned FCam::Histogram::channels (  )  const [inline]

How many channels does this histogram have.

Definition at line 114 of file Histogram.h.

Rect FCam::Histogram::region (  )  const [inline]

What region of the image was this histogram computed over.

Definition at line 117 of file Histogram.h.


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