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-2013 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 <mia/core/dictmap.hh>
25 #include <miaconfig.h>
26 
28 
39 #ifdef LONG_64BIT
40  it_slong,
41  it_ulong,
42 #endif
47 };
48 
63 
64 
67 
70 
73 
76 
81 template <typename T>
82 struct pixel_type {
83  static const EPixelType value = it_unknown;
84 };
85 
86 template <>
87 struct pixel_type<bool> {
88  static const EPixelType value = it_bit;
89 };
90 
91 template <>
92 struct pixel_type<signed char> {
93  static const EPixelType value = it_sbyte;
94 };
95 
96 template <>
97 struct pixel_type<unsigned char> {
98  static const EPixelType value = it_ubyte;
99 };
100 
101 template <>
102 struct pixel_type<signed short> {
103  static const EPixelType value = it_sshort;
104 };
105 
106 template <>
107 struct pixel_type<unsigned short> {
108  static const EPixelType value = it_ushort;
109 };
110 
111 template <>
112 struct pixel_type<signed int> {
113  static const EPixelType value = it_sint;
114 };
115 
116 template <>
117 struct pixel_type<unsigned int> {
118  static const EPixelType value = it_uint;
119 };
120 
121 #ifdef LONG_64BIT
122 template <>
123 struct pixel_type<signed long> {
124  static const EPixelType value = it_slong;
125 };
126 
127 template <>
128 struct pixel_type<unsigned long> {
129  static const EPixelType value = it_ulong;
130 };
131 #endif
132 
133 template <>
134 struct pixel_type<float> {
135  static const EPixelType value = it_float;
136 };
137 
138 template <>
139 struct pixel_type<double> {
140  static const EPixelType value = it_double;
141 };
142 
144 
146 
147 #endif