OpenStructure
Loading...
Searching...
No Matches
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>
34
35namespace ost { namespace io {
36
37class DLLEXPORT_OST_IO ImageFormatBase
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
72
76
77
78
79class DLLEXPORT_OST_IO UndefinedImageFormat : public ImageFormatBase
80{
81 public:
83 ImageFormatBase(FORMAT_STRING)
84 {}
85
86 static String FORMAT_STRING;
87
88};
89
90
91}} // namespaces
92
93#endif
String GetFormatString() const
const T & As() const
ImageFormatBase(const String &formatstring)
#define DLLEXPORT_OST_IO
float Real
Definition base.hh:44
std::string String
Definition base.hh:54
@ MRC_AUTO_FORMAT
@ OST_BIT8_FORMAT
@ OST_DOUBLE_FORMAT
@ OST_BIT32_FORMAT
@ OST_BIT16_FORMAT
@ OST_DEFAULT_FORMAT
@ OST_FLOAT_FORMAT
Definition base.dox:1