return(contribution);
}
-static MagickBooleanType HorizontalFilter(const ResizeFilter *resize_filter,
- const Image *image,Image *resize_image,const double x_factor,
- const MagickSizeType span,MagickOffsetType *offset,ExceptionInfo *exception)
+static MagickBooleanType HorizontalFilter(
+ const ResizeFilter *magick_restrict resize_filter,
+ const Image *magick_restrict image,Image *magick_restrict resize_image,
+ const double x_factor,const MagickSizeType span,
+ MagickOffsetType *magick_restrict progress,ExceptionInfo *exception)
{
#define ResizeImageTag "Resize/Image"
image_view=AcquireVirtualCacheView(image,exception);
resize_view=AcquireAuthenticCacheView(resize_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static) shared(status) \
+ #pragma omp parallel for schedule(static) shared(progress,status) \
magick_number_threads(image,resize_image,resize_image->columns,1)
#endif
for (x=0; x < (ssize_t) resize_image->columns; x++)
MagickBooleanType
proceed;
- proceed=SetImageProgress(image,ResizeImageTag,(*offset)++,span);
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
+ #pragma omp atomic
+#endif
+ (*progress)++;
+ proceed=SetImageProgress(image,ResizeImageTag,*progress,span);
if (proceed == MagickFalse)
status=MagickFalse;
}
return(status);
}
-static MagickBooleanType VerticalFilter(const ResizeFilter *resize_filter,
- const Image *image,Image *resize_image,const double y_factor,
- const MagickSizeType span,MagickOffsetType *offset,ExceptionInfo *exception)
+static MagickBooleanType VerticalFilter(
+ const ResizeFilter *magick_restrict resize_filter,
+ const Image *magick_restrict image,Image *magick_restrict resize_image,
+ const double y_factor,const MagickSizeType span,
+ MagickOffsetType *magick_restrict progress,ExceptionInfo *exception)
{
CacheView
*image_view,
image_view=AcquireVirtualCacheView(image,exception);
resize_view=AcquireAuthenticCacheView(resize_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static) shared(status) \
+ #pragma omp parallel for schedule(static) shared(progress,status) \
magick_number_threads(image,resize_image,resize_image->rows,1)
#endif
for (y=0; y < (ssize_t) resize_image->rows; y++)
MagickBooleanType
proceed;
- proceed=SetImageProgress(image,ResizeImageTag,(*offset)++,span);
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
+ #pragma omp atomic
+#endif
+ (*progress)++;
+ proceed=SetImageProgress(image,ResizeImageTag,*progress,span);
if (proceed == MagickFalse)
status=MagickFalse;
}