OpenStructure
image_format.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 // Copyright (C) 2003-2010 by the IPLT authors
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the Free
9 // Software Foundation; either version 3.0 of the License, or (at your option)
10 // any later version.
11 // This library is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 // details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //------------------------------------------------------------------------------
20 
21 /*
22  ImageFormat
23 
24  Author: Andreas Schenk
25 */
26 
27 #ifndef IMG_IMAGE_FORMAT_H
28 #define IMG_IMAGE_FORMAT_H
29 
30 #include <ost/img/data_types.hh>
31 #include <ost/base.hh>
32 #include <ost/io/convert.hh>
33 #include <ost/io/module_config.hh>
34 
35 namespace ost { namespace io {
36 
38 {
39  protected:
40 
42  format_string_("")
43  {};
44 
45  ImageFormatBase(const String& formatstring):
46  format_string_(formatstring)
47  {};
48 
49  public:
50 
51  Real GetMaximum() const { return 1.0;}
52  Real GetMinimum() const { return 0.0;}
53 
54 
55  template <typename T>
56  const T& As() const
57  {
58  return reinterpret_cast<const T&>(*this);
59  }
60  String GetFormatString() const {return format_string_;}
61 
62  private:
63 
64  String format_string_;
65 
66 };
67 
68 enum Format
69 {
71 };
72 
73 enum Subformat {
75 };
76 
77 
78 
80 {
81  public:
83  ImageFormatBase(FORMAT_STRING)
84  {}
85 
87 
88 };
89 
90 
91 }} // namespaces
92 
93 #endif
String GetFormatString() const
Definition: image_format.hh:60
ImageFormatBase(const String &formatstring)
Definition: image_format.hh:45
const T & As() const
Definition: image_format.hh:56
#define DLLEXPORT_OST_IO
float Real
Definition: base.hh:44
std::string String
Definition: base.hh:54
@ MRC_NEW_FORMAT
Definition: image_format.hh:74
@ MRC_AUTO_FORMAT
Definition: image_format.hh:74
@ MRC_OLD_FORMAT
Definition: image_format.hh:74
@ OST_BIT8_FORMAT
Definition: image_format.hh:70
@ OST_DOUBLE_FORMAT
Definition: image_format.hh:70
@ OST_BIT32_FORMAT
Definition: image_format.hh:70
@ OST_BIT16_FORMAT
Definition: image_format.hh:70
@ OST_DEFAULT_FORMAT
Definition: image_format.hh:70
@ OST_FLOAT_FORMAT
Definition: image_format.hh:70
Definition: base.dox:1