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/fileformat/fvfile.h>
31 #include <fvutils/base/roi.h>
32 #include <vector>
33 #include <map>
34 
35 namespace firevision {
36 #if 0 /* just to make Emacs auto-indent happy */
37 }
38 #endif
39 
40 class HistogramBlock;
41 
43 {
44  public:
45  HistogramFile();
47 
49 
50  /** Convenience typdef for a STL list of pointers to histogram blocks. */
51  typedef std::list<HistogramBlock*> HistogramBlockList;
52  HistogramBlockList histogram_blocks();
53 
54  uint32_t get_value(hint_t object_type,
55  uint16_t x, uint16_t y, uint16_t z);
56 
57  void set_value(hint_t object_type,
58  uint16_t x, uint16_t y, uint16_t z,
59  uint32_t val);
60 
61  private:
62  std::map<hint_t, HistogramBlock*> attached_histograms;
63 };
64 
65 
66 } // end namespace firevision
67 
68 #endif /* __FIREVISION_FVUTILS_STATISTICAL_HISTOGRAM_FILE_H_ */
HistogramBlockList histogram_blocks()
Generates a list of histogram blocks attached to the file.
uint32_t get_value(hint_t object_type, uint16_t x, uint16_t y, uint16_t z)
Get a value from a certain histogram.
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.
void add_histogram_block(HistogramBlock *block)
Adds a new histogram block to the file.
std::list< HistogramBlock * > HistogramBlockList
Convenience typdef for a STL list of pointers to histogram blocks.
FireVision File Format for data files.
Definition: fvfile.h:37
This class defines a file block for histograms.
A fileformat for histograms.