Fawkes API  Fawkes Development Version
firevision::HistogramBlock Class Reference

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

#include <>>

Inheritance diagram for firevision::HistogramBlock:

Public Member Functions

 HistogramBlock (histogram_block_type_t type, hint_t object_type, uint16_t width, uint16_t height, uint16_t depth=0)
 Constructor. More...
 
 HistogramBlock (FireVisionDataFileBlock *block)
 Copy constructor. More...
 
virtual ~HistogramBlock ()
 Destructor. More...
 
uint16_t width () const
 Returns the the width of the histogram. More...
 
uint16_t height () const
 Returns the the height of the histogram. More...
 
uint16_t depth () const
 Returns the the depth of the histogram. More...
 
hint_t object_type () const
 Returns the type of the object the histogram is associated with. More...
 
void set_object_type (hint_t object_type)
 Set the type of the object the histogram is associated with. More...
 
void set_data (uint32_t *data)
 Directly set the histogram data. More...
 
void set_value (uint16_t x, uint16_t y, uint32_t val)
 Store a value in a certain cell of a 2-dimensional histogram. More...
 
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. More...
 
uint32_t get_value (uint16_t x, uint16_t y)
 Obtain a certain value from a 2-dimensional histogram. More...
 
uint32_t get_value (uint16_t x, uint16_t y, uint16_t z)
 Obtain a certain value from a 3-dimensional histogram. More...
 
void reset ()
 Reset the histogram. More...
 
- Public Member Functions inherited from firevision::FireVisionDataFileBlock
 FireVisionDataFileBlock (unsigned int type, size_t data_size, void *spec_header, size_t spec_header_size)
 Constructor. More...
 
 FireVisionDataFileBlock (unsigned int type, size_t data_size, size_t spec_header_size)
 Constructor. More...
 
 FireVisionDataFileBlock (unsigned int type, size_t data_size)
 Constructor. More...
 
 FireVisionDataFileBlock (FireVisionDataFileBlock *block)
 Shallow copy constructor. More...
 
virtual ~FireVisionDataFileBlock ()
 Destructor. More...
 
unsigned int type () const
 Get block type. More...
 
void * block_memptr () const
 Pointer to the whole block. More...
 
size_t block_size () const
 Size of blocks. More...
 
void * data_ptr () const
 Get data pointer. More...
 
size_t data_size () const
 Size of data chunk. More...
 

Additional Inherited Members

- Protected Member Functions inherited from firevision::FireVisionDataFileBlock
void set_spec_header (void *spec_header, size_t spec_header_size)
 Set content-specific header. More...
 
- Protected Attributes inherited from firevision::FireVisionDataFileBlock
void * _data
 Pointer to the internal data segment. More...
 
size_t _data_size
 Size of _data in bytes. More...
 
void * _spec_header
 Pointer to the content specific block header. More...
 

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

Definition at line 55 of file histogram_block.h.

Constructor & Destructor Documentation

◆ HistogramBlock() [1/2]

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::_data, firevision::FireVisionDataFileBlock::_spec_header, firevision::_histogram_block_header_t::depth, depth(), firevision::_histogram_block_header_t::height, height(), firevision::_histogram_block_header_t::object_type, object_type(), firevision::_histogram_block_header_t::width, and width().

◆ HistogramBlock() [2/2]

firevision::HistogramBlock::HistogramBlock ( FireVisionDataFileBlock block)

Copy constructor.

Parameters
blockanother block

Definition at line 66 of file histogram_block.cpp.

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

◆ ~HistogramBlock()

firevision::HistogramBlock::~HistogramBlock ( )
virtual

Destructor.

Definition at line 74 of file histogram_block.cpp.

Member Function Documentation

◆ depth()

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::Histogram::Histogram(), HistogramBlock(), and firevision::BayesColormapGenerator::load_histograms().

◆ get_value() [1/2]

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::height, and firevision::_histogram_block_header_t::width.

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

◆ get_value() [2/2]

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::depth, firevision::_histogram_block_header_t::height, and firevision::_histogram_block_header_t::width.

◆ height()

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::Histogram::Histogram(), HistogramBlock(), and firevision::BayesColormapGenerator::load_histograms().

◆ object_type()

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 firevision::HistogramFile::add_histogram_block(), HistogramBlock(), and set_object_type().

◆ reset()

void firevision::HistogramBlock::reset ( void  )

Reset the histogram.

Definition at line 247 of file histogram_block.cpp.

References firevision::FireVisionDataFileBlock::_data_size.

◆ set_data()

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.

◆ set_object_type()

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().

◆ set_value() [1/2]

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::height, and firevision::_histogram_block_header_t::width.

◆ set_value() [2/2]

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::depth, firevision::_histogram_block_header_t::height, and firevision::_histogram_block_header_t::width.

◆ width()

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::Histogram::Histogram(), HistogramBlock(), and firevision::BayesColormapGenerator::load_histograms().


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