Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

vlHistogram Class Reference

This class is provides storage for a histogram. More...

#include <vlhistogram.h>

List of all members.

Public Member Functions

 vlHistogram (const vlVolume *vol, bool compute=false)
 Default constructor - Takes a pointer to a vlVolume whose histogram is to be computed.

virtual ~vlHistogram ()
 Default destructor.

bool update (bool force=true)
 Update the histogram.

uint16 width () const
 Returns the width of the histogram.

uint32 maxHeight () const
 Returns the maximum height of the histogram.

uint32 minHeight () const
 Returns the minimum height of the histogram.

bool normalize (bool force=false)
 Normalize the histogram.

bool CreateLogHistogram (bool force=false)
 Create log of the histogram.

void SetLogPower (uint16 power=7)
 Set teh power for indicating peak heights of log histogram.

const std::vector< float > * getNormHistArray ()
 Returns pointer to the normalized version of histogram.

const std::vector< uint32 > * getHistArray ()
 Returns pointer to the histogram array.

const std::vector< float > * getLogHistArray ()
 Returns pointer to the log version of histogram.

template<> bool recomputeT (uint8 &dummy)

Protected Member Functions

bool recompute ()
 Recompute the histogram.

template<typename DataType> bool recomputeT (DataType &dummy)
 The real function that recomputes the histogram.


Protected Attributes

const vlVolumem_vol
 Volume on which the histogram is connected.

std::vector< uint32m_histogram
 Stores the histogram internally.

uint32 m_maxHeight
 Max and min height of histogram.

uint32 m_minHeight
 Max and min height of histogram.

std::vector< float > m_normalizedHist
 Normalized version of histogram.

std::vector< float > m_logHist
 Log version of histogram.

bool m_dirty
 Dirty bit - if set to true, update() is needed.

uint16 m_power
 Base bit for log version of histogram.

bool m_dirtyLog

Friends

std::ostream & operator<< (std::ostream &stream, vlHistogram &hist)


Detailed Description

Author:
Sarang Lakare <sarang#users.sf.net>

Definition at line 39 of file vlhistogram.h.


Constructor & Destructor Documentation

vlHistogram::vlHistogram const vlVolume vol,
bool  compute = false
 

Definition at line 32 of file vlhistogram.cpp.

References recompute().

vlHistogram::~vlHistogram  )  [virtual]
 

Definition at line 43 of file vlhistogram.cpp.


Member Function Documentation

bool vlHistogram::CreateLogHistogram bool  force = false  ) 
 

Definition at line 133 of file vlhistogram.cpp.

References m_dirtyLog, m_histogram, m_logHist, m_normalizedHist, m_power, and normalize().

Referenced by getLogHistArray().

const std::vector< uint32 > * vlHistogram::getHistArray  ) 
 

Definition at line 191 of file vlhistogram.cpp.

References m_histogram.

const std::vector< float > * vlHistogram::getLogHistArray  ) 
 

Definition at line 197 of file vlhistogram.cpp.

References CreateLogHistogram(), and m_logHist.

const std::vector< float > * vlHistogram::getNormHistArray  ) 
 

Definition at line 183 of file vlhistogram.cpp.

References m_normalizedHist, and normalize().

uint32 vlHistogram::maxHeight  )  const
 

Definition at line 69 of file vlhistogram.cpp.

References m_maxHeight, and uint32.

uint32 vlHistogram::minHeight  )  const
 

Definition at line 76 of file vlhistogram.cpp.

References m_minHeight, and uint32.

bool vlHistogram::normalize bool  force = false  ) 
 

Definition at line 83 of file vlhistogram.cpp.

References m_dirty, m_histogram, m_maxHeight, m_normalizedHist, and max.

Referenced by CreateLogHistogram(), and getNormHistArray().

bool vlHistogram::recompute  )  [protected]
 

Definition at line 242 of file vlhistogram.cpp.

References callFunctionOnDataTypeNoArgs, vlVolume::dataType(), m_vol, and recomputeT().

Referenced by update(), and vlHistogram().

template<>
bool vlHistogram::recomputeT uint8 dummy  ) 
 

template<typename DataType>
bool vlHistogram::recomputeT DataType &  dummy  )  [protected]
 

Definition at line 265 of file vlhistogram.cpp.

Referenced by recompute().

void vlHistogram::SetLogPower uint16  power = 7  ) 
 

Definition at line 123 of file vlhistogram.cpp.

References m_dirtyLog, and m_power.

bool vlHistogram::update bool  force = true  ) 
 

If force is false, the histogram will be updated only if the volume's dirty bit is set. By default, force is set to true meaning the histogram will be recomputed every time update is called. NOTE : volume's dirty bit setting is not set properly as of writing this. This note will be removed once the dirty bit setting work is done. Till then, let force be true.

Todo:
Remove the note after vlVolume's dirty bit setting is fixed

Definition at line 49 of file vlhistogram.cpp.

References vlVolume::isDirty(), m_vol, and recompute().

uint16 vlHistogram::width  )  const
 

Definition at line 63 of file vlhistogram.cpp.

References m_histogram, and uint16.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  stream,
vlHistogram hist
[friend]
 

Definition at line 250 of file vlhistogram.cpp.


Member Data Documentation

bool vlHistogram::m_dirty [protected]
 

Definition at line 111 of file vlhistogram.h.

Referenced by normalize().

bool vlHistogram::m_dirtyLog [protected]
 

Definition at line 116 of file vlhistogram.h.

Referenced by CreateLogHistogram(), and SetLogPower().

std::vector<uint32> vlHistogram::m_histogram [protected]
 

Definition at line 99 of file vlhistogram.h.

Referenced by CreateLogHistogram(), getHistArray(), normalize(), operator<<(), and width().

std::vector<float> vlHistogram::m_logHist [protected]
 

Definition at line 108 of file vlhistogram.h.

Referenced by CreateLogHistogram(), and getLogHistArray().

uint32 vlHistogram::m_maxHeight [protected]
 

Definition at line 102 of file vlhistogram.h.

Referenced by maxHeight(), and normalize().

uint32 vlHistogram::m_minHeight [protected]
 

Definition at line 102 of file vlhistogram.h.

Referenced by minHeight().

std::vector<float> vlHistogram::m_normalizedHist [protected]
 

Definition at line 105 of file vlhistogram.h.

Referenced by CreateLogHistogram(), getNormHistArray(), and normalize().

uint16 vlHistogram::m_power [protected]
 

Definition at line 114 of file vlhistogram.h.

Referenced by CreateLogHistogram(), and SetLogPower().

const vlVolume* vlHistogram::m_vol [protected]
 

Definition at line 96 of file vlhistogram.h.

Referenced by recompute(), and update().


The documentation for this class was generated from the following files:
Generated on Fri Mar 18 11:33:18 2005 for OpenVL by doxygen 1.3.3