MagickCore  6.9.10
Convert, Edit, Or Compose Bitmap Images
magick-type.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2019 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.
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 
21 #include "magick/magick-config.h"
22 
23 #if defined(__cplusplus) || defined(c_plusplus)
24 extern "C" {
25 #endif
26 
27 #if !defined(MAGICKCORE_QUANTUM_DEPTH)
28 #define MAGICKCORE_QUANTUM_DEPTH 16
29 #endif
30 #if !defined(MagickPathExtent)
31 #define MagickPathExtent MaxTextExtent
32 #endif
33 
34 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__)
35 # define MagickLLConstant(c) ((MagickOffsetType) (c ## i64))
36 # define MagickULLConstant(c) ((MagickSizeType) (c ## ui64))
37 #else
38 # define MagickLLConstant(c) ((MagickOffsetType) (c ## LL))
39 # define MagickULLConstant(c) ((MagickSizeType) (c ## ULL))
40 #endif
41 
42 #if !defined(__s390__)
43 #if MAGICKCORE_SIZEOF_FLOAT_T == 0
44 typedef float MagickFloatType;
45 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT)
46 typedef float MagickFloatType;
47 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE)
48 typedef double MagickFloatType;
49 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
50 typedef long double MagickFloatType;
51 #else
52 #error Your MagickFloatType type is neither a float, nor a double, nor a long double
53 #endif
54 #else
55 typedef double MagickFloatType;
56 #endif
57 #if MAGICKCORE_SIZEOF_DOUBLE_T == 0
58 typedef double MagickDoubleType;
59 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_DOUBLE)
60 typedef double MagickDoubleType;
61 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
62 typedef long double MagickDoubleType;
63 #else
64 #error Your MagickDoubleType type is neither a float, nor a double, nor a long double
65 #endif
66 
67 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
68 #define MaxColormapSize 256UL
69 #define MaxMap 255UL
70 typedef ssize_t SignedQuantum;
71 #if defined(MAGICKCORE_HDRI_SUPPORT)
72 typedef MagickFloatType Quantum;
73 #define QuantumRange 255.0
74 #define QuantumFormat "%g"
75 #else
76 typedef unsigned char Quantum;
77 #define QuantumRange ((Quantum) 255)
78 #define QuantumFormat "%u"
79 #endif
80 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
81 #define MaxColormapSize 65536UL
82 #define MaxMap 65535UL
83 typedef ssize_t SignedQuantum;
84 #if defined(MAGICKCORE_HDRI_SUPPORT)
85 typedef MagickFloatType Quantum;
86 #define QuantumRange 65535.0
87 #define QuantumFormat "%g"
88 #else
89 typedef unsigned short Quantum;
90 #define QuantumRange ((Quantum) 65535)
91 #define QuantumFormat "%u"
92 #endif
93 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
94 #define MaxColormapSize 65536UL
95 #define MaxMap 65535UL
97 #if defined(MAGICKCORE_HDRI_SUPPORT)
99 #define QuantumRange 4294967295.0
100 #define QuantumFormat "%g"
101 #else
102 typedef unsigned int Quantum;
103 #define QuantumRange ((Quantum) 4294967295)
104 #define QuantumFormat "%u"
105 #endif
106 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
107 #define MAGICKCORE_HDRI_SUPPORT 1
108 #define MaxColormapSize 65536UL
109 #define MaxMap 65535UL
111 typedef MagickDoubleType Quantum;
112 #define QuantumRange 18446744073709551615.0
113 #define QuantumFormat "%g"
114 #else
115 #if !defined(_CH_)
116 # error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
117 #endif
118 #endif
119 #define MagickEpsilon (1.0e-12)
120 #define MagickMaximumValue 1.79769313486231570E+308
121 #define MagickMinimumValue 2.22507385850720140E-308
122 #define MagickStringify(macro_or_string) MagickStringifyArg(macro_or_string)
123 #define MagickStringifyArg(contents) #contents
124 #define QuantumScale ((double) 1.0/(double) QuantumRange)
125 
126 /*
127  Typedef declarations.
128 */
130 
131 typedef unsigned int MagickStatusType;
132 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
133 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
134 typedef long long MagickOffsetType;
135 typedef unsigned long long MagickSizeType;
136 #define MagickOffsetFormat "lld"
137 #define MagickSizeFormat "llu"
138 #else
139 typedef ssize_t MagickOffsetType;
140 typedef size_t MagickSizeType;
141 #define MagickOffsetFormat "ld"
142 #define MagickSizeFormat "lu"
143 #endif
144 #else
145 typedef __int64 MagickOffsetType;
146 typedef unsigned __int64 MagickSizeType;
147 #define MagickOffsetFormat "I64i"
148 #define MagickSizeFormat "I64u"
149 #endif
150 
151 #if defined(_MSC_VER) && (_MSC_VER == 1200)
153 #else
155 #endif
156 
157 #if defined(macintosh)
158 #define ExceptionInfo MagickExceptionInfo
159 #endif
160 
161 typedef enum
162 {
164  RedChannel = 0x0001,
165  GrayChannel = 0x0001,
166  CyanChannel = 0x0001,
167  GreenChannel = 0x0002,
168  MagentaChannel = 0x0002,
169  BlueChannel = 0x0004,
170  YellowChannel = 0x0004,
171  AlphaChannel = 0x0008,
172  OpacityChannel = 0x0008,
173  MatteChannel = 0x0008, /* deprecated */
174  BlackChannel = 0x0020,
175  IndexChannel = 0x0020,
177  AllChannels = 0x7ffffff,
178  /*
179  Special purpose channel types.
180  */
181  TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */
182  RGBChannels = 0x0080, /* set alpha from grayscale mask in RGB */
183  GrayChannels = 0x0080,
184  SyncChannels = 0x0100, /* channels should be modified equally */
187 
188 typedef enum
189 {
194 
195 typedef enum
196 {
198  MagickTrue = 1
200 
201 /*
202  The IsNaN test is for special floating point numbers of value Nan (not a
203  number). NaN's are defined as part of the IEEE standard for floating point
204  number representation, and need to be watched out for. Morphology Kernels
205  often use these special numbers as neighbourhood masks.
206 
207  The special property that two NaN's are never equal, even if they are from
208  the same variable allows you to test if a value is special NaN value.
209 
210  The macros are thus is only true if the value given is NaN.
211 */
212 #if defined(MAGICKCORE_HAVE_ISNAN)
213 # define IsNaN(a) isnan(a)
214 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
215 # include <float.h>
216 # define IsNaN(a) _isnan(a)
217 #else
218 # define IsNaN(a) ((a) != (a))
219 #endif
220 #if !defined(INFINITY)
221 # define INFINITY (-logf(0f))
222 #endif
223 
224 typedef struct _BlobInfo BlobInfo;
225 
226 typedef struct _ExceptionInfo ExceptionInfo;
227 
228 typedef struct _Image Image;
229 
230 typedef struct _ImageInfo ImageInfo;
231 
232 #if defined(__cplusplus) || defined(c_plusplus)
233 }
234 #endif
235 
236 #endif
float MagickFloatType
Definition: magick-type.h:44
ChannelType
Definition: magick-type.h:162
@ MatteChannel
Definition: magick-type.h:173
@ UndefinedChannel
Definition: magick-type.h:163
@ GrayChannels
Definition: magick-type.h:183
@ AllChannels
Definition: magick-type.h:177
@ GreenChannel
Definition: magick-type.h:167
@ OpacityChannel
Definition: magick-type.h:172
@ CompositeChannels
Definition: magick-type.h:176
@ TrueAlphaChannel
Definition: magick-type.h:181
@ BlackChannel
Definition: magick-type.h:174
@ DefaultChannels
Definition: magick-type.h:185
@ BlueChannel
Definition: magick-type.h:169
@ RedChannel
Definition: magick-type.h:164
@ SyncChannels
Definition: magick-type.h:184
@ YellowChannel
Definition: magick-type.h:170
@ MagentaChannel
Definition: magick-type.h:168
@ RGBChannels
Definition: magick-type.h:182
@ IndexChannel
Definition: magick-type.h:175
@ CyanChannel
Definition: magick-type.h:166
@ AlphaChannel
Definition: magick-type.h:171
@ GrayChannel
Definition: magick-type.h:165
MagickDoubleType MagickRealType
Definition: magick-type.h:129
double MagickDoubleType
Definition: magick-type.h:58
ssize_t MagickOffsetType
Definition: magick-type.h:139
ssize_t SignedQuantum
Definition: magick-type.h:83
unsigned short Quantum
Definition: magick-type.h:89
unsigned int MagickStatusType
Definition: magick-type.h:131
ClassType
Definition: magick-type.h:189
@ UndefinedClass
Definition: magick-type.h:190
@ DirectClass
Definition: magick-type.h:191
@ PseudoClass
Definition: magick-type.h:192
MagickSizeType QuantumAny
Definition: magick-type.h:154
size_t MagickSizeType
Definition: magick-type.h:140
MagickBooleanType
Definition: magick-type.h:196
@ MagickFalse
Definition: magick-type.h:197
@ MagickTrue
Definition: magick-type.h:198
Definition: blob.c:115
Definition: exception.h:103
Definition: image.h:362
Definition: image.h:153