MagickCore  7.0.10
magick-type.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License. You may
6  obtain a copy of the License at
7 
8  https://imagemagick.org/script/license.php
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  MagickCore types.
17 */
18 #ifndef MAGICKCORE_MAGICK_TYPE_H
19 #define MAGICKCORE_MAGICK_TYPE_H
20 
22 
23 #if MAGICKCORE_HAVE_UINTPTR_T
24 # include <stdint.h>
25 #endif
26 
27 #if defined(__cplusplus) || defined(c_plusplus)
28 extern "C" {
29 #endif
30 
31 #if !defined(MAGICKCORE_QUANTUM_DEPTH)
32 #define MAGICKCORE_QUANTUM_DEPTH 16
33 #endif
34 
35 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__)
36 # define MagickLLConstant(c) ((MagickOffsetType) (c ## i64))
37 # define MagickULLConstant(c) ((MagickSizeType) (c ## ui64))
38 #else
39 # define MagickLLConstant(c) ((MagickOffsetType) (c ## LL))
40 # define MagickULLConstant(c) ((MagickSizeType) (c ## ULL))
41 #endif
42 
43 #if defined(__s390__)
44 typedef double MagickFloatType;
45 #else
46 #if MAGICKCORE_SIZEOF_FLOAT_T == 0
47 typedef float MagickFloatType;
48 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT)
49 typedef float MagickFloatType;
50 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE)
51 typedef double MagickFloatType;
52 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
53 typedef double MagickFloatType;
54 #else
55 #error Your MagickFloatType type is neither a float, nor a double, nor a long double
56 #endif
57 #endif
58 #if MAGICKCORE_SIZEOF_DOUBLE_T == 0
59 typedef double MagickDoubleType;
60 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_DOUBLE)
61 typedef double MagickDoubleType;
62 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
63 typedef double MagickDoubleType;
64 #else
65 #error Your MagickDoubleType type is neither a float, nor a double, nor a long double
66 #endif
67 
68 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
69 #define MaxColormapSize 256UL
70 #define MaxMap 255UL
71 
72 #if defined(MAGICKCORE_HDRI_SUPPORT)
73 typedef MagickFloatType Quantum;
74 #define QuantumRange 255.0
75 #define QuantumFormat "%g"
76 #else
77 typedef unsigned char Quantum;
78 #define QuantumRange ((Quantum) 255)
79 #define QuantumFormat "%u"
80 #endif
81 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
82 #define MaxColormapSize 65536UL
83 #define MaxMap 65535UL
84 
85 #if defined(MAGICKCORE_HDRI_SUPPORT)
86 typedef MagickFloatType Quantum;
87 #define QuantumRange 65535.0f
88 #define QuantumFormat "%g"
89 #else
90 typedef unsigned short Quantum;
91 #define QuantumRange ((Quantum) 65535)
92 #define QuantumFormat "%u"
93 #endif
94 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
95 #define MaxColormapSize 65536UL
96 #define MaxMap 65535UL
97 
98 #if defined(MAGICKCORE_HDRI_SUPPORT)
100 #define QuantumRange 4294967295.0
101 #define QuantumFormat "%g"
102 #else
103 typedef unsigned int Quantum;
104 #define QuantumRange ((Quantum) 4294967295)
105 #define QuantumFormat "%u"
106 #endif
107 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
108 #define MAGICKCORE_HDRI_SUPPORT 1
109 #define MaxColormapSize 65536UL
110 #define MaxMap 65535UL
111 
112 typedef MagickDoubleType Quantum;
113 #define QuantumRange 18446744073709551615.0
114 #define QuantumFormat "%g"
115 #else
116 #error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
117 #endif
118 #define MagickEpsilon 1.0e-12
119 #define MagickMaximumValue 1.79769313486231570E+308
120 #define MagickMinimumValue 2.22507385850720140E-308
121 #define MagickStringify(macro_or_string) MagickStringifyArg(macro_or_string)
122 #define MagickStringifyArg(contents) #contents
123 #define QuantumScale ((double) 1.0/(double) QuantumRange)
124 
125 /*
126  Typedef declarations.
127 */
129 typedef unsigned int MagickStatusType;
130 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
131 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
132 typedef long long MagickOffsetType;
133 typedef unsigned long long MagickSizeType;
134 #define MagickOffsetFormat "lld"
135 #define MagickSizeFormat "llu"
136 #else
137 typedef ssize_t MagickOffsetType;
138 typedef size_t MagickSizeType;
139 #define MagickOffsetFormat "ld"
140 #define MagickSizeFormat "lu"
141 #endif
142 #else
143 typedef __int64 MagickOffsetType;
144 typedef unsigned __int64 MagickSizeType;
145 #define MagickOffsetFormat "I64i"
146 #define MagickSizeFormat "I64u"
147 #endif
148 
149 #if MAGICKCORE_HAVE_UINTPTR_T || defined(uintptr_t)
150 typedef uintptr_t MagickAddressType;
151 #else
152 /* Hope for the best, I guess. */
153 typedef size_t MagickAddressType;
154 #endif
155 
156 #if defined(_MSC_VER) && (_MSC_VER == 1200)
158 #else
160 #endif
161 
162 #if defined(macintosh)
163 #define ExceptionInfo MagickExceptionInfo
164 #endif
165 
166 typedef enum
167 {
171 } ClassType;
172 
173 typedef enum
174 {
178 
179 /*
180  The IsNaN test is for special floating point numbers of value Nan (not a
181  number). NaN's are defined as part of the IEEE standard for floating point
182  number representation, and need to be watched out for. Morphology Kernels
183  often use these special numbers as neighbourhood masks.
184 
185  The special property that two NaN's are never equal, even if they are from
186  the same variable allows you to test if a value is special NaN value.
187 
188  The macros are thus is only true if the value given is NaN.
189 */
190 #if defined(MAGICKCORE_HAVE_ISNAN)
191 # define IsNaN(a) isnan(a)
192 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
193 # include <float.h>
194 # define IsNaN(a) _isnan(a)
195 #else
196 # define IsNaN(a) ((a) != (a))
197 #endif
198 #if !defined(INFINITY)
199 # define INFINITY ((double) -logf(0f))
200 #endif
201 
202 typedef struct _BlobInfo BlobInfo;
203 
205 
206 typedef struct _Image Image;
207 
208 typedef struct _ImageInfo ImageInfo;
209 
210 #if defined(__cplusplus) || defined(c_plusplus)
211 }
212 #endif
213 
214 #endif
MagickDoubleType MagickRealType
Definition: magick-type.h:128
double MagickDoubleType
Definition: magick-type.h:59
float MagickFloatType
Definition: magick-type.h:47
ssize_t MagickOffsetType
Definition: magick-type.h:137
Definition: image.h:151
MagickBooleanType
Definition: magick-type.h:173
unsigned int MagickStatusType
Definition: magick-type.h:129
ClassType
Definition: magick-type.h:166
size_t MagickSizeType
Definition: magick-type.h:138
unsigned short Quantum
Definition: magick-type.h:90
size_t MagickAddressType
Definition: magick-type.h:153
MagickSizeType QuantumAny
Definition: magick-type.h:159