Scope
scope::ScopeHistogram Class Reference

#include <ScopeHistogram.h>

Public Member Functions

 ScopeHistogram (const uint32_t &_no_of_bins=512, const uint16_t &_range=UINT16_MAX)
 
 ScopeHistogram (const ScopeHistogram &_h)
 
double Binsize () const
 
void Calculate (ScopeImageU16CPtr const _img, const bool &_loghistogram=false)
 
void Resize (const uint32_t &_no_of_bins)
 
uint32_t MaxCount () const
 
uint16_t FirstCountPosition () const
 
uint16_t LastCountPosition () const
 
const std::vector< uint32_t > * GetHistConst () const
 
void ReleaseHistConst () const
 

Protected Attributes

std::mutex mutex
 
const uint16_t range
 
double binsize
 
std::vector< uint32_t > hist
 

Detailed Description

A histogram for a uint16_t image with uint32_t counts.

Definition at line 9 of file ScopeHistogram.h.

Constructor & Destructor Documentation

scope::ScopeHistogram::ScopeHistogram ( const uint32_t &  _no_of_bins = 512,
const uint16_t &  _range = UINT16_MAX 
)

Initialize to binsize 1 (histogram size is thus UINT16_MAX+1) and zero counts.

Definition at line 9 of file ScopeHistogram.cpp.

scope::ScopeHistogram::ScopeHistogram ( const ScopeHistogram _h)

safe copy constructor

Definition at line 15 of file ScopeHistogram.cpp.

Member Function Documentation

double scope::ScopeHistogram::Binsize ( ) const
Returns
current bin size

Definition at line 22 of file ScopeHistogram.cpp.

void scope::ScopeHistogram::Calculate ( ScopeImageU16CPtr const  _img,
const bool &  _loghistogram = false 
)

Calculate the histogram.

Parameters
[in]_imgthe uint16 ScopeImage to calculate from
[in]_loghistogramif true the histogram contains the logarithms of the counts, if false it contains the counts

Definition at line 27 of file ScopeHistogram.cpp.

void scope::ScopeHistogram::Resize ( const uint32_t &  _no_of_bins)

Resize the histogram to a new number of bins.

Postcondition
size of data vector is _no_of_bins

Definition at line 55 of file ScopeHistogram.cpp.

uint32_t scope::ScopeHistogram::MaxCount ( ) const
Returns
the maximum count in the histogram

Definition at line 63 of file ScopeHistogram.cpp.

uint16_t scope::ScopeHistogram::FirstCountPosition ( ) const
Returns
the first position that has a count > 0

Definition at line 68 of file ScopeHistogram.cpp.

uint16_t scope::ScopeHistogram::LastCountPosition ( ) const
Returns
the last position that has a count > 0

Definition at line 78 of file ScopeHistogram.cpp.

const std::vector< uint32_t > * scope::ScopeHistogram::GetHistConst ( ) const
Returns
a constant pointer to the histogram data
Postcondition
mutex is locked shared

Definition at line 88 of file ScopeHistogram.cpp.

void scope::ScopeHistogram::ReleaseHistConst ( ) const
Postcondition
mutex is unlocked

Definition at line 93 of file ScopeHistogram.cpp.

Member Data Documentation

std::mutex scope::ScopeHistogram::mutex
mutableprotected

for data protection

Definition at line 13 of file ScopeHistogram.h.

const uint16_t scope::ScopeHistogram::range
protected

range of uint16 to do histogram of

Definition at line 16 of file ScopeHistogram.h.

double scope::ScopeHistogram::binsize
protected

size of each bin

Definition at line 19 of file ScopeHistogram.h.

std::vector<uint32_t> scope::ScopeHistogram::hist
protected

data vector

Definition at line 22 of file ScopeHistogram.h.


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