]> granicus.if.org Git - imagemagick/blob - MagickWand/operation-private.h
(no commit message)
[imagemagick] / MagickWand / operation-private.h
1 /*
2   Copyright 1999-2012 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   ImageMagick pixel wand API.
17 */
18 #ifndef _OPERATION_PRIVATE_H
19 #define _OPERATION_PRIVATE_H
20
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 #define CLIWandException(severity,tag,option) \
26   (void) ThrowMagickException(cli_wand->wand.exception,GetMagickModule(), \
27        severity,tag, cli_wand->location, option, cli_wand->filename, \
28        cli_wand->line, cli_wand->column);
29
30 #define CLIWandExceptionBreak(severity,tag,option) \
31 { \
32   CLIWandException(severity,tag,option); \
33   break; \
34 }
35
36 #define CLIWandExceptionReturn(severity,tag,option) \
37 { \
38   CLIWandException(severity,tag,option); \
39   return; \
40 }
41
42 /* Define a generic stack linked list, for pushing and popping
43    user defined ImageInfo settings, and Image lists.
44    See '(' ')' and '-clone' CLI options.
45 */
46 typedef struct _Stack
47 {
48   struct _Stack  *next;
49   void           *data;
50 } Stack;
51
52 /* Note this defines an extension to the normal MagickWand
53    Which adds extra elements specific to the Shell API interface
54    while still allowing the Wand to be passed to MagickWand API
55    for specific operations.
56 */
57 struct _MagickCLI       /* CLI interface version of MagickWand */
58 {
59   struct _MagickWand    /* this must be the first structure */
60      wand;
61
62   QuantizeInfo
63     *quantize_info;     /* for CLI API usage, not used by MagickWand API */
64
65   DrawInfo
66     *draw_info;         /* for CLI API usage, not used by MagickWand API */
67
68   Stack
69     *image_list_stack,  /* Stacks of Image Lists and Image Info settings */
70     *image_info_stack;
71
72   const char
73     *location,          /* Location string for exception reporting */
74     *filename;          /*  EG: "'%s' @ \"%s\" line %u column %u"
75                                     option, filename, line, column */
76   size_t
77     line,               /* location of current option for error above */
78     column;
79
80   size_t
81     signature;
82 };
83
84
85 #if defined(__cplusplus) || defined(c_plusplus)
86 }
87 #endif
88
89 #endif