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