Fawkes API  Fawkes Development Version
firevision::HistogramBlock Class Reference

This class defines a file block for histograms. More...

#include <>>

Inheritance diagram for firevision::HistogramBlock:

List of all members.

Public Member Functions

 HistogramBlock (histogram_block_type_t type, hint_t object_type, uint16_t width, uint16_t height, uint16_t depth=0)
 Constructor.
 HistogramBlock (FireVisionDataFileBlock *block)
 Copy constructor.
virtual ~HistogramBlock ()
 Destructor.
uint16_t width () const
 Returns the the width of the histogram.
uint16_t height () const
 Returns the the height of the histogram.
uint16_t depth () const
 Returns the the depth of the histogram.
hint_t object_type () const
 Returns the type of the object the histogram is associated with.
void set_object_type (hint_t object_type)
 Set the type of the object the histogram is associated with.
void set_data (uint32_t *data)
 Directly set the histogram data.
void set_value (uint16_t x, uint16_t y, uint32_t val)
 Store a value in a certain cell of a 2-dimensional histogram.
void set_value (uint16_t x, uint16_t y, uint16_t z, uint32_t val)
 Store a value in a certain cell of a 3-dimensional histogram.
uint32_t get_value (uint16_t x, uint16_t y)
 Obtain a certain value from a 2-dimensional histogram.
uint32_t get_value (uint16_t x, uint16_t y, uint16_t z)
 Obtain a certain value from a 3-dimensional histogram.
void reset ()
 Reset the histogram.

Detailed Description

This class defines a file block for histograms.

Additionally, the very basic routines to acccess and manipulate data in the histograms are provided.

Author:
Daniel Beck

Constructor & Destructor Documentation

firevision::HistogramBlock::HistogramBlock ( histogram_block_type_t  type,
hint_t  object_type,
uint16_t  width,
uint16_t  height,
uint16_t  depth = 0 
)

Constructor.

Parameters:
typethe type of the histogram block
object_typethe object type this histogram is meant for (e.g, ball)
widththe width of the histogram
heightthe height of the histogram
depththe depth of the histogram

Definition at line 49 of file histogram_block.cpp.

References firevision::FireVisionDataFileBlock::_spec_header, firevision::_histogram_block_header_t::width, width(), firevision::_histogram_block_header_t::height, height(), firevision::_histogram_block_header_t::depth, depth(), firevision::_histogram_block_header_t::object_type, object_type(), and firevision::FireVisionDataFileBlock::_data.

firevision::HistogramBlock::HistogramBlock ( FireVisionDataFileBlock block)

Copy constructor.

Parameters:
blockanother block

Definition at line 66 of file histogram_block.cpp.

References firevision::FireVisionDataFileBlock::_spec_header, and firevision::FireVisionDataFileBlock::_data.

firevision::HistogramBlock::~HistogramBlock ( ) [virtual]

Destructor.

Definition at line 74 of file histogram_block.cpp.


Member Function Documentation

uint16_t firevision::HistogramBlock::depth ( ) const

Returns the the depth of the histogram.

Returns:
the depth of the histogram

Definition at line 100 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::depth.

Referenced by firevision::BayesColormapGenerator::load_histograms(), firevision::Histogram::Histogram(), and HistogramBlock().

uint32_t firevision::HistogramBlock::get_value ( uint16_t  x,
uint16_t  y 
)

Obtain a certain value from a 2-dimensional histogram.

Parameters:
xthe x-coordinate
ythe y-coordinate
Returns:
the histogram value

Definition at line 195 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::depth, firevision::_histogram_block_header_t::width, and firevision::_histogram_block_header_t::height.

Referenced by firevision::Histogram::get_value().

uint32_t firevision::HistogramBlock::get_value ( uint16_t  x,
uint16_t  y,
uint16_t  z 
)

Obtain a certain value from a 3-dimensional histogram.

Parameters:
xthe x-coordinate
ythe y-coordinate
zthe z-coordinate
Returns:
the histogram value

Definition at line 222 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::width, firevision::_histogram_block_header_t::height, and firevision::_histogram_block_header_t::depth.

uint16_t firevision::HistogramBlock::height ( ) const

Returns the the height of the histogram.

Returns:
the height of the histogram

Definition at line 91 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::height.

Referenced by firevision::BayesColormapGenerator::load_histograms(), firevision::Histogram::Histogram(), and HistogramBlock().

hint_t firevision::HistogramBlock::object_type ( ) const

Returns the type of the object the histogram is associated with.

Returns:
the object type of the histogram

Definition at line 109 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::object_type.

Referenced by HistogramBlock(), set_object_type(), and firevision::HistogramFile::add_histogram_block().

void firevision::HistogramBlock::reset ( )

Reset the histogram.

Definition at line 247 of file histogram_block.cpp.

References firevision::FireVisionDataFileBlock::_data_size.

void firevision::HistogramBlock::set_data ( uint32_t *  data)

Directly set the histogram data.

Note: You are reponsible that the data has the right size and format!

Parameters:
datapointer to the histogram data

Definition at line 128 of file histogram_block.cpp.

References firevision::FireVisionDataFileBlock::_data, and firevision::FireVisionDataFileBlock::_data_size.

void firevision::HistogramBlock::set_object_type ( hint_t  object_type)

Set the type of the object the histogram is associated with.

Parameters:
object_typethe new type of the object

Definition at line 118 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::object_type, and object_type().

Referenced by firevision::BayesColormapGenerator::save_histograms().

void firevision::HistogramBlock::set_value ( uint16_t  x,
uint16_t  y,
uint32_t  val 
)

Store a value in a certain cell of a 2-dimensional histogram.

Parameters:
xthe x-coordinate
ythe y-coordinate
valthe new value

Definition at line 139 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::depth, firevision::_histogram_block_header_t::width, and firevision::_histogram_block_header_t::height.

void firevision::HistogramBlock::set_value ( uint16_t  x,
uint16_t  y,
uint16_t  z,
uint32_t  val 
)

Store a value in a certain cell of a 3-dimensional histogram.

Parameters:
xthe x-coordinate
ythe y-coordinate
zthe z-coordinate
valthe new value

Definition at line 166 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::width, firevision::_histogram_block_header_t::height, and firevision::_histogram_block_header_t::depth.

uint16_t firevision::HistogramBlock::width ( ) const

Returns the the width of the histogram.

Returns:
the width of the histogram

Definition at line 82 of file histogram_block.cpp.

References firevision::_histogram_block_header_t::width.

Referenced by firevision::BayesColormapGenerator::load_histograms(), firevision::Histogram::Histogram(), and HistogramBlock().


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