18#ifndef MAGICKCORE_MAGICK_TYPE_H
19#define MAGICKCORE_MAGICK_TYPE_H
21#include "MagickCore/magick-config.h"
23#if defined(MAGICKCORE_HAVE_UINTPTR_T)
27#if defined(__cplusplus) || defined(c_plusplus)
31#if !defined(MAGICKCORE_QUANTUM_DEPTH)
32#define MAGICKCORE_QUANTUM_DEPTH 16
35#if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__)
36# define MagickLLConstant(c) ((MagickOffsetType) (c ## i64))
37# define MagickULLConstant(c) ((MagickSizeType) (c ## ui64))
39# define MagickLLConstant(c) ((MagickOffsetType) (c ## LL))
40# define MagickULLConstant(c) ((MagickSizeType) (c ## ULL))
43#if MAGICKCORE_SIZEOF_FLOAT_T == 0
44typedef float MagickFloatType;
45#elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT)
46typedef float MagickFloatType;
47#elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE)
48typedef double MagickFloatType;
49#elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
50typedef double MagickFloatType;
52#error Your MagickFloatType type is neither a float, nor a double, nor a long double
54#if MAGICKCORE_SIZEOF_DOUBLE_T == 0
55typedef double MagickDoubleType;
56#elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_DOUBLE)
57typedef double MagickDoubleType;
58#elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
59typedef double MagickDoubleType;
61#error Your MagickDoubleType type is neither a float, nor a double, nor a long double
64#if (MAGICKCORE_QUANTUM_DEPTH == 8)
65#define MaxColormapSize 256UL
68#if defined(MAGICKCORE_HDRI_SUPPORT)
69typedef MagickFloatType Quantum;
70#define QuantumRange ((Quantum) 255.0)
71#define QuantumFormat "%g"
73typedef unsigned char Quantum;
74#define QuantumRange ((Quantum) 255)
75#define QuantumFormat "%u"
77#elif (MAGICKCORE_QUANTUM_DEPTH == 16)
78#define MaxColormapSize 65536UL
81#if defined(MAGICKCORE_HDRI_SUPPORT)
82typedef MagickFloatType Quantum;
83#define QuantumRange ((Quantum) 65535.0)
84#define QuantumFormat "%g"
86typedef unsigned short Quantum;
87#define QuantumRange ((Quantum) 65535)
88#define QuantumFormat "%u"
90#elif (MAGICKCORE_QUANTUM_DEPTH == 32)
91#define MaxColormapSize 65536UL
94#if defined(MAGICKCORE_HDRI_SUPPORT)
95typedef MagickDoubleType Quantum;
96#define QuantumRange ((Quantum) 4294967295.0)
97#define QuantumFormat "%g"
99typedef unsigned int Quantum;
100#define QuantumRange ((Quantum) 4294967295)
101#define QuantumFormat "%u"
103#elif (MAGICKCORE_QUANTUM_DEPTH == 64)
104#define MAGICKCORE_HDRI_SUPPORT 1
105#define MaxColormapSize 65536UL
106#define MaxMap 65535UL
108typedef MagickDoubleType Quantum;
109#define QuantumRange ((Quantum) 18446744073709551615.0)
110#define QuantumFormat "%g"
112#error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
114#define MagickEpsilon 1.0e-12
115#define MagickMaximumValue 1.79769313486231570E+308
116#define MagickMinimumValue 2.22507385850720140E-308
117#define MagickStringify(macro_or_string) MagickStringifyArg(macro_or_string)
118#define MagickStringifyArg(contents) #contents
119#define QuantumScale ((double) 1.0/(double) QuantumRange)
124typedef MagickDoubleType MagickRealType;
125typedef unsigned int MagickStatusType;
126#if !defined(MAGICKCORE_WINDOWS_SUPPORT)
127#if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
128typedef long long MagickOffsetType;
129typedef unsigned long long MagickSizeType;
130#define MagickOffsetFormat "lld"
131#define MagickSizeFormat "llu"
133typedef ssize_t MagickOffsetType;
134typedef size_t MagickSizeType;
135#define MagickOffsetFormat "ld"
136#define MagickSizeFormat "lu"
139typedef __int64 MagickOffsetType;
140typedef unsigned __int64 MagickSizeType;
141#define MagickOffsetFormat "I64i"
142#define MagickSizeFormat "I64u"
145#if defined(MAGICKCORE_HAVE_UINTPTR_T) || defined(uintptr_t)
146typedef uintptr_t MagickAddressType;
149typedef size_t MagickAddressType;
152typedef MagickSizeType QuantumAny;
178#if defined(MAGICKCORE_HAVE_ISNAN) && !defined(__cplusplus) && !defined(c_plusplus)
179# define IsNaN(a) isnan(a)
180#elif defined(_MSC_VER)
182# define IsNaN(a) _isnan(a)
184# define IsNaN(a) ((a) != (a))
186#if !defined(INFINITY)
187# define INFINITY ((double) -logf(0f))
198#if defined(__cplusplus) || defined(c_plusplus)