summaryrefslogtreecommitdiff
path: root/dmagick/ImageView.d
diff options
context:
space:
mode:
Diffstat (limited to 'dmagick/ImageView.d')
-rw-r--r--dmagick/ImageView.d6
1 files changed, 4 insertions, 2 deletions
diff --git a/dmagick/ImageView.d b/dmagick/ImageView.d
index d464588..21e4e46 100644
--- a/dmagick/ImageView.d
+++ b/dmagick/ImageView.d
@@ -157,13 +157,15 @@ class ImageView
* Support the usage of foreach to loop over the rows in the view.
* The foreach is executed in parallel.
*/
- int opApply(int delegate(Pixels) dg)
+ int opApply(int delegate(ref Pixels) dg)
{
shared(int) progress;
foreach ( row; taskPool.parallel(iota(extent.y, extent.y + extent.height)) )
{
- int result = dg(Pixels(image, extent.x, row, extent.width, 1));
+ Pixels pixels = Pixels(image, extent.x, row, extent.width, 1);
+
+ int result = dg(pixels);
if ( result )
return result;