cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
cristy | b56bb24 | 2014-11-25 17:12:48 +0000 | [diff] [blame] | 2 | Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | 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) |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 25 | #define MagickWandId "MagickWand" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 26 | #define QuantumTick(i,span) ((MagickBooleanType) ((((i) & ((i)-1)) == 0) || \ |
| 27 | (((i) & 0xfff) == 0) || \ |
| 28 | ((MagickOffsetType) (i) == ((MagickOffsetType) (span)-1)))) |
cristy | 7694fb0 | 2014-01-14 21:51:01 +0000 | [diff] [blame] | 29 | #define ThrowWandException(severity,tag,context) \ |
| 30 | { \ |
| 31 | (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \ |
| 32 | tag,"`%s'",context); \ |
| 33 | return(MagickFalse); \ |
| 34 | } |
cristy | 369879c | 2014-01-14 20:41:16 +0000 | [diff] [blame] | 35 | #define ThrowWandFatalException(severity,tag,context) \ |
| 36 | { \ |
| 37 | ExceptionInfo \ |
dirk | e31feb8 | 2014-06-20 11:03:07 +0000 | [diff] [blame] | 38 | *exception; \ |
cristy | 369879c | 2014-01-14 20:41:16 +0000 | [diff] [blame] | 39 | \ |
dirk | e31feb8 | 2014-06-20 11:03:07 +0000 | [diff] [blame] | 40 | exception=AcquireExceptionInfo(); \ |
| 41 | (void) ThrowMagickException(exception,GetMagickModule(),severity,tag, \ |
cristy | 369879c | 2014-01-14 20:41:16 +0000 | [diff] [blame] | 42 | "`%s'",context); \ |
dirk | e31feb8 | 2014-06-20 11:03:07 +0000 | [diff] [blame] | 43 | CatchException(exception); \ |
| 44 | (void) DestroyExceptionInfo(exception); \ |
cristy | 369879c | 2014-01-14 20:41:16 +0000 | [diff] [blame] | 45 | MagickWandTerminus(); \ |
| 46 | _exit((int) (severity-FatalErrorException)+1); \ |
| 47 | } |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 48 | |
| 49 | struct _MagickWand |
| 50 | { |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 51 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 52 | id; |
| 53 | |
| 54 | char |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 55 | name[MagickPathExtent]; /* Wand name to use for MagickWand Logs */ |
anthony | a89dd17 | 2011-10-04 13:29:35 +0000 | [diff] [blame] | 56 | |
| 57 | Image |
anthony | 31f1bf7 | 2012-01-30 12:37:22 +0000 | [diff] [blame] | 58 | *images; /* The images in this wand - also the current image */ |
anthony | a89dd17 | 2011-10-04 13:29:35 +0000 | [diff] [blame] | 59 | |
| 60 | ImageInfo |
| 61 | *image_info; /* Global settings used for images in Wand */ |
| 62 | |
anthony | 43f425d | 2012-02-26 12:58:58 +0000 | [diff] [blame] | 63 | ExceptionInfo |
| 64 | *exception; |
anthony | a89dd17 | 2011-10-04 13:29:35 +0000 | [diff] [blame] | 65 | |
| 66 | MagickBooleanType |
anthony | 4508331 | 2012-03-14 14:49:12 +0000 | [diff] [blame] | 67 | insert_before, /* wand set to first image, prepend new images */ |
| 68 | image_pending, /* this image is pending Next/Previous Iteration */ |
anthony | a89dd17 | 2011-10-04 13:29:35 +0000 | [diff] [blame] | 69 | debug; /* Log calls to MagickWand library */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 70 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 71 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 72 | signature; |
| 73 | }; |
| 74 | |
| 75 | #if defined(__cplusplus) || defined(c_plusplus) |
| 76 | } |
| 77 | #endif |
| 78 | |
| 79 | #endif |