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 MaxColormapSize 256UL
44 typedef double MagickRealType;
45 #if defined(MAGICKCORE_HDRI_SUPPORT)
46 typedef float Quantum;
47 #define QuantumRange 255.0
48 #define QuantumFormat "%g"
50 typedef unsigned char Quantum;
51 #define QuantumRange 255
52 #define QuantumFormat "%u"
54 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
55 #define MagickEpsilon 1.0e-10
56 #define MaxColormapSize 65536UL
57 #define MaxMap 65535UL
59 typedef double MagickRealType;
60 #if defined(MAGICKCORE_HDRI_SUPPORT)
61 typedef float Quantum;
62 #define QuantumRange 65535.0
63 #define QuantumFormat "%g"
65 typedef unsigned short Quantum;
66 #define QuantumRange 65535
67 #define QuantumFormat "%u"
69 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
70 #define MagickEpsilon 1.0e-10
71 #define MaxColormapSize 65536UL
72 #define MaxMap 65535UL
74 typedef double MagickRealType;
75 #if defined(MAGICKCORE_HDRI_SUPPORT)
76 typedef float Quantum;
77 #define QuantumRange 4294967295.0
78 #define QuantumFormat "%g"
80 typedef unsigned int Quantum;
81 #define QuantumRange 4294967295
82 #define QuantumFormat "%u"
84 #elif (MAGICKCORE_QUANTUM_DEPTH == 64) && defined(MAGICKCORE_HAVE_LONG_DOUBLE_WIDER)
85 #define MagickEpsilon 1.0e-10
86 #define MaxColormapSize 65536UL
87 #define MaxMap 65535UL
89 typedef long double MagickRealType;
90 typedef double Quantum;
91 #define QuantumRange 18446744073709551615.0
92 #define QuantumFormat "%g"
95 # error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
98 #define MagickHuge 3.402823466E+38F
99 #define MagickPI 3.14159265358979323846264338327950288419716939937510L
100 #define QuantumScale ((double) 1.0/(double) QuantumRange)
103 Typedef declarations.
105 typedef unsigned int MagickStatusType;
106 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
107 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
108 typedef long long MagickOffsetType;
109 typedef unsigned long long MagickSizeType;
110 #define MagickOffsetFormat "lld"
111 #define MagickSizeFormat "llu"
113 typedef ssize_t MagickOffsetType;
114 typedef size_t MagickSizeType;
115 #define MagickOffsetFormat "ld"
116 #define MagickSizeFormat "lu"
119 typedef __int64 MagickOffsetType;
120 typedef unsigned __int64 MagickSizeType;
121 #define MagickOffsetFormat "I64i"
122 #define MagickSizeFormat "I64u"
125 #if defined(_MSC_VER) && (_MSC_VER == 1200)
126 typedef MagickOffsetType QuantumAny;
128 typedef MagickSizeType QuantumAny;
131 #if defined(macintosh)
132 #define ExceptionInfo MagickExceptionInfo
137 UndefinedChannel = 0x0000,
139 GrayChannel = 0x0001,
140 CyanChannel = 0x0001,
141 GreenChannel = 0x0002,
142 MagentaChannel = 0x0002,
143 BlueChannel = 0x0004,
144 YellowChannel = 0x0004,
145 AlphaChannel = 0x0008,
146 OpacityChannel = 0x0008,
147 BlackChannel = 0x0010,
148 IndexChannel = 0x0020,
149 CompositeChannels = 0x002F,
150 AllChannels = 0x7ffffff,
152 Special purpose channel types.
154 TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */
155 RGBChannels = 0x0080, /* set alpha from grayscale mask in RGB */
156 GrayChannels = 0x0080,
157 SyncChannels = 0x0100, /* channels should be modified equally */
158 DefaultChannels = ((AllChannels | SyncChannels) &~ AlphaChannel)
174 typedef struct _BlobInfo BlobInfo;
176 typedef struct _ExceptionInfo ExceptionInfo;
178 typedef struct _Image Image;
180 typedef struct _ImageInfo ImageInfo;
182 #if defined(__cplusplus) || defined(c_plusplus)