OpenStructure
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
stage
include
ost
io
img
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
37
class
DLLEXPORT_OST_IO
ImageFormatBase
38
{
39
protected
:
40
41
ImageFormatBase
():
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
{
70
OST_BIT8_FORMAT
,
OST_BIT16_FORMAT
,
OST_BIT32_FORMAT
,
OST_FLOAT_FORMAT
,
OST_DOUBLE_FORMAT
,
OST_DEFAULT_FORMAT
71
};
72
73
enum
Subformat
{
74
MRC_OLD_FORMAT
,
MRC_NEW_FORMAT
,
MRC_AUTO_FORMAT
75
};
76
77
78
79
class
DLLEXPORT_OST_IO
UndefinedImageFormat :
public
ImageFormatBase
80
{
81
public
:
82
UndefinedImageFormat
():
83
ImageFormatBase
(FORMAT_STRING)
84
{}
85
86
static
String
FORMAT_STRING;
87
88
};
89
90
91
}}
// namespaces
92
93
#endif
Generated on Thu Mar 5 2015 15:19:03 for OpenStructure by
1.8.1.1