c++ equivalent to splice gravity?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ocitalis
Posts: 3
Joined: 2009-09-17T14:13:07-07:00
Authentication code: 8675309

c++ equivalent to splice gravity?

Post by ocitalis »

I am trying to trim single edges one by one (for counting the number of pixels removed from each side), using Magick++. I can make this work using the command line:

Code: Select all

convert oldimage.PNG -gravity West -background white -splice 5x0 -background black -splice 5x0 newImage.PNG
Like described here http://www.imagemagick.org/Usage/crop/#trim_oneside
Now I am having to use system(strCommandLineCommand); then read the image from the disk, then trim() and chop(), from inside my application, and this is obviously sub-optimal. How can I simulate the splicing gravity from within my program without having to use the command line? splice() only seems to allow splicing onto the north or the east.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: c++ equivalent to splice gravity?

Post by magick »

We added a splice() method to Magick++ in ImageMagick 6.5.6-6 Beta available sometime tomorrow. In the mean-time you can use any MagickCore API method (e.g. MagickCore::SpliceImage()).
Post Reply