#define MaxMap 65535UL
typedef long double MagickRealType;
-#if defined(MAGICKCORE_HDRI_SUPPORT)
typedef double Quantum;
#define QuantumRange 18446744073709551615.0
#define QuantumFormat "%g"
#else
-typedef unsigned long long Quantum;
-#define QuantumRange MagickULLConstant(18446744073709551615)
-#define QuantumFormat "%llu"
-#endif
-#else
#if !defined(_CH_)
# error "Specified value of MAGICKCORE_QUANTUM_DEPTH is not supported"
#endif
#elif (MAGICKCORE_QUANTUM_DEPTH == 64)
static inline Quantum ScaleCharToQuantum(const unsigned char value)
{
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
- return((Quantum) (MagickULLConstant(72340172838076673)*value));
-#else
return((Quantum) (72340172838076673.0*value));
-#endif
}
static inline Quantum ScaleLongToQuantum(const unsigned long value)
{
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
- return((Quantum) (MagickULLConstant(4294967295)*value));
-#else
return((Quantum) (4294967295.0*value));
-#endif
}
static inline Quantum ScaleMapToQuantum(const MagickRealType value)
return((Quantum) 0);
if (value >= MaxMap)
return(QuantumRange);
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
- return((Quantum) (281479271743489.0*value+0.5));
-#else
return((Quantum) (281479271743489.0*value));
-#endif
}
static inline unsigned long ScaleQuantumToLong(const Quantum quantum)
static inline unsigned long ScaleQuantumToMap(const Quantum quantum)
{
- if ((quantum/281479271743489.0) >= MaxMap)
- return((unsigned long) MaxMap);
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
- return((unsigned long) (quantum/281479271743489.0+0.5));
-#else
if (quantum <= 0.0)
return(0UL);
+ if ((quantum/281479271743489.0) >= MaxMap)
+ return((unsigned long) MaxMap);
return((unsigned long) (quantum/281479271743489.0+0.5));
-#endif
}
static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
static inline Quantum ScaleShortToQuantum(const unsigned short value)
{
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
- return((Quantum) (MagickULLConstant(281479271743489)*value));
-#else
return((Quantum) (281479271743489.0*value));
-#endif
}
#endif