LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::hsvHistogramViewer Class Reference

A simple HSV histogram viewer. More...

#include <ltiHsvHistogramViewer.h>

Inheritance diagram for lti::hsvHistogramViewer:
Inheritance graph
[legend]
Collaboration diagram for lti::hsvHistogramViewer:
Collaboration graph
[legend]

List of all members.

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
hsvHistogramViewercopy (const hsvHistogramViewer &other)
hsvHistogramVieweroperator= (const hsvHistogramViewer &other)
virtual functorclone () const
const parametersgetParameters () 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

Detailed Description

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


Constructor & Destructor Documentation

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

Parameters:
other the object to be copied
virtual lti::hsvHistogramViewer::~hsvHistogramViewer (  )  [virtual]

destructor


Member Function Documentation

bool lti::hsvHistogramViewer::apply ( histogram2D hist  )  const

Show the given HSV histogram.

The histogram is 2D (H, S - in this order).

Parameters:
hist histogram2D with the source data.
Returns:
true if apply successful or false otherwise.
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.

Parameters:
hist thistogram<double> with the source data.
Returns:
true if apply successful or false otherwise.
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.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

void lti::hsvHistogramViewer::fillCell ( image img,
const rgbPixel color,
const int &  fromRow,
const int &  fromCol,
const int &  sideLength,
float  percent 
) const [protected]

Fill a square area in the given image with the given color.

The square has the the given side length, and its upper left corder is at fromRow/fromCol. The cell is filled to the given percentage. I hope it looks nice :-)

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  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.


Member Data Documentation

For converting HSV to RGB (for display).

For actually showing the histogram.


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

Generated on Sat Apr 10 15:28:59 2010 for LTI-Lib by Doxygen 1.6.1