Which object should I use to invoke 'defineValue' method?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
Pit Sullivan
Posts: 11
Joined: 2015-04-13T14:53:20-07:00
Authentication code: 6789

Which object should I use to invoke 'defineValue' method?

Post by Pit Sullivan »

Here is the problem. I have a command:

Code: Select all

convert background.jpg source.jpg mask.jpg -compose blend -define compose:args=50,50 - composite result.jpg
As you can see, there is a 'define' option in this command. I wrote a C++ program which let me do the same thing, but I don't know how to specify the arguments of a blend composition operation. There is a method in Magick++ library which calls 'defineValue' and it seems like it does exactly what I want. The problem is that I don't know which Image object I should use for calling this method. Which variant is correct (1-st, 2-nd or 3-rd or ...)?

Code: Select all

//code C++
Magick::Image background("background.jpg");
Magick::Image source("source.jpg");
Magick::Image mask("mask.jpg");
...
background.defineValue("compose", "args", "50,50");   // 1-st variant
// or
source.defineValue("compose", "args", "50,50");       // 2-nd variant
// or
mask.defineValue("compose", "args", "50,50");         // 3-rd variant
...
And also I'm not sure about the correctness of arguments that I pass to this method.
Post Reply