c++ equivalent to splice gravity?
Posted: 2009-09-28T12:31:20-07:00
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:
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.
Code: Select all
convert oldimage.PNG -gravity West -background white -splice 5x0 -background black -splice 5x0 newImage.PNG
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.