2 Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 http://www.imagemagick.org/script/license.php
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.
18 #ifndef _MAGICKCORE_MAGICK_TYPE_H
19 #define _MAGICKCORE_MAGICK_TYPE_H
21 #if defined(__cplusplus) || defined(c_plusplus)
25 #include "MagickCore/magick-config.h"
27 #if !defined(MAGICKCORE_QUANTUM_DEPTH)
28 #define MAGICKCORE_QUANTUM_DEPTH 16
31 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__)
32 # define MagickLLConstant(c) (MagickOffsetType) (c ## i64)
33 # define MagickULLConstant(c) (MagickSizeType) (c ## ui64)
35 # define MagickLLConstant(c) (MagickOffsetType) (c ## LL)
36 # define MagickULLConstant(c) (MagickSizeType) (c ## ULL)
39 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
40 #define MagickEpsilon 1.0e-6
41 #define MagickHuge 1.0e6
42 #define MaxColormapSize 256UL
45 typedef double MagickRealType;
46 #if defined(MAGICKCORE_HDRI_SUPPORT)
47 typedef float Quantum;
48 #define QuantumRange 255.0
49 #define QuantumFormat "%g"
51 typedef unsigned char Quantum;
52 #define QuantumRange 255
53 #define QuantumFormat "%u"
55 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
56 #define MagickEpsilon 1.0e-10
57 #define MagickHuge 1.0e12
58 #define MaxColormapSize 65536UL
59 #define MaxMap 65535UL
61 typedef double MagickRealType;
62 #if defined(MAGICKCORE_HDRI_SUPPORT)
63 typedef float Quantum;
64 #define QuantumRange 65535.0
65 #define QuantumFormat "%g"
67 typedef unsigned short Quantum;
68 #define QuantumRange 65535
69 #define QuantumFormat "%u"
71 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
72 #define MagickEpsilon 1.0e-10
73 #define MagickHuge 1.0e12
74 #define MaxColormapSize 65536UL
75 #define MaxMap 65535UL
77 typedef double MagickRealType;
78 #if defined(MAGICKCORE_HDRI_SUPPORT)
79 typedef float Quantum;
80 #define QuantumRange 4294967295.0
81 #define QuantumFormat "%g"
83 typedef unsigned int Quantum;
84 #define QuantumRange 4294967295
85 #define QuantumFormat "%u"
87 #elif (MAGICKCORE_QUANTUM_DEPTH == 64) && defined(MAGICKCORE_HAVE_LONG_DOUBLE_WIDER)
88 #define MagickEpsilon 1.0e-10
89 #define MagickHuge 1.0e12
90 #define MaxColormapSize 65536UL
91 #define MaxMap 65535UL
93 typedef long double MagickRealType;
94 typedef double Quantum;
95 #define QuantumRange 18446744073709551615.0
96 #define QuantumFormat "%g"
99 # error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
102 #define MagickPI 3.14159265358979323846264338327950288419716939937510L
103 #define QuantumScale ((double) 1.0/(double) QuantumRange)
106 Typedef declarations.
108 typedef unsigned int MagickStatusType;
109 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
110 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
111 typedef long long MagickOffsetType;
112 typedef unsigned long long MagickSizeType;
113 #define MagickOffsetFormat "lld"
114 #define MagickSizeFormat "llu"
116 typedef ssize_t MagickOffsetType;
117 typedef size_t MagickSizeType;
118 #define MagickOffsetFormat "ld"
119 #define MagickSizeFormat "lu"
122 typedef __int64 MagickOffsetType;
123 typedef unsigned __int64 MagickSizeType;
124 #define MagickOffsetFormat "I64i"
125 #define MagickSizeFormat "I64u"
128 #if defined(_MSC_VER) && (_MSC_VER == 1200)
129 typedef MagickOffsetType QuantumAny;
131 typedef MagickSizeType QuantumAny;
134 #if defined(macintosh)
135 #define ExceptionInfo MagickExceptionInfo
140 UndefinedChannel = 0x0000,
142 GrayChannel = 0x0001,
143 CyanChannel = 0x0001,
144 GreenChannel = 0x0002,
145 MagentaChannel = 0x0002,
146 BlueChannel = 0x0004,
147 YellowChannel = 0x0004,
148 AlphaChannel = 0x0008,
149 OpacityChannel = 0x0008,
150 BlackChannel = 0x0010,
151 IndexChannel = 0x0020,
152 CompositeChannels = 0x002F,
153 AllChannels = 0x7ffffff,
155 Special purpose channel types.
157 TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */
158 RGBChannels = 0x0080, /* set alpha from grayscale mask in RGB */
159 GrayChannels = 0x0080,
160 SyncChannels = 0x0100, /* channels should be modified equally */
161 DefaultChannels = ((AllChannels | SyncChannels) &~ AlphaChannel)
177 typedef struct _BlobInfo BlobInfo;
179 typedef struct _ExceptionInfo ExceptionInfo;
181 typedef struct _Image Image;
183 typedef struct _ImageInfo ImageInfo;
185 #if defined(__cplusplus) || defined(c_plusplus)