MagickCore
6.9.10
Convert, Edit, Or Compose Bitmap Images
studio.h
Go to the documentation of this file.
1
/*
2
Copyright 1999-2019 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. You may
6
obtain a copy of the License at
7
8
https://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 private application programming interface declarations.
17
*/
18
#ifndef MAGICKCORE_STUDIO_H
19
#define MAGICKCORE_STUDIO_H
20
21
#if defined(__cplusplus) || defined(c_plusplus)
22
extern
"C"
{
23
#endif
24
25
#if defined(WIN32) || defined(WIN64)
26
# define MAGICKCORE_WINDOWS_SUPPORT
27
#else
28
# define MAGICKCORE_POSIX_SUPPORT
29
#endif
30
31
#define MAGICKCORE_IMPLEMENTATION 1
32
33
#if !defined(MAGICKCORE_CONFIG_H)
34
# define MAGICKCORE_CONFIG_H
35
# if !defined(vms) && !defined(macintosh)
36
# include "
magick/magick-config.h
"
37
# else
38
# include "
magick-config.h
"
39
# endif
40
#if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
41
# define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
42
#endif
43
#if defined(_magickcore_const) && !defined(const)
44
# define const _magickcore_const
45
#endif
46
#if defined(_magickcore_inline) && !defined(inline)
47
# define inline _magickcore_inline
48
#endif
49
# if defined(__cplusplus) || defined(c_plusplus)
50
# undef inline
51
# endif
52
#endif
53
54
#if defined(MAGICKCORE_NAMESPACE_PREFIX)
55
# include "
magick/methods.h
"
56
#endif
57
58
#if !defined(const)
59
# define STDC
60
#endif
61
62
#if defined(__cplusplus) || defined(c_plusplus)
63
# define magick_module _module
/* reserved word in C++(20) */
64
#else
65
# define magick_module module
66
#endif
67
68
#include <stdarg.h>
69
#include <stdio.h>
70
#if defined(MAGICKCORE_HAVE_SYS_STAT_H)
71
# include <sys/stat.h>
72
#endif
73
#if defined(MAGICKCORE_STDC_HEADERS)
74
# include <stdlib.h>
75
# include <stddef.h>
76
#else
77
# if defined(MAGICKCORE_HAVE_STDLIB_H)
78
# include <stdlib.h>
79
# endif
80
#endif
81
#if !defined(magick_restrict)
82
# if !defined(_magickcore_restrict)
83
# define magick_restrict restrict
84
# else
85
# define magick_restrict _magickcore_restrict
86
# endif
87
#endif
88
#if defined(MAGICKCORE_HAVE_STRING_H)
89
# if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
90
# include <memory.h>
91
# endif
92
# include <string.h>
93
#endif
94
#if defined(MAGICKCORE_HAVE_STRINGS_H)
95
# include <strings.h>
96
#endif
97
#if defined(MAGICKCORE_HAVE_INTTYPES_H)
98
# include <inttypes.h>
99
#endif
100
#if defined(MAGICKCORE_HAVE_STDINT_H)
101
# include <stdint.h>
102
#endif
103
#if defined(MAGICKCORE_HAVE_UNISTD_H)
104
# include <unistd.h>
105
#endif
106
#if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
107
#define _CRTDBG_MAP_ALLOC
108
#endif
109
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
110
# include <io.h>
111
#if !defined(__CYGWIN__)
112
# include <direct.h>
113
#endif
114
# if !defined(MAGICKCORE_HAVE_STRERROR)
115
# define HAVE_STRERROR
116
# endif
117
#endif
118
119
#include <ctype.h>
120
#include <locale.h>
121
#include <errno.h>
122
#include <fcntl.h>
123
#include <math.h>
124
#include <time.h>
125
#include <limits.h>
126
#include <signal.h>
127
#include <assert.h>
128
129
#if defined(MAGICKCORE_HAVE_XLOCALE_H)
130
# include <xlocale.h>
131
#endif
132
#if defined(MAGICKCORE_THREAD_SUPPORT)
133
# include <pthread.h>
134
#endif
135
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
136
#if !defined(__CYGWIN__)
137
#include <winsock2.h>
138
#include <ws2tcpip.h>
139
#endif
140
#include <windows.h>
141
#pragma comment (lib, "ws2_32.lib")
142
#endif
143
#if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
144
# include <sys/syslimits.h>
145
#endif
146
#if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
147
# include <arm/limits.h>
148
#endif
149
150
#if defined(MAGICKCORE__OPENCL) && !defined(MAGICK_PIXEL_RGBA)
151
#if defined(MAGICKCORE_HAVE_CL_CL_H)
152
# include <CL/cl.h>
153
#endif
154
#if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
155
# include <OpenCL/cl.h>
156
#endif
157
# define MAGICKCORE_OPENCL_SUPPORT 1
158
#endif
159
160
#if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
161
# include <omp.h>
162
# define MAGICKCORE_OPENMP_SUPPORT 1
163
#endif
164
165
#if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
166
ssize_t pread(
int
,
void
*,
size_t
,off_t);
167
#endif
168
169
#if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
170
ssize_t pwrite(
int
,
const
void
*,
size_t
,off_t);
171
#endif
172
173
#if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
174
extern
size_t
strlcpy(
char
*,
const
char
*,
size_t
);
175
#endif
176
177
#if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
178
extern
int
vsnprintf(
char
*,
size_t
,
const
char
*,va_list);
179
#endif
180
181
#include "
magick/method-attribute.h
"
182
183
#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
184
# include <sys/types.h>
185
# include <sys/stat.h>
186
# if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
187
# include <sys/timeb.h>
188
# endif
189
# if defined(MAGICKCORE_POSIX_SUPPORT)
190
# if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
191
# define dirent direct
192
# define NAMLEN(dirent) (dirent)->d_namlen
193
# if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
194
# include <sys/ndir.h>
195
# endif
196
# if defined(MAGICKCORE_HAVE_SYS_DIR_H)
197
# include <sys/dir.h>
198
# endif
199
# if defined(MAGICKCORE_HAVE_NDIR_H)
200
# include <ndir.h>
201
# endif
202
# else
203
# include <dirent.h>
204
# define NAMLEN(dirent) strlen((dirent)->d_name)
205
# endif
206
# include <sys/wait.h>
207
# include <pwd.h>
208
# endif
209
# if !defined(S_ISDIR)
210
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
211
# endif
212
# if !defined(S_ISREG)
213
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
214
# endif
215
# include "
magick/magick-type.h
"
216
# if !defined(MAGICKCORE_WINDOWS_SUPPORT)
217
# include <sys/time.h>
218
# if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
219
# include <sys/times.h>
220
# endif
221
# if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
222
# include <sys/resource.h>
223
# endif
224
# if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
225
# include <sys/mman.h>
226
# endif
227
# if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
228
# include <sys/sendfile.h>
229
# endif
230
#endif
231
#else
232
# include <types.h>
233
# include <stat.h>
234
# if defined(macintosh)
235
# if !defined(DISABLE_SIOUX)
236
# include <SIOUX.h>
237
# include <console.h>
238
# endif
239
# include <unix.h>
240
# endif
241
# include "
magick/magick-type.h
"
242
#endif
243
244
#if defined(S_IRUSR) && defined(S_IWUSR)
245
# define S_MODE (S_IRUSR | S_IWUSR)
246
#elif defined (MAGICKCORE_WINDOWS_SUPPORT)
247
# define S_MODE (_S_IREAD | _S_IWRITE)
248
#else
249
# define S_MODE 0600
250
#endif
251
252
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
253
# include "
magick/nt-base.h
"
254
#endif
255
#if defined(macintosh)
256
# include "
magick/mac.h
"
257
#endif
258
#if defined(vms)
259
# include "
magick/vms.h
"
260
#endif
261
262
#undef HAVE_CONFIG_H
263
#undef gamma
264
#undef index
265
#undef pipe
266
#undef y1
267
268
/*
269
Review these platform specific definitions.
270
*/
271
#if ( defined(MAGICKCORE_POSIX_SUPPORT) && !defined(__OS2__) ) && !defined( __VMS )
272
# define DirectorySeparator "/"
273
# define DirectoryListSeparator ':'
274
# define EditorOptions " -title \"Edit Image Comment\" -e vi"
275
# define Exit exit
276
# define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
277
# define X11_PREFERENCES_PATH "~/."
278
# define ProcessPendingEvents(text)
279
# define ReadCommandlLine(argc,argv)
280
# define SetNotifyHandlers
281
#else
282
# if defined(vms)
283
# define X11_APPLICATION_PATH "decw$system_defaults:"
284
# define DirectorySeparator ""
285
# define DirectoryListSeparator ';'
286
# define EditorOptions ""
287
# define Exit exit
288
# define IsBasenameSeparator(c) \
289
(((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
290
# define MAGICKCORE_LIBRARY_PATH "sys$login:"
291
# define MAGICKCORE_SHARE_PATH "sys$login:"
292
# define X11_PREFERENCES_PATH "decw$user_defaults:"
293
# define ProcessPendingEvents(text)
294
# define ReadCommandlLine(argc,argv)
295
# define SetNotifyHandlers
296
# endif
297
# if defined(__OS2__)
298
# define DirectorySeparator "\\"
299
# define DirectoryListSeparator ';'
300
# define EditorOptions " -title \"Edit Image Comment\" -e vi"
301
# define Exit exit
302
# define IsBasenameSeparator(c) \
303
(((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
304
# define PreferencesDefaults "~\."
305
# define ProcessPendingEvents(text)
306
# define ReadCommandlLine(argc,argv)
307
# define SetNotifyHandlers
308
#endif
309
# if defined(macintosh)
310
# define X11_APPLICATION_PATH "/usr/lib/X11/app-defaults/"
311
# define DirectorySeparator ":"
312
# define DirectoryListSeparator ';'
313
# define EditorOptions ""
314
# define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse)
315
# define MAGICKCORE_LIBRARY_PATH ""
316
# define MAGICKCORE_SHARE_PATH ""
317
# define X11_PREFERENCES_PATH "~/."
318
# if defined(DISABLE_SIOUX)
319
# define ReadCommandlLine(argc,argv)
320
# define SetNotifyHandlers \
321
SetFatalErrorHandler(MacFatalErrorHandler); \
322
SetErrorHandler(MACErrorHandler); \
323
SetWarningHandler(MACWarningHandler)
324
# else
325
# define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
326
# define SetNotifyHandlers \
327
SetErrorHandler(MACErrorHandler); \
328
SetWarningHandler(MACWarningHandler)
329
# endif
330
# endif
331
# if defined(MAGICKCORE_WINDOWS_SUPPORT)
332
# define DirectorySeparator "\\"
333
# define DirectoryListSeparator ';'
334
# define EditorOptions ""
335
# define IsBasenameSeparator(c) \
336
(((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
337
# define ProcessPendingEvents(text)
338
# if !defined(X11_PREFERENCES_PATH)
339
# define X11_PREFERENCES_PATH "~\\."
340
# endif
341
# define ReadCommandlLine(argc,argv)
342
# define SetNotifyHandlers \
343
SetErrorHandler(NTErrorHandler); \
344
SetWarningHandler(NTWarningHandler)
345
# if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
346
# define HAVE_TIFFCONF_H
347
# endif
348
# endif
349
350
#endif
351
352
/*
353
Define system symbols if not already defined.
354
*/
355
#if !defined(STDIN_FILENO)
356
#define STDIN_FILENO 0x00
357
#endif
358
359
#if !defined(O_BINARY)
360
#define O_BINARY 0x00
361
#endif
362
363
#if !defined(PATH_MAX)
364
#define PATH_MAX 4096
365
#endif
366
367
#if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB))
368
# define MAGICKCORE_MODULES_SUPPORT
369
#endif
370
371
#if defined(_MAGICKMOD_)
372
# undef MAGICKCORE_BUILD_MODULES
373
# define MAGICKCORE_BUILD_MODULES
374
#endif
375
376
/*
377
Magick defines.
378
*/
379
#define MagickMaxRecursionDepth 600
380
#define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
381
#if defined(_MSC_VER)
382
# define DisableMSCWarning(nr) __pragma(warning(push)) \
383
__pragma(warning(disable:nr))
384
# define RestoreMSCWarning __pragma(warning(pop))
385
#else
386
# define DisableMSCWarning(nr)
387
# define RestoreMSCWarning
388
#endif
389
390
#if defined(__cplusplus) || defined(c_plusplus)
391
}
392
#endif
393
394
#endif
magick-config.h
nt-base.h
vms.h
method-attribute.h
magick-type.h
mac.h
methods.h
magick
studio.h
Generated by
1.8.14