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-2011 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  min_(0.0),
44  max_(1.0)
45  {};
46 
47  ImageFormatBase(const String& formatstring):
48  format_string_(formatstring),
49  min_(0.0),
50  max_(1.0)
51  {};
52 
53  public:
54 
55  Real GetMaximum() const { return max_;}
56  void SetMaximum(Real max) { max_ = max; }
57  Real GetMinimum() const { return min_;}
58  void SetMinimum(Real min) { min_ = min; }
59 
60 
61  template <typename T>
62  const T& As() const
63  {
64  return reinterpret_cast<const T&>(*this);
65  }
66  String GetFormatString() const {return format_string_;}
67 
68  private:
69 
70  String format_string_;
71  Real min_,max_;
72 
73 };
74 
75 enum Format
76 {
78 };
79 
80 enum Subformat {
82 };
83 
84 
85 
87 {
88  public:
90  ImageFormatBase(FORMAT_STRING)
91  {}
92 
94 
95 };
96 
97 
98 }} // namespaces
99 
100 #endif