histogram_block.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FIREVISIONE_FVUTILS_STATISTICAL_HISTOGRAM_BLOCK_H_
00025 #define __FIREVISIONE_FVUTILS_STATISTICAL_HISTOGRAM_BLOCK_H_
00026
00027 #include <fvutils/fileformat/fvfile_block.h>
00028 #include <fvutils/base/roi.h>
00029 #include <stdint.h>
00030
00031
00032 namespace firevision {
00033 #if 0
00034 }
00035 #endif
00036
00037
00038 typedef struct _histogram_block_header_t
00039 {
00040 uint16_t width;
00041 uint16_t height;
00042 uint16_t depth;
00043 uint8_t object_type;
00044 } histogram_block_header_t;
00045
00046
00047
00048 typedef enum _histogram_block_type_t
00049 {
00050 FIREVISION_HISTOGRAM_TYPE_16 = 0,
00051 FIREVISION_HISTOGRAM_TYPE_32 = 1
00052 } histogram_block_type_t;
00053
00054
00055 class HistogramBlock : public FireVisionDataFileBlock
00056 {
00057 public:
00058 HistogramBlock(histogram_block_type_t type, hint_t object_type,
00059 uint16_t width, uint16_t height, uint16_t depth = 0);
00060 HistogramBlock(FireVisionDataFileBlock* block);
00061
00062 virtual ~HistogramBlock();
00063
00064 uint16_t width() const;
00065 uint16_t height() const;
00066 uint16_t depth() const;
00067
00068 hint_t object_type() const;
00069 void set_object_type(hint_t object_type);
00070
00071 void set_data(uint32_t* data);
00072
00073 void set_value(uint16_t x, uint16_t y, uint32_t val);
00074 void set_value(uint16_t x, uint16_t y, uint16_t z, uint32_t val);
00075
00076 uint32_t get_value(uint16_t x, uint16_t y);
00077 uint32_t get_value(uint16_t x, uint16_t y, uint16_t z);
00078
00079 void reset();
00080
00081 private:
00082 histogram_block_header_t* _block_header;
00083 uint32_t* _histogram_data;
00084 };
00085
00086 }
00087
00088 #endif