I have the following code and want to improve its performance:
Code: Select all
// Reset the wand
ClearMagickWand(_wand);
// Read the data
MagickConstituteImage(_wand, width, height, format, MagickCore::StorageType::CharPixel, rawData);
// Convert to target format
MagickSetImageFormat(_wand, targetFormat);
// Store in output
(*outData) = MagickGetImageBlob(_wand, &outSize);
However, I'd like to improve the performance as much as possible, since MANY of these conversions are taking place (the images become a video in the end - and yes, I HAVE to convert them to something before the video step to save memory).
Since I have (almost) full control over the app, any suggestion would be welcome.
I'd guess that the fact that all the parameters (except the rawData pointer) never change could help somehow, but I am very new to ImageMagick, so maybe someone has an idea.
Multithreading is a possibility, of course, but I may be limited to two threads at once here.