00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DX_IO_DAT_IO_PLUGIN_OST_HH
00021 #define DX_IO_DAT_IO_PLUGIN_OST_HH
00022
00023
00024
00025
00026
00027
00028 #include "map_io_handler.hh"
00029
00030 namespace ost { namespace io {
00031
00032 class DLLEXPORT_OST_IO DAT: public ImageFormatBase
00033 {
00034
00035 public:
00036
00037 DAT(bool normalize_on_save = true, Format bit_depth = OST_DEFAULT_FORMAT, bool sign = false,Endianess endianness = OST_LOCAL_ENDIAN);
00038
00039 Format GetBitDepth() const;
00040 void SetBitDepth ( Format bitdepth);
00041
00042 bool GetSigned () const;
00043 void SetSigned (bool sign);
00044
00045 Endianess GetEndianess() const;
00046 void SetEndianess(Endianess end);
00047 bool GetNormalizeOnSave() const;
00048 void SetNormalizeOnSave(bool noralize_on_save);
00049 Real GetMaximum() const;
00050 Real GetMinimum() const;
00051 static String FORMAT_STRING;
00052
00053 private:
00054
00055 bool normalize_on_save_;
00056 Format bit_depth_;
00057 bool signed_;
00058 Endianess endianness_;
00059 };
00060
00061 class DLLEXPORT_OST_IO MapIODatHandler: public MapIOHandler
00062 {
00063 public:
00067 virtual void Import(img::MapHandle& sh, const boost::filesystem::path& loc,const ImageFormatBase& formatstruct );
00068 virtual void Import(img::MapHandle& sh, std::istream& loc, const ImageFormatBase& formatstruct);
00069 virtual void Export(const img::MapHandle& sh, const boost::filesystem::path& loc, const ImageFormatBase& formatstruct) const;
00070 virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const;
00071 static bool MatchContent(unsigned char* header);
00072 static bool MatchType(const ImageFormatBase& type);
00073 static bool MatchSuffix(const String& loc);
00074 static bool ProvidesImport() { return true; }
00075 static bool ProvidesExport() { return true; }
00076 static String GetFormatName() { return String("Dat"); }
00077 static String GetFormatDescription() {return String("Simple binary format for square images");}
00078 };
00079
00080 typedef MapIOHandlerFactory<MapIODatHandler> MapIODatHandlerFactory;
00081
00082 }}
00083
00084 #endif