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(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 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 typedef double Quantum;
95 #define QuantumRange 18446744073709551615.0
96 #define QuantumFormat "%g"
99 # error "Specified value of MAGICKCORE_QUANTUM_DEPTH is not supported"
102 #define MaxRGB QuantumRange /* deprecated */
105 Typedef declarations.
107 typedef unsigned int MagickStatusType;
108 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
109 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
110 typedef long long MagickOffsetType;
111 typedef unsigned long long MagickSizeType;
112 #define MagickSizeFormat "%10llu"
114 typedef long MagickOffsetType;
115 typedef unsigned long MagickSizeType;
116 #define MagickSizeFormat "%10lu"
119 typedef __int64 MagickOffsetType;
120 typedef unsigned __int64 MagickSizeType;
121 #define MagickSizeFormat "%10llu"
124 #if defined(_MSC_VER) && (_MSC_VER == 1200)
125 typedef MagickOffsetType QuantumAny;
127 typedef MagickSizeType QuantumAny;
130 #if defined(macintosh)
131 #define ExceptionInfo MagickExceptionInfo
138 GrayChannel = 0x0001,
139 CyanChannel = 0x0001,
140 GreenChannel = 0x0002,
141 MagentaChannel = 0x0002,
142 BlueChannel = 0x0004,
143 YellowChannel = 0x0004,
144 AlphaChannel = 0x0008,
145 OpacityChannel = 0x0008,
146 MatteChannel = 0x0008, /* deprecated */
147 BlackChannel = 0x0020,
148 IndexChannel = 0x0020,
149 AllChannels = 0x002F,
150 /* special channel types */
151 TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */
152 RGBChannels = 0x0080, /* set alpha from grayscale mask in RGB */
153 GrayChannels = 0x0080,
154 SyncChannels = 0x0100, /* channels should be modified equally */
155 DefaultChannels = ( (AllChannels | SyncChannels) &~ OpacityChannel)
171 typedef struct _BlobInfo BlobInfo;
173 typedef struct _ExceptionInfo ExceptionInfo;
175 typedef struct _Image Image;
177 typedef struct _ImageInfo ImageInfo;
179 #if defined(__cplusplus) || defined(c_plusplus)