00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef OSGDATIMAGEFILETYPE_CLASS_DECLARATION
00040 #define OSGDATIMAGEFILETYPE_CLASS_DECLARATION
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044
00045 #include <OSGSystemDef.h>
00046 #include <OSGBaseTypes.h>
00047 #include <OSGImageFileType.h>
00048
00049 OSG_BEGIN_NAMESPACE
00050
00055 class OSG_SYSTEMLIB_DLLMAPPING DATImageFileType : public ImageFileType
00056 {
00057
00058 public:
00059
00060
00064 virtual ~DATImageFileType (void);
00065
00067
00071 static DATImageFileType& the (void);
00072
00074
00078 virtual bool read (ImagePtr &image, const Char8 *fileName);
00079
00080 virtual bool write (const ImagePtr &image, const Char8 *fileName);
00081
00083
00087 virtual UInt64 restoreData ( ImagePtr &image, const UChar8 *buffer,
00088 Int32 memSize = -1 );
00089
00090 virtual UInt64 storeData ( const ImagePtr &image, UChar8 *buffer,
00091 Int32 memSize = -1 );
00094
00095 protected:
00096
00097
00101 DATImageFileType ( const Char8 *mimeType,
00102 const Char8 *suffixArray[], UInt16 suffixByteCount );
00103
00106
00107 private:
00108
00109
00113 DATImageFileType (const DATImageFileType &obj);
00114
00116
00120 const DATImageFileType & operator= (const DATImageFileType &obj);
00121
00124 static DATImageFileType _the;
00125
00126 enum KeyType
00127 {
00128 UNKNOWN_KT = 0,
00129
00130 OBJECT_FILE_NAME_KT,
00131 RESOLUTION_KT,
00132 SLICE_THICKNESS_KT,
00133 FORMAT_KT,
00134 FILE_OFFSET_KT,
00135 CHANNEL_KT,
00136 ENDIAN_KT
00137 };
00138
00139 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00140
00143 struct FormatDesc
00144 {
00145 bool needConversion;
00146
00147 Image::Type type;
00148 UInt32 bpv;
00149 Image::PixelFormat pixelFormat;
00150 };
00151
00152 #endif
00153
00154 static std::map<std::string, KeyType> _keyStrMap;
00155 static std::map<std::string, FormatDesc> _formatStrMap;
00156
00157 static void initTypeMap(void);
00158 };
00159
00160 typedef DATImageFileType* DATImageFileTypeP;
00161
00162 OSG_END_NAMESPACE
00163
00164 #endif // OSGDATIMAGEFILETYPE_CLASS_DECLARATION