My Project
pixeltype.hh
Go to the documentation of this file.
1/* -*- mia-c++ -*-
2 *
3 * This file is part of MIA - a toolbox for medical image analysis
4 * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5 *
6 * MIA is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef mia_core_pixeltype_hh
22#define mia_core_pixeltype_hh
23
24#include <cstdint>
25#include <mia/core/dictmap.hh>
26#include <miaconfig.h>
27
29
47
63
64
67
70
73
76
81template <typename T>
82struct pixel_type {
83 static const EPixelType value = it_unknown;
84};
85
86template <>
87struct pixel_type<bool> {
88 static const EPixelType value = it_bit;
89};
90
91template <>
92struct pixel_type<int8_t> {
93 static const EPixelType value = it_sbyte;
94};
95
96template <>
97struct pixel_type<uint8_t> {
98 static const EPixelType value = it_ubyte;
99};
100
101template <>
102struct pixel_type<int16_t> {
103 static const EPixelType value = it_sshort;
104};
105
106template <>
107struct pixel_type<uint16_t> {
108 static const EPixelType value = it_ushort;
109};
110
111template <>
112struct pixel_type<int32_t> {
113 static const EPixelType value = it_sint;
114};
115
116template <>
117struct pixel_type<uint32_t> {
118 static const EPixelType value = it_uint;
119};
120
121template <>
122struct pixel_type<int64_t> {
123 static const EPixelType value = it_slong;
124};
125
126template <>
127struct pixel_type<uint64_t> {
128 static const EPixelType value = it_ulong;
129};
130
131template <>
132struct pixel_type<float> {
133 static const EPixelType value = it_float;
134};
135
136template <>
137struct pixel_type<double> {
138 static const EPixelType value = it_double;
139};
140
142
144
145#endif
A mapper from emums to string values. - usefull for names flags.
Definition dictmap.hh:46
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
EXPORT_CORE const TDictMap< EPixelType > CPixelTypeDict
dictionary for the pixel types
EPixelConversion
Definition pixeltype.hh:51
@ pc_opt
Definition pixeltype.hh:56
@ pc_range
Definition pixeltype.hh:53
@ pc_opt_stat
Definition pixeltype.hh:58
@ pc_copy
Definition pixeltype.hh:51
@ pc_linear
Definition pixeltype.hh:52
@ pc_unknown
Definition pixeltype.hh:61
EXPORT_CORE const TDictMap< EPixelType >::Table PixelTypeTable[]
dictionary table for the pixel types
EXPORT_CORE const TDictMap< EPixelConversion > CPixelConversionDict
dictionary for the pixel conversion types
EPixelType
Definition pixeltype.hh:33
@ it_slong
Definition pixeltype.hh:40
@ it_ushort
Definition pixeltype.hh:37
@ it_float
Definition pixeltype.hh:42
@ it_unknown
Definition pixeltype.hh:45
@ it_ubyte
Definition pixeltype.hh:35
@ it_uint
Definition pixeltype.hh:39
@ it_double
Definition pixeltype.hh:43
@ it_none
Definition pixeltype.hh:44
@ it_ulong
Definition pixeltype.hh:41
@ it_sbyte
Definition pixeltype.hh:34
@ it_sshort
Definition pixeltype.hh:36
@ it_sint
Definition pixeltype.hh:38
@ it_bit
Definition pixeltype.hh:33
EXPORT_CORE const TDictMap< EPixelConversion >::Table ConversionTypeTable[]
dictionary table for the pixel conversion types