latest version v1.9 - last update 10 Apr 2010 |
A simple HSV histogram viewer. More...
#include <ltiHsvHistogramViewer.h>
Classes | |
class | parameters |
the parameters for the class hsvHistogramViewer More... | |
class | ray |
A helper class for drawing. More... | |
Public Member Functions | |
hsvHistogramViewer () | |
hsvHistogramViewer (const std::string &windowTitle) | |
hsvHistogramViewer (const hsvHistogramViewer &other) | |
virtual | ~hsvHistogramViewer () |
virtual const char * | getTypeName () const |
bool | apply (thistogram< double > &hist) const |
bool | apply (histogram2D &hist) const |
hsvHistogramViewer & | copy (const hsvHistogramViewer &other) |
hsvHistogramViewer & | operator= (const hsvHistogramViewer &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Protected Member Functions | |
void | fillCell (image &img, const rgbPixel &color, const int &fromRow, const int &fromCol, const int &sideLength, float percent) const |
rgbPixel | getColor (const int &h, const int &hValues, const int &s, const int &sValues) const |
Protected Attributes | |
mergeHSVToImage | m_hsvToRgb |
viewer | m_viewer |
A simple HSV histogram viewer.
It displays an HSV histogram as a 2D image. Hue (H) corresponds to the y coordinate (ordinate), and saturation (S) to the x coordinate (abscissa). Value (V) is ignored in the histogram in one of the following two ways: 1) A histogram2D is given to the apply method, containing H and S pairs (in this order). 2) A 3D histogram containing H, S, V triples (in this order) is given, but is projected into 2D (H,S)-space by summing up over all values (V).
In the display, V is always set to maximum, and the background is black. Every histogram cell corresponds to a square with a fixed side length defineable in the parameters. This square is filled with the corresponding color depending on the cell's value (completely for maximum, empty for 0).
lti::hsvHistogramViewer::hsvHistogramViewer | ( | ) |
default constructor
lti::hsvHistogramViewer::hsvHistogramViewer | ( | const std::string & | windowTitle | ) |
Uses the given window title.
lti::hsvHistogramViewer::hsvHistogramViewer | ( | const hsvHistogramViewer & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::hsvHistogramViewer::~hsvHistogramViewer | ( | ) | [virtual] |
destructor
bool lti::hsvHistogramViewer::apply | ( | histogram2D & | hist | ) | const |
Show the given HSV histogram.
The histogram is 2D (H, S - in this order).
hist | histogram2D with the source data. |
bool lti::hsvHistogramViewer::apply | ( | thistogram< double > & | hist | ) | const |
Show the given HSV histogram.
The histogram must be 3D (H, S, V - in this order). It is projected into (H,S)-space.
hist | thistogram<double> with the source data. |
virtual functor* lti::hsvHistogramViewer::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
hsvHistogramViewer& lti::hsvHistogramViewer::copy | ( | const hsvHistogramViewer & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
rgbPixel lti::hsvHistogramViewer::getColor | ( | const int & | h, | |
const int & | hValues, | |||
const int & | s, | |||
const int & | sValues | |||
) | const [protected] |
Convert an (H,S) pair to RGB.
V=max is assumed.
const parameters& lti::hsvHistogramViewer::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::hsvHistogramViewer::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("hsvHistogramViewer")
Reimplemented from lti::functor.
hsvHistogramViewer& lti::hsvHistogramViewer::operator= | ( | const hsvHistogramViewer & | other | ) |
mergeHSVToImage lti::hsvHistogramViewer::m_hsvToRgb [protected] |
For converting HSV to RGB (for display).
viewer lti::hsvHistogramViewer::m_viewer [mutable, protected] |
For actually showing the histogram.