Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
Histogram (unsigned int width, unsigned int height, unsigned int depth=1, unsigned int num_undos=1) | |
Constructor. More... | |
Histogram (HistogramBlock *histogram_block) | |
Constructor. More... | |
~Histogram () | |
Destructor. More... | |
void | operator+= (fawkes::upoint_t *p) |
Add point. More... | |
void | operator+= (fawkes::upoint_t p) |
Add point. More... | |
unsigned int * | get_histogram () |
Get histogram data buffer. More... | |
HistogramBlock * | get_histogram_block () |
Obtain the histogram block of this histogram. More... | |
void | get_dimensions (unsigned int &width, unsigned int &height, unsigned int &depth) |
Obtain dimensions of the histogram. More... | |
unsigned int | get_value (unsigned int x, unsigned int y) |
Get value from histogram. More... | |
unsigned int | get_value (unsigned int x, unsigned int y, unsigned int z) |
Get value from histogram. More... | |
void | set_value (unsigned int x, unsigned int y, unsigned int value) |
Set value in histogram. More... | |
void | set_value (unsigned int x, unsigned int y, unsigned int z, unsigned int value) |
Set value in histogram. More... | |
void | inc_value (unsigned int x, unsigned int y, unsigned int z=0) |
Increase the value of the histogram at given position. More... | |
void | add (unsigned int x, unsigned int y, unsigned int z, unsigned int value) |
Add value to value in histogram at given location. More... | |
void | sub (unsigned int x, unsigned int y, unsigned int z, unsigned int value) |
Substract value from value in histogram at given location. More... | |
void | reset () |
Reset histogram. More... | |
unsigned int | get_median () |
Get median of all values. More... | |
unsigned int | get_average () |
Get average of all values. More... | |
unsigned int | get_sum () const |
Get sum of all values. More... | |
void | reset_undo () |
Reset undo. More... | |
void | undo () |
Undo. More... | |
unsigned int | switch_undo (unsigned int undo_id) |
Switch undo to another undo buffer. More... | |
unsigned int | get_num_undos () |
Get number of undos. More... | |
void | print_to_stream (std::ostream &s) |
Print to stream. More... | |
void | save (const char *filename, bool formatted_output=false) |
Save to file. More... | |
bool | load (const char *filename) |
Load from file. More... | |
Histrogram with 2D or 3D coordinates for buckets.
Definition at line 37 of file histogram.h.
firevision::Histogram::Histogram | ( | unsigned int | width, |
unsigned int | height, | ||
unsigned int | depth = 1 , |
||
unsigned int | num_undos = 1 |
||
) |
Constructor.
width | width of histogram plane |
height | height of histogram plane |
depth | depth of the histogram |
num_undos | number of possible undos |
Definition at line 58 of file histogram.cpp.
firevision::Histogram::Histogram | ( | HistogramBlock * | block | ) |
Constructor.
block | construct a histogram from the given histogram block |
Definition at line 97 of file histogram.cpp.
References firevision::FireVisionDataFileBlock::data_ptr(), firevision::HistogramBlock::depth(), firevision::HistogramBlock::height(), and firevision::HistogramBlock::width().
firevision::Histogram::~Histogram | ( | ) |
Destructor.
Definition at line 126 of file histogram.cpp.
void firevision::Histogram::add | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z, | ||
unsigned int | value | ||
) |
Add value to value in histogram at given location.
x | x coordinate in histogram |
y | y coordinate in histogram |
z | z coordinate in histogram |
value | the value to add |
Definition at line 322 of file histogram.cpp.
Referenced by firevision::BayesColormapGenerator::save_histograms().
unsigned int firevision::Histogram::get_average | ( | ) |
Get average of all values.
Definition at line 534 of file histogram.cpp.
Referenced by firevision::BayesHistosToLut::calculateLutValues().
void firevision::Histogram::get_dimensions | ( | unsigned int & | width, |
unsigned int & | height, | ||
unsigned int & | depth | ||
) |
Obtain dimensions of the histogram.
width | reference to the variable where the width is stored |
height | reference to the variable where the height is stored |
depth | reference to the variable where the depth is stored |
Definition at line 207 of file histogram.cpp.
unsigned int * firevision::Histogram::get_histogram | ( | ) |
HistogramBlock * firevision::Histogram::get_histogram_block | ( | ) |
Obtain the histogram block of this histogram.
Definition at line 195 of file histogram.cpp.
unsigned int firevision::Histogram::get_median | ( | ) |
Get median of all values.
Definition at line 507 of file histogram.cpp.
Referenced by firevision::BayesHistosToLut::calculateLutValues().
unsigned int firevision::Histogram::get_num_undos | ( | ) |
Get number of undos.
Definition at line 497 of file histogram.cpp.
Referenced by firevision::BayesHistosToLut::calculateLutValues().
unsigned int firevision::Histogram::get_sum | ( | ) | const |
Get sum of all values.
Definition at line 557 of file histogram.cpp.
Referenced by firevision::BayesColormapGenerator::save_histograms().
unsigned int firevision::Histogram::get_value | ( | unsigned int | x, |
unsigned int | y | ||
) |
Get value from histogram.
x | x coordinate in histogram plane |
y | y coordinate in histogram plane |
Definition at line 221 of file histogram.cpp.
References firevision::HistogramBlock::get_value().
Referenced by firevision::BayesHistosToLut::calculateLutValues(), and firevision::BayesColormapGenerator::save_histograms().
unsigned int firevision::Histogram::get_value | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z | ||
) |
Get value from histogram.
x | x coordinate in histogram plane |
y | y coordinate in histogram plane |
z | z coordinate in the histogram |
Definition at line 234 of file histogram.cpp.
void firevision::Histogram::inc_value | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z = 0 |
||
) |
Increase the value of the histogram at given position.
x | x coordinate in the histogram |
y | y coordinate in the histogram |
z | z coordinate in the histogram |
Definition at line 303 of file histogram.cpp.
bool firevision::Histogram::load | ( | const char * | filename | ) |
Load from file.
filename | file name to read from |
Definition at line 419 of file histogram.cpp.
References firevision::FireVisionDataFile::blocks(), firevision::FireVisionDataFile::num_blocks(), and firevision::FireVisionDataFile::read().
void firevision::Histogram::operator+= | ( | fawkes::upoint_t * | p | ) |
Add point.
p | point |
Definition at line 141 of file histogram.cpp.
References fawkes::upoint_t::x, and fawkes::upoint_t::y.
void firevision::Histogram::operator+= | ( | fawkes::upoint_t | p | ) |
Add point.
p | point |
Definition at line 163 of file histogram.cpp.
References fawkes::upoint_t::x, and fawkes::upoint_t::y.
void firevision::Histogram::print_to_stream | ( | std::ostream & | s | ) |
void firevision::Histogram::reset | ( | void | ) |
Reset histogram.
Definition at line 366 of file histogram.cpp.
void firevision::Histogram::reset_undo | ( | ) |
Reset undo.
Definition at line 450 of file histogram.cpp.
void firevision::Histogram::save | ( | const char * | filename, |
bool | formatted_output = false |
||
) |
Save to file.
filename | file name to save to |
formatted_output | one value per line |
Definition at line 403 of file histogram.cpp.
References firevision::HistogramFile::add_histogram_block(), firevision::FireVisionDataFile::set_owns_blocks(), and firevision::FireVisionDataFile::write().
void firevision::Histogram::set_value | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | value | ||
) |
Set value in histogram.
x | x coordinate in histogram plane |
y | y coordinate in histogram plane |
value | value |
Definition at line 246 of file histogram.cpp.
Referenced by firevision::BayesHistosToLut::calculateLutValues(), and firevision::BayesColormapGenerator::save_histograms().
void firevision::Histogram::set_value | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z, | ||
unsigned int | value | ||
) |
Set value in histogram.
x | x coordinate in histogram plane |
y | y coordinate in histogram plane |
z | z coordinate in the histogram |
value | value |
Definition at line 275 of file histogram.cpp.
void firevision::Histogram::sub | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z, | ||
unsigned int | value | ||
) |
Substract value from value in histogram at given location.
x | x coordinate in histogram |
y | y coordinate in histogram |
z | z coordinate in histogram |
value | the value to substract |
Definition at line 341 of file histogram.cpp.
Referenced by firevision::BayesColormapGenerator::save_histograms().
unsigned int firevision::Histogram::switch_undo | ( | unsigned int | undo_id | ) |
Switch undo to another undo buffer.
undo_id | switch to buffer with this ID |
Definition at line 479 of file histogram.cpp.
Referenced by firevision::BayesHistosToLut::calculateLutValues().
void firevision::Histogram::undo | ( | ) |
Undo.
Definition at line 459 of file histogram.cpp.
Referenced by firevision::BayesHistosToLut::calculateLutValues().