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 #ifndef IMG_IMAGE_FORMAT_H
00028 #define IMG_IMAGE_FORMAT_H
00029
00030 #include <ost/img/data_types.hh>
00031 #include <ost/base.hh>
00032 #include <ost/io/convert.hh>
00033 #include <ost/io/module_config.hh>
00034
00035 namespace ost { namespace io {
00036
00037 class DLLEXPORT_OST_IO ImageFormatBase
00038 {
00039 protected:
00040
00041 ImageFormatBase():
00042 format_string_(""),
00043 min_(0.0),
00044 max_(1.0)
00045 {};
00046
00047 ImageFormatBase(const String& formatstring):
00048 format_string_(formatstring),
00049 min_(0.0),
00050 max_(1.0)
00051 {};
00052
00053 public:
00054
00055 Real GetMaximum() const { return max_;}
00056 void SetMaximum(Real max) { max_ = max; }
00057 Real GetMinimum() const { return min_;}
00058 void SetMinimum(Real min) { min_ = min; }
00059
00060
00061 template <typename T>
00062 const T& As() const
00063 {
00064 return reinterpret_cast<const T&>(*this);
00065 }
00066 String GetFormatString() const {return format_string_;}
00067
00068 private:
00069
00070 String format_string_;
00071 Real min_,max_;
00072
00073 };
00074
00075 enum Format
00076 {
00077 OST_BIT8_FORMAT,OST_BIT16_FORMAT,OST_BIT32_FORMAT,OST_FLOAT_FORMAT,OST_DOUBLE_FORMAT,OST_DEFAULT_FORMAT
00078 };
00079
00080 enum Subformat {
00081 MRC_OLD_FORMAT,MRC_NEW_FORMAT,MRC_AUTO_FORMAT
00082 };
00083
00084
00085
00086 class DLLEXPORT_OST_IO UndefinedImageFormat : public ImageFormatBase
00087 {
00088 public:
00089 UndefinedImageFormat():
00090 ImageFormatBase(FORMAT_STRING)
00091 {}
00092
00093 static String FORMAT_STRING;
00094
00095 };
00096
00097
00098 }}
00099
00100 #endif