Fawkes API  Fawkes Development Version
histogram_file.h
1 
2 /***************************************************************************
3  * histogram_file.h - Histogram file
4  *
5  * Created: Sat Mar 29 16:03:12 2008
6  * Copyright 2008 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _FIREVISION_FVUTILS_STATISTICAL_HISTOGRAM_FILE_H_
25 #define _FIREVISION_FVUTILS_STATISTICAL_HISTOGRAM_FILE_H_
26 
27 #define FIREVISION_HISTOGRAM_MAGIC 0xFF04
28 #define FIREVISION_HISTOGRAM_CURVER 1
29 
30 #include <fvutils/base/roi.h>
31 #include <fvutils/fileformat/fvfile.h>
32 
33 #include <map>
34 #include <vector>
35 
36 namespace firevision {
37 
38 class HistogramBlock;
39 
41 {
42 public:
43  HistogramFile();
45 
47 
48  /** Convenience typdef for a STL list of pointers to histogram blocks. */
49  typedef std::list<HistogramBlock *> HistogramBlockList;
51 
52  uint32_t get_value(hint_t object_type, uint16_t x, uint16_t y, uint16_t z);
53 
54  void set_value(hint_t object_type, uint16_t x, uint16_t y, uint16_t z, uint32_t val);
55 
56 private:
57  std::map<hint_t, HistogramBlock *> attached_histograms;
58 };
59 
60 } // end namespace firevision
61 
62 #endif /* FIREVISION_FVUTILS_STATISTICAL_HISTOGRAM_FILE_H__ */
firevision::HistogramFile::HistogramFile
HistogramFile()
Constructor.
Definition: histogram_file.cpp:39
firevision::HistogramFile::HistogramBlockList
std::list< HistogramBlock * > HistogramBlockList
Convenience typdef for a STL list of pointers to histogram blocks.
Definition: histogram_file.h:49
firevision::HistogramFile::set_value
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.
Definition: histogram_file.cpp:113
firevision::FireVisionDataFile
Definition: fvfile.h:41
firevision::HistogramBlock
Definition: histogram_block.h:55
firevision::HistogramFile::get_value
uint32_t get_value(hint_t object_type, uint16_t x, uint16_t y, uint16_t z)
Get a value from a certain histogram.
Definition: histogram_file.cpp:96
firevision::HistogramFile
Definition: histogram_file.h:40
firevision::HistogramFile::histogram_blocks
HistogramBlockList histogram_blocks()
Generates a list of histogram blocks attached to the file.
Definition: histogram_file.cpp:69
firevision::HistogramFile::~HistogramFile
~HistogramFile()
Destructor.
Definition: histogram_file.cpp:46
firevision::HistogramFile::add_histogram_block
void add_histogram_block(HistogramBlock *block)
Adds a new histogram block to the file.
Definition: histogram_file.cpp:55