Tools::TransferFunction::DisplayHistogram Class Reference

#include <displayhistogram.h>

List of all members.


Detailed Description

Display a histogram, take as input a single channel image, or anything with const iterators returning a single value, and draw its histogram.

displayhistogram.png

It is possible to zoom and pan portion of the histogram. At any time, the viewed portion of the histogram is normalizd, so the highest visible bin will have a height of 1 in the histogram.

This can be used in a transfer function editor with Ramps and Trapezoids to manage a lookup table of an image or of a volume.

Internally a texture keeps the histogram and zooming and panning are done by changing the texture coordinates (m_u1, m_u1) of the drawn square.

See also:
TransferFunction

Public Member Functions

 DisplayHistogram ()
 ~DisplayHistogram ()
template<typename DataType>
void update (const DataType *data, unsigned int data_size, float min, float max, unsigned int nbBins)
void clamp (float left, float right)
float getLeft () const
 get left value of the visible histogram
float getRight () const
 get right value of the visible histogram
void display () const
bool mouse (float x, float y)
bool motion (float x, float y)

Constructor & Destructor Documentation

Tools::TransferFunction::DisplayHistogram::DisplayHistogram (  ) 

Tools::TransferFunction::DisplayHistogram::~DisplayHistogram (  ) 


Member Function Documentation

template<typename DataType>
void Tools::TransferFunction::DisplayHistogram::update ( const DataType *  data,
unsigned int  data_size,
float  min,
float  max,
unsigned int  nbBins 
) [inline]

create a new histogram with an image

Parameters:
image compute the histogram of this image
data_size numer of pixels in the image
min,max the minimum and the maximum values of the histogram, this is used to display only a portion or the full intensity range of an image
nbBins number of bins in the histogram

Referenced by Tools::TransferFunction::Editor::update().

void Tools::TransferFunction::DisplayHistogram::clamp ( float  left,
float  right 
)

change histogram lower and higher limit (show only a section of the histogram)

Parameters:
left,right left and right intensity values of the visible histogram

float Tools::TransferFunction::DisplayHistogram::getLeft (  )  const [inline]

get left value of the visible histogram

Referenced by Tools::TransferFunction::Editor::add().

float Tools::TransferFunction::DisplayHistogram::getRight (  )  const [inline]

get right value of the visible histogram

Referenced by Tools::TransferFunction::Editor::add().

void Tools::TransferFunction::DisplayHistogram::display (  )  const

display histogram on a centered 1x1 square

bool Tools::TransferFunction::DisplayHistogram::mouse ( float  x,
float  y 
)

handle a mouse press

Parameters:
x,y normalized mouse coordinate 0..1
Returns:
true if inside histogram

bool Tools::TransferFunction::DisplayHistogram::motion ( float  x,
float  y 
)

handle a mouse motion

Parameters:
x,y normalized mouse coordinate 0..1
Returns:
true if inside histogram


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

Generated on Tue Aug 4 17:57:43 2009 for libvd by  doxygen 1.5.5