Fawkes API  Fawkes Development Version
firevision::HistogramFile Class Reference

A fileformat for histograms. More...

#include <>>

Inheritance diagram for firevision::HistogramFile:

Public Types

typedef std::list< HistogramBlock * > HistogramBlockList
 Convenience typdef for a STL list of pointers to histogram blocks. More...
 
- Public Types inherited from firevision::FireVisionDataFile
typedef std::list< FireVisionDataFileBlock * > BlockList
 List of FireVision data file blocks. More...
 

Public Member Functions

 HistogramFile ()
 Constructor. More...
 
 ~HistogramFile ()
 Destructor. More...
 
void add_histogram_block (HistogramBlock *block)
 Adds a new histogram block to the file. More...
 
HistogramBlockList histogram_blocks ()
 Generates a list of histogram blocks attached to the file. More...
 
uint32_t get_value (hint_t object_type, uint16_t x, uint16_t y, uint16_t z)
 Get a value from a certain histogram. More...
 
void set_value (hint_t object_type, uint16_t x, uint16_t y, uint16_t z, uint32_t val)
 Set a value in a certain histogram. More...
 
- Public Member Functions inherited from firevision::FireVisionDataFile
 FireVisionDataFile (unsigned short int magic_token, unsigned short int version)
 Constructor. More...
 
virtual ~FireVisionDataFile ()
 Destructor. More...
 
unsigned int magic_token ()
 Get the magic token of the file. More...
 
unsigned int version ()
 Get the version of the file. More...
 
bool is_big_endian ()
 Check if data is encoded as big endian. More...
 
bool is_little_endian ()
 Check if data is encoded as little endian. More...
 
size_t num_blocks ()
 Get the number of available info blocks. More...
 
const char * get_comment () const
 Get comment. More...
 
void set_comment (const char *comment)
 Set comment. More...
 
void set_owns_blocks (bool owns_blocks)
 Lets the file take over the ownership and give up the ownership of the blocks, respectively. More...
 
virtual void add_block (FireVisionDataFileBlock *block)
 Add a block. More...
 
virtual void clear ()
 Clear internal storage. More...
 
virtual void write (const char *file_name)
 Write file. More...
 
virtual void read (const char *file_name)
 Read file. More...
 
BlockListblocks ()
 Get blocks. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from firevision::FireVisionDataFile
static unsigned short int read_magic_token (const char *filename)
 Get magic token from file. More...
 
static bool has_magic_token (const char *filename, unsigned short int magic_token)
 Check if file has a certain magic token. More...
 
- Protected Attributes inherited from firevision::FireVisionDataFile
void * _spec_header
 Content specific header. More...
 
size_t _spec_header_size
 Size in bytes of _spec_header. More...
 

Detailed Description

A fileformat for histograms.

Such a file might contain multiple histograms, each for a a different type of object.

Author
Daniel Beck

Definition at line 42 of file histogram_file.h.

Member Typedef Documentation

◆ HistogramBlockList

Convenience typdef for a STL list of pointers to histogram blocks.

Definition at line 51 of file histogram_file.h.

Constructor & Destructor Documentation

◆ HistogramFile()

firevision::HistogramFile::HistogramFile ( )

Constructor.

Definition at line 42 of file histogram_file.cpp.

◆ ~HistogramFile()

firevision::HistogramFile::~HistogramFile ( )

Destructor.

Definition at line 50 of file histogram_file.cpp.

Member Function Documentation

◆ add_histogram_block()

void firevision::HistogramFile::add_histogram_block ( HistogramBlock block)

Adds a new histogram block to the file.

Parameters
blockthe histogram block

Definition at line 60 of file histogram_file.cpp.

References firevision::FireVisionDataFile::add_block(), and firevision::HistogramBlock::object_type().

Referenced by firevision::Histogram::save(), and firevision::BayesColormapGenerator::save_histograms().

◆ get_value()

uint32_t firevision::HistogramFile::get_value ( hint_t  object_type,
uint16_t  x,
uint16_t  y,
uint16_t  z 
)

Get a value from a certain histogram.

Parameters
object_typethe requested value is obtained from the histogram for this type of object
xthe x-coordinate
ythe y-coordinate
zthe z-coordinate
Returns
value

Definition at line 104 of file histogram_file.cpp.

◆ histogram_blocks()

HistogramFile::HistogramBlockList firevision::HistogramFile::histogram_blocks ( )

Generates a list of histogram blocks attached to the file.

Returns
a list of all attached histogram blocks

Definition at line 74 of file histogram_file.cpp.

References firevision::FireVisionDataFile::blocks().

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

◆ set_value()

void firevision::HistogramFile::set_value ( hint_t  object_type,
uint16_t  x,
uint16_t  y,
uint16_t  z,
uint32_t  val 
)

Set a value in a certain histogram.

Parameters
object_typethis specifies the type for which the respective histogram is changed
xthe x-coordinate
ythe y-coordinate
zthe z-coordinate
valthe new value for the specified cell

Definition at line 122 of file histogram_file.cpp.


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