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