CompositeOperators

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
dummy1620

CompositeOperators

Post by dummy1620 »

I must be an idiot but thanks for any help you can give me.

I'm new to C and it probably shows.

compile options:

Code: Select all

cc `MagickWand-config --cflags --cppflags` test.c `MagickWand-config --ldflags --libs`  -o test
Code:

Code: Select all

#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wand/MagickWand.h>

MagickWand
    *magick_wand;

MagickWand
    *composite_wand;



int main()
{
        FILE *fout;
        FILE *fin;

        MagickWandGenesis();
        magick_wand = NewMagickWand();

        composite_wand = NewMagickWand();

        fin = fopen("image.jpg", "r");
        MagickReadImageFile(magick_wand, fin);
        fclose(fin);

        fin = fopen("image2.jpg", "r");
        MagickReadImageFile(composite_wand, fin);
        fclose(fin);

        MagickCompositeImage(magick_wand, composite_wand, DifferenceCompositeOP, 0, 0);

        fout = fopen("newimage.jpg", "w");
        MagickWriteImageFile(magick_wand, fout);
        MagickWandTerminus();
        return(0);



}

Error:

Code: Select all

test.c: In function 'main':
test.c:49: error: 'DifferenceCompositeOP' undeclared (first use in this function)
test.c:49: error: (Each undeclared identifier is reported only once
test.c:49: error: for each function it appears in.)
what did I miss? Again thanks for your help.
dummy1620

Re: CompositeOperators

Post by dummy1620 »

Nevermind. The documentation is wrong. DifferenceCompositeOP is actually DifferenceCompositeOp.
Post Reply