histogram_file.h

00001
00002 /***************************************************************************
00003  *  histogram_file.h - Histogram file
00004  *
00005  *  Created: Sat Mar 29 16:03:12 2008
00006  *  Copyright  2008  Daniel Beck
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023
00024 #ifndef __FIREVISION_FVUTILS_STATISTICAL_HISTOGRAM_FILE_H_
00025 #define __FIREVISION_FVUTILS_STATISTICAL_HISTOGRAM_FILE_H_
00026 
00027 #define FIREVISION_HISTOGRAM_MAGIC  0xFF04
00028 #define FIREVISION_HISTOGRAM_CURVER 1
00029 
00030 #include <fvutils/fileformat/fvfile.h>
00031 #include <fvutils/base/roi.h>
00032 #include <vector>
00033 #include <map>
00034
00035 class HistogramBlock;
00036
00037 class HistogramFile : public FireVisionDataFile
00038 {
00039  public:
00040   HistogramFile();
00041   ~HistogramFile();
00042
00043   void add_histogram_block(HistogramBlock* block);
00044 
00045   /** Convenience typdef for a STL list of pointers to histogram blocks. */
00046   typedef std::list<HistogramBlock*> HistogramBlockList;
00047   HistogramBlockList histogram_blocks();
00048
00049   uint32_t get_value(hint_t object_type,
00050                      uint16_t x, uint16_t y, uint16_t z);
00051
00052   void set_value(hint_t object_type,
00053                  uint16_t x, uint16_t y, uint16_t z,
00054                  uint32_t val);
00055
00056  private:
00057   std::map<hint_t, HistogramBlock*> attached_histograms;
00058 };
00059
00060 #endif /* __FIREVISION_FVUTILS_STATISTICAL_HISTOGRAM_FILE_H_ */