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
build-2.6
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-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
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
convert.hh
ost::io::OST_DOUBLE_FORMAT
Definition:
image_format.hh:70
ost::io::ImageFormatBase::GetMaximum
Real GetMaximum() const
Definition:
image_format.hh:51
ost::io::OST_DEFAULT_FORMAT
Definition:
image_format.hh:70
ost::io::MRC_OLD_FORMAT
Definition:
image_format.hh:74
ost::io::ImageFormatBase::ImageFormatBase
ImageFormatBase(const String &formatstring)
Definition:
image_format.hh:45
String
std::string String
Definition:
base.hh:54
Real
float Real
Definition:
base.hh:44
ost::io::ImageFormatBase
Definition:
image_format.hh:37
data_types.hh
ost::io::MRC_AUTO_FORMAT
Definition:
image_format.hh:74
ost::io::ImageFormatBase::GetFormatString
String GetFormatString() const
Definition:
image_format.hh:60
ost::io::OST_BIT32_FORMAT
Definition:
image_format.hh:70
ost::io::OST_BIT16_FORMAT
Definition:
image_format.hh:70
ost::io::MRC_NEW_FORMAT
Definition:
image_format.hh:74
ost::io::Subformat
Subformat
Definition:
image_format.hh:73
ost::io::ImageFormatBase::ImageFormatBase
ImageFormatBase()
Definition:
image_format.hh:41
ost::io::UndefinedImageFormat::UndefinedImageFormat
UndefinedImageFormat()
Definition:
image_format.hh:82
ost::io::Format
Format
Definition:
image_format.hh:68
DLLEXPORT_OST_IO
#define DLLEXPORT_OST_IO
Definition:
module_config.hh:27
ost::io::OST_BIT8_FORMAT
Definition:
image_format.hh:70
ost::io::ImageFormatBase::As
const T & As() const
Definition:
image_format.hh:56
ost::io::ImageFormatBase::GetMinimum
Real GetMinimum() const
Definition:
image_format.hh:52
module_config.hh
ost::io::OST_FLOAT_FORMAT
Definition:
image_format.hh:70
base.hh
Generated by
1.8.5