pixeltype.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_core_pixeltype_hh
#define mia_core_pixeltype_hh
#include <cstdint>
#include <mia/core/dictmap.hh>
#include <miaconfig.h>
NS_MIA_BEGIN
enum EPixelType {it_bit,
it_sbyte,
it_ubyte,
it_sshort,
it_ushort,
it_sint,
it_uint,
it_slong,
it_ulong,
it_float,
it_double,
it_none,
it_unknown
};
enum EPixelConversion {pc_copy,
pc_linear,
pc_range,
pc_opt,
pc_opt_stat,
pc_unknown
};
EXPORT_CORE extern const TDictMap<EPixelType>::Table PixelTypeTable[];
EXPORT_CORE extern const TDictMap<EPixelType> CPixelTypeDict;
EXPORT_CORE extern const TDictMap<EPixelConversion>::Table ConversionTypeTable[];
EXPORT_CORE extern const TDictMap<EPixelConversion> CPixelConversionDict;
template <typename T>
struct pixel_type {
static const EPixelType value = it_unknown;
};
template <>
struct pixel_type<bool> {
static const EPixelType value = it_bit;
};
template <>
struct pixel_type<int8_t> {
static const EPixelType value = it_sbyte;
};
template <>
struct pixel_type<uint8_t> {
static const EPixelType value = it_ubyte;
};
template <>
struct pixel_type<int16_t> {
static const EPixelType value = it_sshort;
};
template <>
struct pixel_type<uint16_t> {
static const EPixelType value = it_ushort;
};
template <>
struct pixel_type<int32_t> {
static const EPixelType value = it_sint;
};
template <>
struct pixel_type<uint32_t> {
static const EPixelType value = it_uint;
};
template <>
struct pixel_type<int64_t> {
static const EPixelType value = it_slong;
};
template <>
struct pixel_type<uint64_t> {
static const EPixelType value = it_ulong;
};
template <>
struct pixel_type<float> {
static const EPixelType value = it_float;
};
template <>
struct pixel_type<double> {
static const EPixelType value = it_double;
};
NS_MIA_END
#endif
TDictMap
A mapper from emums to string values. - usefull for names flags.
Definition dictmap.hh:46
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
dictmap.hh
CPixelTypeDict
EXPORT_CORE const TDictMap< EPixelType > CPixelTypeDict
dictionary for the pixel types
EPixelConversion
EPixelConversion
Definition pixeltype.hh:51
pc_opt
@ pc_opt
Definition pixeltype.hh:56
pc_range
@ pc_range
Definition pixeltype.hh:53
pc_opt_stat
@ pc_opt_stat
Definition pixeltype.hh:58
pc_copy
@ pc_copy
Definition pixeltype.hh:51
pc_linear
@ pc_linear
Definition pixeltype.hh:52
pc_unknown
@ pc_unknown
Definition pixeltype.hh:61
PixelTypeTable
EXPORT_CORE const TDictMap< EPixelType >::Table PixelTypeTable[]
dictionary table for the pixel types
CPixelConversionDict
EXPORT_CORE const TDictMap< EPixelConversion > CPixelConversionDict
dictionary for the pixel conversion types
EPixelType
EPixelType
Definition pixeltype.hh:33
it_slong
@ it_slong
Definition pixeltype.hh:40
it_ushort
@ it_ushort
Definition pixeltype.hh:37
it_float
@ it_float
Definition pixeltype.hh:42
it_unknown
@ it_unknown
Definition pixeltype.hh:45
it_ubyte
@ it_ubyte
Definition pixeltype.hh:35
it_uint
@ it_uint
Definition pixeltype.hh:39
it_double
@ it_double
Definition pixeltype.hh:43
it_none
@ it_none
Definition pixeltype.hh:44
it_ulong
@ it_ulong
Definition pixeltype.hh:41
it_sbyte
@ it_sbyte
Definition pixeltype.hh:34
it_sshort
@ it_sshort
Definition pixeltype.hh:36
it_sint
@ it_sint
Definition pixeltype.hh:38
it_bit
@ it_bit
Definition pixeltype.hh:33
ConversionTypeTable
EXPORT_CORE const TDictMap< EPixelConversion >::Table ConversionTypeTable[]
dictionary table for the pixel conversion types
TDictMap::Table
Definition dictmap.hh:55