2 Copyright 1999-2010 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 "magick/magick-config.h"
27 #if !defined(MAGICKCORE_QUANTUM_DEPTH)
28 #define MAGICKCORE_QUANTUM_DEPTH 16
31 #if defined(__WINDOWS__) && !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 255UL
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 65535UL
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 4294967295UL
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 #if defined(MAGICKCORE_HDRI_SUPPORT)
95 typedef double Quantum;
96 #define QuantumRange 18446744073709551615.0
97 #define QuantumFormat "%g"
99 typedef unsigned long long Quantum;
100 #define QuantumRange MagickULLConstant(18446744073709551615)
101 #define QuantumFormat "%llu"
105 # error "Specified value of MAGICKCORE_QUANTUM_DEPTH is not supported"
108 #define MaxRGB QuantumRange /* deprecated */
111 Typedef declarations.
113 typedef unsigned int MagickStatusType;
114 #if !defined(__WINDOWS__)
115 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
116 typedef long long MagickOffsetType;
117 typedef unsigned long long MagickSizeType;
118 #define MagickSizeFormat "%10llu"
120 typedef long MagickOffsetType;
121 typedef unsigned long MagickSizeType;
122 #define MagickSizeFormat "%10lu"
125 typedef __int64 MagickOffsetType;
126 typedef unsigned __int64 MagickSizeType;
127 #define MagickSizeFormat "%10llu"
130 #if defined(_MSC_VER) && (_MSC_VER == 1200)
131 typedef MagickOffsetType QuantumAny;
133 typedef MagickSizeType QuantumAny;
136 #if defined(macintosh)
137 #define ExceptionInfo MagickExceptionInfo
144 GrayChannel = 0x0001,
145 CyanChannel = 0x0001,
146 GreenChannel = 0x0002,
147 MagentaChannel = 0x0002,
148 BlueChannel = 0x0004,
149 YellowChannel = 0x0004,
150 AlphaChannel = 0x0008,
151 OpacityChannel = 0x0008,
152 MatteChannel = 0x0008, /* deprecated */
153 BlackChannel = 0x0020,
154 IndexChannel = 0x0020,
155 AllChannels = 0x002F,
156 /* special 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) &~ OpacityChannel)
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)