]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/image-view.c
(no commit message)
[imagemagick] / MagickCore / image-view.c
index b0e0699520daf46dbe480ff14a6c051f9ac90093..fa502d9d70dc4417c42cf12af3ecb909a5e6260c 100644 (file)
@@ -1,4 +1,4 @@
-      /*
+/*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
 %                                                                             %
 %                       MagickCore Image View Methods                         %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                                March 2003                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -221,9 +221,10 @@ MagickExport MagickBooleanType DuplexTransferImageViewIterator(
   MagickOffsetType
     progress;
 
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   size_t
-    height,
-    width;
+    height;
+#endif
 
   ssize_t
     y;
@@ -240,12 +241,10 @@ MagickExport MagickBooleanType DuplexTransferImageViewIterator(
     return(MagickFalse);
   status=MagickTrue;
   progress=0;
-  height=source->extent.height-source->extent.y;
-  width=source->extent.width-source->extent.x;
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(static) shared(progress,status) \
-    if ((height*width) > 8192) \
-      num_threads(GetMagickResourceLimit(ThreadResource))
+  height=source->extent.height-source->extent.y;
+  #pragma omp parallel for schedule(static,4) shared(progress,status) \
+    magick_threads(source_image,destination_image,height,1)
 #endif
   for (y=source->extent.y; y < (ssize_t) source->extent.height; y++)
   {
@@ -539,9 +538,10 @@ MagickExport MagickBooleanType GetImageViewIterator(ImageView *source,
   MagickOffsetType
     progress;
 
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   size_t
-    height,
-    width;
+    height;
+#endif
 
   ssize_t
     y;
@@ -553,12 +553,10 @@ MagickExport MagickBooleanType GetImageViewIterator(ImageView *source,
   source_image=source->image;
   status=MagickTrue;
   progress=0;
-  height=source->extent.height-source->extent.y;
-  width=source->extent.width-source->extent.x;
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(static) shared(progress,status) \
-    if ((width*height) > 8192) \
-      num_threads(GetMagickResourceLimit(ThreadResource))
+  height=source->extent.height-source->extent.y;
+  #pragma omp parallel for schedule(static,4) shared(progress,status) \
+    magick_threads(source_image,source_image,height,1)
 #endif
   for (y=source->extent.y; y < (ssize_t) source->extent.height; y++)
   {
@@ -884,9 +882,10 @@ MagickExport MagickBooleanType SetImageViewIterator(ImageView *destination,
   MagickOffsetType
     progress;
 
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   size_t
-    height,
-    width;
+    height;
+#endif
 
   ssize_t
     y;
@@ -902,12 +901,10 @@ MagickExport MagickBooleanType SetImageViewIterator(ImageView *destination,
     return(MagickFalse);
   status=MagickTrue;
   progress=0;
-  height=destination->extent.height-destination->extent.y;
-  width=destination->extent.width-destination->extent.x;
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(static) shared(progress,status) \
-    if ((height*width) > 8192) \
-      num_threads(GetMagickResourceLimit(ThreadResource))
+  height=destination->extent.height-destination->extent.y;
+  #pragma omp parallel for schedule(static,4) shared(progress,status) \
+    magick_threads(destination_image,destination_image,height,1)
 #endif
   for (y=destination->extent.y; y < (ssize_t) destination->extent.height; y++)
   {
@@ -1012,9 +1009,10 @@ MagickExport MagickBooleanType TransferImageViewIterator(ImageView *source,
   MagickOffsetType
     progress;
 
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   size_t
-    height,
-    width;
+    height;
+#endif
 
   ssize_t
     y;
@@ -1031,12 +1029,10 @@ MagickExport MagickBooleanType TransferImageViewIterator(ImageView *source,
     return(MagickFalse);
   status=MagickTrue;
   progress=0;
-  height=source->extent.height-source->extent.y;
-  width=source->extent.width-source->extent.x;
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(static) shared(progress,status) \
-    if ((height*width) > 8192) \
-      num_threads(GetMagickResourceLimit(ThreadResource))
+  height=source->extent.height-source->extent.y;
+  #pragma omp parallel for schedule(static,4) shared(progress,status) \
+    magick_threads(source_image,destination_image,height,1)
 #endif
   for (y=source->extent.y; y < (ssize_t) source->extent.height; y++)
   {
@@ -1146,9 +1142,10 @@ MagickExport MagickBooleanType UpdateImageViewIterator(ImageView *source,
   MagickOffsetType
     progress;
 
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   size_t
-    height,
-    width;
+    height;
+#endif
 
   ssize_t
     y;
@@ -1163,12 +1160,10 @@ MagickExport MagickBooleanType UpdateImageViewIterator(ImageView *source,
     return(MagickFalse);
   status=MagickTrue;
   progress=0;
-  height=source->extent.height-source->extent.y;
-  width=source->extent.width-source->extent.x;
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(static) shared(progress,status) \
-    if ((height*width) > 8192) \
-      num_threads(GetMagickResourceLimit(ThreadResource))
+  height=source->extent.height-source->extent.y;
+  #pragma omp parallel for schedule(static,4) shared(progress,status) \
+    magick_threads(source_image,source_image,height,1)
 #endif
   for (y=source->extent.y; y < (ssize_t) source->extent.height; y++)
   {