2014-06-05 Carl Hetherington <cth@carlh.net>
+ * Large speed-up to multi-image source file decoding.
+
* Back-port changes from v2 which work out how separate
audio files should be resampled by looking at the video
files which are present at the same time.
_image.reset (new Image (PIX_FMT_RGB24, size, true));
using namespace MagickCore;
-
- uint8_t* p = _image->data()[0];
- for (int y = 0; y < size.height; ++y) {
- uint8_t* q = p;
- for (int x = 0; x < size.width; ++x) {
- Magick::Color c = magick_image->pixelColor (x, y);
- *q++ = c.redQuantum() * 255 / QuantumRange;
- *q++ = c.greenQuantum() * 255 / QuantumRange;
- *q++ = c.blueQuantum() * 255 / QuantumRange;
- }
- p += _image->stride()[0];
- }
+
+ magick_image->write (0, 0, size.width, size.height, "RGB", CharPixel, _image->data()[0]);
delete magick_image;