00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DX_IO_SPI_IO_PLUGIN_OST_HH
00021 #define DX_IO_SPI_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 Spider: public ImageFormatBase
00033 {
00034
00035 public:
00036
00037 Spider(bool normalize_on_save = false, Endianess endianness_on_save = OST_LOCAL_ENDIAN);
00038
00039 bool GetNormalizeOnSave() const;
00040 void SetNormalizeOnSave(bool normalize_on_save);
00041
00042 Endianess GetEndianessOnSave() const;
00043 void SetEndianessOnSave(Endianess end);
00044
00045 static String FORMAT_STRING;
00046 static String FORMAT_NAME_STRING;
00047 static String FORMAT_DESCRIPTION_STRING;
00048
00049 private:
00050
00051 bool normalize_on_save_;
00052 Endianess endianness_on_save_;
00053 };
00054
00055 class DLLEXPORT_OST_IO MapIOSpiHandler: public MapIOHandler
00056 {
00057 public:
00061 virtual void Import(img::MapHandle& sh, const boost::filesystem::path& loc,const ImageFormatBase& formatstruct);
00062 virtual void Import(img::MapHandle& sh, std::istream& loc,const ImageFormatBase& formatstruct);
00063 virtual void Export(const img::MapHandle& sh, const boost::filesystem::path& loc, const ImageFormatBase& formatstruct) const;
00064 virtual void Export(const img::MapHandle& sh, std::ostream& loc,const ImageFormatBase& formatstruct) const;
00065 static bool MatchContent(unsigned char* header);
00066 static bool MatchType(const ImageFormatBase& type);
00067 static bool MatchSuffix(const String& loc);
00068 static String GetFormatName() { return String("Spider"); };
00069 static String GetFormatDescription() { return String("Format used by the Spider software package"); };
00070
00071 protected:
00072 void do_import(img::MapHandle& sh, std::istream& loc,const ImageFormatBase& formatstruct);
00073 };
00074
00075 typedef MapIOHandlerFactory<MapIOSpiHandler> MapIOSpiHandlerFactory;
00076
00077 }}
00078
00079 #endif