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
00033 typedef struct _histogram_block_header_t
00034 {
00035 uint16_t width;
00036 uint16_t height;
00037 uint16_t depth;
00038 uint8_t object_type;
00039 } histogram_block_header_t;
00040
00041
00042
00043 typedef enum _histogram_block_type_t
00044 {
00045 FIREVISION_HISTOGRAM_TYPE_16 = 0,
00046 FIREVISION_HISTOGRAM_TYPE_32 = 1
00047 } histogram_block_type_t;
00048
00049
00050 class HistogramBlock : public FireVisionDataFileBlock
00051 {
00052 public:
00053 HistogramBlock(histogram_block_type_t type, hint_t object_type,
00054 uint16_t width, uint16_t height, uint16_t depth = 0);
00055 HistogramBlock(FireVisionDataFileBlock* block);
00056
00057 virtual ~HistogramBlock();
00058
00059 uint16_t width() const;
00060 uint16_t height() const;
00061 uint16_t depth() const;
00062
00063 hint_t object_type() const;
00064 void set_object_type(hint_t object_type);
00065
00066 void set_data(uint32_t* data);
00067
00068 void set_value(uint16_t x, uint16_t y, uint32_t val);
00069 void set_value(uint16_t x, uint16_t y, uint16_t z, uint32_t val);
00070
00071 uint32_t get_value(uint16_t x, uint16_t y);
00072 uint32_t get_value(uint16_t x, uint16_t y, uint16_t z);
00073
00074 void reset();
00075
00076 private:
00077 histogram_block_header_t* _block_header;
00078 uint32_t* _histogram_data;
00079 };
00080
00081 #endif