22 #include "ColorSpace.hpp"
27 namespace FotoSHOCKcore {
51 enum Enum {value_ANY, value_ANYINT, value_ANYFLOAT, value_SAME,
52 value_uint1, value_uint8, value_uint16, value_uint32, value_uint64,
53 value_float, value_double};
62 : m_ID(value_ANY), m_bits(0), m_formatter(0) {}
78 constexpr
operator Enum()
const {
return m_ID;};
80 constexpr
unsigned int bits()
const {
return m_bits;};
82 constexpr cmsUInt32Number
cmsFormatter()
const {
return m_formatter;};
85 constexpr
ValueType(
const Enum v,
const unsigned int bit,
const cmsUInt32Number formatter)
86 : m_ID(v), m_bits(bit), m_formatter(formatter) {}
90 cmsUInt32Number m_formatter;
135 template <
typename ValueDataType>
143 return std::numeric_limits<ValueDataType>::min();
147 return std::numeric_limits<ValueDataType>::max();
169 template <ValueType::Enum format>
176 typedef int_fast8_t SignedPromote;
177 typedef uint_fast8_t UnsignedPromote;
183 typedef int_fast16_t SignedPromote;
184 typedef uint_fast16_t UnsignedPromote;
190 typedef int_fast32_t SignedPromote;
191 typedef uint_fast32_t UnsignedPromote;
197 typedef int_fast64_t SignedPromote;
198 typedef uint_fast64_t UnsignedPromote;
204 typedef int_fast64_t SignedPromote;
205 typedef uint_fast64_t UnsignedPromote;
211 typedef double SignedPromote;
212 typedef double UnsignedPromote;
218 typedef double SignedPromote;
219 typedef double UnsignedPromote;
233 #define case_ANYINT \
234 case FotoSHOCKcore::ValueType::value_uint1: \
235 FORMAT_DO_STH(FotoSHOCKcore::ValueTypeEnum::uint1, FotoSHOCKcore::ValueTypeInfo<FotoSHOCKcore::ValueType::value_uint1>::Type); \
237 case FotoSHOCKcore::ValueType::value_uint8: \
238 FORMAT_DO_STH(FotoSHOCKcore::ValueTypeEnum::uint8, FotoSHOCKcore::ValueTypeInfo<FotoSHOCKcore::ValueType::value_uint8>::Type); \
240 case FotoSHOCKcore::ValueType::value_uint16: \
241 FORMAT_DO_STH(FotoSHOCKcore::ValueTypeEnum::uint16, FotoSHOCKcore::ValueTypeInfo<FotoSHOCKcore::ValueType::value_uint16>::Type); \
243 case FotoSHOCKcore::ValueType::value_uint32: \
244 FORMAT_DO_STH(FotoSHOCKcore::ValueTypeEnum::uint32, FotoSHOCKcore::ValueTypeInfo<FotoSHOCKcore::ValueType::value_uint32>::Type); \
246 case FotoSHOCKcore::ValueType::value_uint64: \
247 FORMAT_DO_STH(FotoSHOCKcore::ValueTypeEnum::uint64, FotoSHOCKcore::ValueTypeInfo<FotoSHOCKcore::ValueType::value_uint64>::Type); \
254 #define case_ANYFLOAT \
255 case FotoSHOCKcore::ValueType::value_float: \
256 FORMAT_DO_STH(FotoSHOCKcore::ValueTypeEnum::floatval, FotoSHOCKcore::ValueTypeInfo<FotoSHOCKcore::ValueType::value_float>::Type); \
258 case FotoSHOCKcore::ValueType::value_double: \
259 FORMAT_DO_STH(FotoSHOCKcore::ValueTypeEnum::doubleval, FotoSHOCKcore::ValueTypeInfo<FotoSHOCKcore::ValueType::value_double>::Type); \