cmfile.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 __FIREVISION_FVUTILS_COLORMAP_CMFILE_H_
00025 #define __FIREVISION_FVUTILS_COLORMAP_CMFILE_H_
00026
00027 #include <fvutils/fileformat/fvfile.h>
00028 #include <fvutils/colormap/cmfile_block.h>
00029 #include <vector>
00030 #include <string>
00031 #include <stdint.h>
00032
00033 namespace firevision {
00034 #if 0
00035 }
00036 #endif
00037
00038 class Colormap;
00039
00040 #define CMFILE_MAGIC_TOKEN 0xFF01
00041 #define CMFILE_CUR_VERSION 2
00042
00043 #define CMFILE_TYPE_YUV 1
00044
00045 #pragma pack(push,4)
00046
00047 typedef struct {
00048 uint16_t depth;
00049 uint16_t width;
00050 uint16_t height;
00051 uint16_t reserved;
00052 } cmfile_header_t;
00053 #pragma pack(pop)
00054
00055 class ColormapFile : public FireVisionDataFile
00056 {
00057 public:
00058 ColormapFile();
00059 ColormapFile(uint16_t depth, uint16_t width, uint16_t height);
00060
00061 class ColormapBlockVector : public std::vector<ColormapFileBlock *>
00062 {
00063 public:
00064 ~ColormapBlockVector();
00065 };
00066
00067 void add_colormap(Colormap *colormap);
00068 ColormapBlockVector * colormap_blocks();
00069 Colormap * get_colormap();
00070
00071 uint16_t get_depth();
00072 uint16_t get_width();
00073 uint16_t get_height();
00074
00075 static bool is_colormap_file(const char *filename);
00076 static std::string compose_filename(const std::string format);
00077
00078 virtual void clear();
00079
00080 private:
00081 inline void assert_header();
00082 private:
00083 cmfile_header_t *__header;
00084 };
00085
00086 }
00087
00088 #endif