I'm trying to use the Magick++ API (part of ImageMagick) for c++ and I've been looking around a while now and haven't seen that much documentation or examples on google. There's a lot of good documentation about it, but I can't find anything on how to use the ping()
(not networking ping) function to return the size information of an image inside a c++ program. I've tried to make a blob
object and use it like I've seen in the error.
I've seen a lot of the same general manual like:
http://web.mit.edu/graphics/share/ImageMagick/www/Magick++/Image.html#Image%20Attributes
which is the same as http://www.imagemagick.org/Magick++/Image.html
I was looking at ping
under "Image Manipulation Methods" and saw that it took a const Blob &blob_
as input. I tried doing the following, though I'm not really sure what I'm doing with ping()
. I've got a lot of other stuff working, just can't figure this out.
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
InitializeMagick(*argv);
Image master("horse.jpg");
Image second = master;
// tried creating a blob (Binary Large OBject) per the error
Blob blob;
master.write ( &blob);
cout << blob.ping(&blob) << endl;
// also tried
// cout << master.ping() << endl;
// cout << master.ping( &blob) << endl;
return 0
}
I can't even find much in the way of examples for Magick++ stuff or ping.
test3.cpp:15:26: note: candidates are:
In file included from /usr/include/ImageMagick/Magick++.h:10:0,
from test3.cpp:1:
/usr/include/ImageMagick/Magick++/Image.h:501:21: note: void Magick::Image::ping(const string&)
void ping ( const std::string &imageSpec_ );
^
/usr/include/ImageMagick/Magick++/Image.h:501:21: note: candidate expects 1 argument, 0 provided
/usr/include/ImageMagick/Magick++/Image.h:507:21: note: void Magick::Image::ping(const Magick::Blob&)
void ping ( const Blob &blob_ );
^
/usr/include/ImageMagick/Magick++/Image.h:507:21: note: candidate expects 1 argument, 0 provided
So I guess ping returns void
which it didn't say in the manual. I'm not even sure how I'd get values from it. Should I just take a look at the source code? Does anyone know where I could find more reading on this? Or is anyone familiar with Magick++. I'm sorry for being so clueless but google just isn't turning up much in the way of results for me about this.
Any help would be much appreciated!