Monitoring progress with Magick++

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
imcz

Monitoring progress with Magick++

Post by imcz »

Hi,

I am using the Magick++ interface and I'd like to get notified about the internal progresses while opening/saving/processing images.
While searching the web, I found this entry: http://studio.imagemagick.org/pipermail ... 02097.html

which says there is no real monitor interface in Magick++, but the Core methods can be used with Magick++ classes as well (just one monitor per time limit, which would be ok).

I tried first registering the monitor in general as described in the above article:

Code: Select all

MagickCore::SetMonitorHandler(monitor);
where monitor looks like:

Code: Select all

MagickCore::MagickBooleanType monitor(const char* szTask, const MagickCore::MagickOffsetType position, const MagickCore::MagickSizeType span, MagickCore::ExceptionInfo* clientData);
after that, I tried to register per image, with an Magick++ object of type Image called img, the call looks like:

Code: Select all

MagickCore::SetImageProgressMonitor(img.image(),monitor2,NULL); 
with the monitor function being slightly different:

Code: Select all

MagickCore::MagickBooleanType monitor2(const char* szTask, const MagickCore::MagickOffsetType position, const MagickCore::MagickSizeType span, void* clientData);
None of those functions are ever called during image processing/loading.
What is the proper way to get some feedback when using the Magick++ interface?

Thanks in advance
imcz

Re: Monitoring progress with Magick++

Post by imcz »

I found now something out:

monitor2 is getting actually called during processing.
It is just important that the image reference can change due to previous operations.

One problem remains though:
Is there a way to get the current progress while loading/reading a new image file?

The monitor2 does not work as the image reference gets created during the call, so there is no way to pass that to the monitor function.
Post Reply