2 Make direct calls to process the various CLI option handling groups
3 as defined in "MagickWand/operators.c" which uses a special
4 MagickCLI type of 'wand'.
6 This is essentually the calls 'ProcessCommandOptions()' make
7 though without as many error and sanity checks.
9 Compile with ImageMagick-devlop installed...
11 gcc -lMagickWand -lMagickCore cli_operators.c -o cli_operators
13 Compile and run directly in Source Directory...
15 IM_PROG=api_examples/cli_operators
16 gcc -I`pwd` -LMagickWand/.libs -LMagickCore/.libs \
17 -lMagickWand -lMagickCore $IM_PROG.c -o $IM_PROG
24 #include "MagickCore/studio.h"
25 #include "MagickWand/MagickWand.h"
26 #include "MagickWand/operation.h"
28 int main(int argc, char **argv)
33 MagickCoreGenesis(argv[0],MagickFalse);
35 cli_wand = AcquireMagickCLI((ImageInfo *) NULL,(ExceptionInfo *) NULL);
37 CLISettingOptionInfo (cli_wand, "-size", "100x100");
38 CLISpecialOperator (cli_wand, "-read", "xc:red");
39 CLISpecialOperator (cli_wand, "(", NULL);
40 CLISpecialOperator (cli_wand, "-read", "rose:");
41 CLISimpleOperatorImages (cli_wand, "-rotate", "-90", NULL);
42 CLISpecialOperator (cli_wand, ")", NULL);
43 CLIListOperatorImages (cli_wand, "+append", NULL, NULL);
44 CLIListOperatorImages (cli_wand, "-write", "show:", NULL);
46 /* Note use of 'True' to report all exceptions - including fatals */
47 if ( CLICatchException(cli_wand,MagickTrue) != MagickFalse )
48 fprintf(stderr, "Major Error Detected\n");
50 cli_wand = DestroyMagickCLI(cli_wand);