blob: d4ca7d313672405e755c9e336d290b574e48b29d [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
Cristy7ce65e72015-12-12 18:03:16 -05002 Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00003 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 ImageMagick pixel wand API.
17*/
18#ifndef _MAGICKWAND_MAGICK_WAND_PRIVATE_H
19#define _MAGICKWAND_MAGICK_WAND_PRIVATE_H
20
21#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
cristy3ed852e2009-09-05 21:47:34 +000025#define MagickWandId "MagickWand"
cristy3ed852e2009-09-05 21:47:34 +000026#define QuantumTick(i,span) ((MagickBooleanType) ((((i) & ((i)-1)) == 0) || \
27 (((i) & 0xfff) == 0) || \
28 ((MagickOffsetType) (i) == ((MagickOffsetType) (span)-1))))
cristy7694fb02014-01-14 21:51:01 +000029#define ThrowWandException(severity,tag,context) \
30{ \
31 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
32 tag,"`%s'",context); \
33 return(MagickFalse); \
34}
cristy369879c2014-01-14 20:41:16 +000035#define ThrowWandFatalException(severity,tag,context) \
36{ \
37 ExceptionInfo \
dirkfa589d62015-09-20 16:59:31 +020038 *fatal_exception; \
cristy369879c2014-01-14 20:41:16 +000039 \
dirkfa589d62015-09-20 16:59:31 +020040 fatal_exception=AcquireExceptionInfo(); \
41 (void) ThrowMagickException(fatal_exception,GetMagickModule(),severity,tag, \
cristy369879c2014-01-14 20:41:16 +000042 "`%s'",context); \
dirkfa589d62015-09-20 16:59:31 +020043 CatchException(fatal_exception); \
44 (void) DestroyExceptionInfo(fatal_exception); \
cristy369879c2014-01-14 20:41:16 +000045 MagickWandTerminus(); \
46 _exit((int) (severity-FatalErrorException)+1); \
47}
cristy3ed852e2009-09-05 21:47:34 +000048
49struct _MagickWand
50{
cristybb503372010-05-27 20:51:26 +000051 size_t
cristy3ed852e2009-09-05 21:47:34 +000052 id;
53
54 char
cristy151b66d2015-04-15 10:50:31 +000055 name[MagickPathExtent]; /* Wand name to use for MagickWand Logs */
anthonya89dd172011-10-04 13:29:35 +000056
57 Image
anthony31f1bf72012-01-30 12:37:22 +000058 *images; /* The images in this wand - also the current image */
anthonya89dd172011-10-04 13:29:35 +000059
60 ImageInfo
61 *image_info; /* Global settings used for images in Wand */
62
anthony43f425d2012-02-26 12:58:58 +000063 ExceptionInfo
64 *exception;
anthonya89dd172011-10-04 13:29:35 +000065
66 MagickBooleanType
anthony45083312012-03-14 14:49:12 +000067 insert_before, /* wand set to first image, prepend new images */
68 image_pending, /* this image is pending Next/Previous Iteration */
anthonya89dd172011-10-04 13:29:35 +000069 debug; /* Log calls to MagickWand library */
cristy3ed852e2009-09-05 21:47:34 +000070
cristybb503372010-05-27 20:51:26 +000071 size_t
cristy3ed852e2009-09-05 21:47:34 +000072 signature;
73};
74
75#if defined(__cplusplus) || defined(c_plusplus)
76}
77#endif
78
79#endif