MagickCore  6.9.7
magick-type.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2017 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  http://www.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 
31 #if !defined(MagickPathExtent)
32 #define MagickPathExtent MaxTextExtent
33 #endif
34 
35 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__) && !defined(__MINGW64__)
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 (MAGICKCORE_QUANTUM_DEPTH == 8)
44 #define MaxColormapSize 256UL
45 #define MaxMap 255UL
46 
47 /*
48  Float_t is not an ABI type.
49 */
50 #if MAGICKCORE_SIZEOF_FLOAT_T == 0
51 typedef float MagickRealType;
52 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT)
53 typedef float MagickRealType;
54 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE)
55 typedef double MagickRealType;
56 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
57 typedef long double MagickRealType;
58 #else
59 # error Your float_t type is neither a float, nor a double, nor a long double
60 #endif
61 
62 typedef ssize_t SignedQuantum;
63 #if defined(MAGICKCORE_HDRI_SUPPORT)
64 typedef float Quantum;
65 #define QuantumRange 255.0
66 #define QuantumFormat "%g"
67 #else
68 typedef unsigned char Quantum;
69 #define QuantumRange ((Quantum) 255)
70 #define QuantumFormat "%u"
71 #endif
72 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
73 #define MaxColormapSize 65536UL
74 #define MaxMap 65535UL
75 
76 /*
77  Float_t is not an ABI type.
78 */
79 #if MAGICKCORE_SIZEOF_FLOAT_T == 0
80 typedef float MagickRealType;
81 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT)
82 typedef float MagickRealType;
83 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE)
84 typedef double MagickRealType;
85 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
86 typedef long double MagickRealType;
87 #else
88 # error Your float_t type is neither a float, nor a double, nor a long double
89 #endif
90 
91 typedef ssize_t SignedQuantum;
92 #if defined(MAGICKCORE_HDRI_SUPPORT)
93 typedef float Quantum;
94 #define QuantumRange 65535.0
95 #define QuantumFormat "%g"
96 #else
97 typedef unsigned short Quantum;
98 #define QuantumRange ((Quantum) 65535)
99 #define QuantumFormat "%u"
100 #endif
101 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
102 #define MaxColormapSize 65536UL
103 #define MaxMap 65535UL
104 
105 /*
106  Double_t is not an ABI type.
107 */
108 #if MAGICKCORE_SIZEOF_DOUBLE_T == 0
109 typedef double MagickRealType;
110 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_DOUBLE)
111 typedef double MagickRealType;
112 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
113 typedef long double MagickRealType;
114 #else
115 # error Your double_t type is neither a float, nor a double, nor a long double
116 #endif
117 
118 typedef double SignedQuantum;
119 #if defined(MAGICKCORE_HDRI_SUPPORT)
120 typedef double Quantum;
121 #define QuantumRange 4294967295.0
122 #define QuantumFormat "%g"
123 #else
124 typedef unsigned int Quantum;
125 #define QuantumRange ((Quantum) 4294967295)
126 #define QuantumFormat "%u"
127 #endif
128 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
129 #define MAGICKCORE_HDRI_SUPPORT 1
130 #define MaxColormapSize 65536UL
131 #define MaxMap 65535UL
132 
133 typedef long double MagickRealType;
134 typedef long double SignedQuantum;
135 typedef long double Quantum;
136 #define QuantumRange 18446744073709551615.0
137 #define QuantumFormat "%g"
138 #else
139 #if !defined(_CH_)
140 # error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
141 #endif
142 #endif
143 #define MagickEpsilon (1.0e-15)
144 #define MagickMaximumValue 1.79769313486231570E+308
145 #define MagickMinimumValue 2.22507385850720140E-308
146 #define QuantumScale ((double) 1.0/(double) QuantumRange)
147 
148 /*
149  Typedef declarations.
150 */
151 typedef unsigned int MagickStatusType;
152 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
153 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
154 typedef long long MagickOffsetType;
155 typedef unsigned long long MagickSizeType;
156 #define MagickOffsetFormat "lld"
157 #define MagickSizeFormat "llu"
158 #else
159 typedef ssize_t MagickOffsetType;
160 typedef size_t MagickSizeType;
161 #define MagickOffsetFormat "ld"
162 #define MagickSizeFormat "lu"
163 #endif
164 #else
165 typedef __int64 MagickOffsetType;
166 typedef unsigned __int64 MagickSizeType;
167 #define MagickOffsetFormat "I64i"
168 #define MagickSizeFormat "I64u"
169 #endif
170 
171 #if defined(_MSC_VER) && (_MSC_VER == 1200)
172 typedef MagickOffsetType QuantumAny;
173 #else
174 typedef MagickSizeType QuantumAny;
175 #endif
176 
177 #if defined(macintosh)
178 #define ExceptionInfo MagickExceptionInfo
179 #endif
180 
181 typedef enum
182 {
184  RedChannel = 0x0001,
185  GrayChannel = 0x0001,
186  CyanChannel = 0x0001,
187  GreenChannel = 0x0002,
188  MagentaChannel = 0x0002,
189  BlueChannel = 0x0004,
190  YellowChannel = 0x0004,
191  AlphaChannel = 0x0008,
192  OpacityChannel = 0x0008,
193  MatteChannel = 0x0008, /* deprecated */
194  BlackChannel = 0x0020,
195  IndexChannel = 0x0020,
197  AllChannels = 0x7ffffff,
198  /*
199  Special purpose channel types.
200  */
201  TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */
202  RGBChannels = 0x0080, /* set alpha from grayscale mask in RGB */
203  GrayChannels = 0x0080,
204  SyncChannels = 0x0100, /* channels should be modified equally */
206 } ChannelType;
207 
208 typedef enum
209 {
213 } ClassType;
214 
215 typedef enum
216 {
220 
221 #if defined(MAGICKCORE_HAVE_ISNAN)
222 # define IsNaN(a) isnan(a)
223 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
224 # include <float.h>
225 # define IsNaN(a) _isnan(a)
226 #else
227 # define IsNaN(a) ((a) != (a))
228 #endif
229 
230 typedef struct _BlobInfo BlobInfo;
231 
233 
234 typedef struct _Image Image;
235 
236 typedef struct _ImageInfo ImageInfo;
237 
238 #if defined(__cplusplus) || defined(c_plusplus)
239 }
240 #endif
241 
242 #endif
Definition: magick-type.h:202
Definition: exception.h:102
Definition: magick-type.h:191
Definition: magick-type.h:197
Definition: magick-type.h:186
Definition: image.h:361
Definition: magick-type.h:211
float MagickRealType
Definition: magick-type.h:80
Definition: blob.c:113
ssize_t SignedQuantum
Definition: magick-type.h:91
Definition: magick-type.h:192
ssize_t MagickOffsetType
Definition: magick-type.h:159
Definition: image.h:152
Definition: magick-type.h:204
MagickBooleanType
Definition: magick-type.h:215
unsigned int MagickStatusType
Definition: magick-type.h:151
ClassType
Definition: magick-type.h:208
Definition: magick-type.h:188
Definition: magick-type.h:218
size_t MagickSizeType
Definition: magick-type.h:160
Definition: magick-type.h:190
Definition: magick-type.h:205
Definition: magick-type.h:185
Definition: magick-type.h:194
Definition: magick-type.h:193
Definition: magick-type.h:201
ChannelType
Definition: magick-type.h:181
Definition: magick-type.h:187
Definition: magick-type.h:217
unsigned short Quantum
Definition: magick-type.h:97
Definition: magick-type.h:183
Definition: magick-type.h:210
Definition: magick-type.h:189
Definition: magick-type.h:196
Definition: magick-type.h:184
Definition: magick-type.h:212
Definition: magick-type.h:203
MagickSizeType QuantumAny
Definition: magick-type.h:174
Definition: magick-type.h:195