]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 30 Mar 2010 17:58:44 +0000 (17:58 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 30 Mar 2010 17:58:44 +0000 (17:58 +0000)
coders/dpx.c
coders/hald.c
coders/pnm.c
magick/token-private.h

index 15129fc079f2d04b4a3e037c7dbf574b7322c465..1877b3d45247489a8fc9f1b7d5903fa0ecbaeca9 100644 (file)
@@ -539,9 +539,6 @@ static void TimeCodeToString(const unsigned long timestamp,char *code)
 
 static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
 {
-  CacheView
-    *image_view;
-
   char
     magick[4],
     value[MaxTextExtent];
@@ -1079,10 +1076,6 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
   SetQuantumQuantum(quantum_info,32);
   SetQuantumPack(quantum_info,dpx.image.image_element[0].packing == 0 ?
     MagickTrue : MagickFalse);
-  image_view=AcquireCacheView(image);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type)
-#endif
   for (y=0; y < (long) image->rows; y++)
   {
     long
@@ -1106,9 +1099,6 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
     if (status == MagickFalse)
       continue;
     pixels=GetQuantumPixels(quantum_info);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp critical (MagickCore_ReadDPXImage)
-#endif
     {
       count=ReadBlob(image,extent,pixels);
       if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -1125,20 +1115,18 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
     }
     if (count != (ssize_t) extent)
       status=MagickFalse;
-    q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1,
-      exception);
+    q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
     if (q == (PixelPacket *) NULL)
       {
         status=MagickFalse;
         continue;
       }
-    length=ImportQuantumPixels(image,image_view,quantum_info,quantum_type,
-      pixels,exception);
-    sync=SyncCacheViewAuthenticPixels(image_view,exception);
+    length=ImportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
+      quantum_type,pixels,exception);
+    sync=SyncAuthenticPixels(image,exception);
     if (sync == MagickFalse)
       status=MagickFalse;
   }
-  image_view=DestroyCacheView(image_view);
   quantum_info=DestroyQuantumInfo(quantum_info);
   if (status == MagickFalse)
     ThrowReaderException(CorruptImageError,"UnableToReadImageData");
index a800d2d7e98f7d67d091c9dc01d49331a08073a3..47bc79a3449ac7797dc8413161bb8e07e5c4a62e 100644 (file)
@@ -102,9 +102,6 @@ static Image *ReadHALDImage(const ImageInfo *image_info,
     cube_size,
     level;
 
-  CacheView
-    *image_view;
-
   /*
     Create HALD color lookup table image.
   */
@@ -125,10 +122,6 @@ static Image *ReadHALDImage(const ImageInfo *image_info,
   cube_size=level*level;
   image->columns=(unsigned long) (level*cube_size);
   image->rows=(unsigned long) (level*cube_size);
-  image_view=AcquireCacheView(image);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp parallel for shared(status)
-#endif
   for (y=0; y < (long) image->rows; y+=(long) level)
   {
     long
@@ -141,8 +134,8 @@ static Image *ReadHALDImage(const ImageInfo *image_info,
 
     if (status == MagickFalse)
       continue;
-    q=QueueCacheViewAuthenticPixels(image_view,0,y,image->columns,
-      (unsigned long) level,exception);
+    q=QueueAuthenticPixels(image,0,y,image->columns,(unsigned long) level,
+      exception);
     if (q == (PixelPacket *) NULL)
       {
         status=MagickFalse;
@@ -160,10 +153,9 @@ static Image *ReadHALDImage(const ImageInfo *image_info,
         q++;
       }
     }
-    if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+    if (SyncAuthenticPixels(image,exception) == MagickFalse)
       status=MagickFalse;
   }
-  image_view=DestroyCacheView(image_view);
   return(GetFirstImageInList(image));
 }
 \f
index fb048c6222185bdaceee41891ccf0193f5371400..f3120eb61425bf19a6b5285855c4a904351f4fdb 100644 (file)
@@ -265,9 +265,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
     depth,
     max_value;
 
-  CacheView
-    *image_view;
-
   /*
     Open image file.
   */
@@ -593,10 +590,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
         SetQuantumMinIsWhite(quantum_info,MagickTrue);
         extent=GetQuantumExtent(image,quantum_info,quantum_type);
-        image_view=AcquireCacheView(image);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type)
-#endif
         for (y=0; y < (long) image->rows; y++)
         {
           long
@@ -620,9 +613,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if (status == MagickFalse)
             continue;
           pixels=GetQuantumPixels(quantum_info);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp critical (MagickCore_ReadPNMImage)
-#endif
           {
             count=ReadBlob(image,extent,pixels);
             if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -639,22 +629,20 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           }
           if (count != (ssize_t) extent)
             status=MagickFalse;
-          q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1,
-            exception);
+          q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
           if (q == (PixelPacket *) NULL)
             {
               status=MagickFalse;
               continue;
             }
-          length=ImportQuantumPixels(image,image_view,quantum_info,quantum_type,
-            pixels,exception);
+          length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
+            quantum_type,pixels,exception);
           if (length != extent)
             status=MagickFalse;
-          sync=SyncCacheViewAuthenticPixels(image_view,exception);
+          sync=SyncAuthenticPixels(image,exception);
           if (sync == MagickFalse)
             status=MagickFalse;
         }
-        image_view=DestroyCacheView(image_view);
         quantum_info=DestroyQuantumInfo(quantum_info);
         if (status == MagickFalse)
           ThrowReaderException(CorruptImageError,"UnableToReadImageData");
@@ -675,10 +663,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
         quantum_info=AcquireQuantumInfo(image_info,image);
         if (quantum_info == (QuantumInfo *) NULL)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
-        image_view=AcquireCacheView(image);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type)
-#endif
         for (y=0; y < (long) image->rows; y++)
         {
           long
@@ -705,9 +689,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if (status == MagickFalse)
             continue;
           pixels=GetQuantumPixels(quantum_info);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp critical (MagickCore_ReadPNMImage)
-#endif
           {
             count=ReadBlob(image,extent,pixels);
             if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -724,8 +705,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           }
           if (count != (ssize_t) extent)
             status=MagickFalse;
-          q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1,
-            exception);
+          q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
           if (q == (PixelPacket *) NULL)
             {
               status=MagickFalse;
@@ -733,7 +713,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
             }
           p=pixels;
           if ((image->depth == 8) || (image->depth == 16))
-            (void) ImportQuantumPixels(image,image_view,quantum_info,
+            (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
               quantum_type,pixels,exception);
           else
             if (image->depth <= 8)
@@ -764,11 +744,10 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                   q++;
                 }
               }
-          sync=SyncCacheViewAuthenticPixels(image_view,exception);
+          sync=SyncAuthenticPixels(image,exception);
           if (sync == MagickFalse)
             status=MagickFalse;
         }
-        image_view=DestroyCacheView(image_view);
         quantum_info=DestroyQuantumInfo(quantum_info);
         if (status == MagickFalse)
           ThrowReaderException(CorruptImageError,"UnableToReadImageData");
@@ -793,10 +772,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
         quantum_info=AcquireQuantumInfo(image_info,image);
         if (quantum_info == (QuantumInfo *) NULL)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
-        image_view=AcquireCacheView(image);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp parallel for schedule(static,1) shared(row,status,type)
-#endif
         for (y=0; y < (long) image->rows; y++)
         {
           long
@@ -823,9 +798,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if (status == MagickFalse)
             continue;
           pixels=GetQuantumPixels(quantum_info);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp critical (MagickCore_ReadPNMImage)
-#endif
           {
             count=ReadBlob(image,extent,pixels);
             if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -842,8 +814,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           }
           if (count != (ssize_t) extent)
             status=MagickFalse;
-          q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1,
-            exception);
+          q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
           if (q == (PixelPacket *) NULL)
             {
               status=MagickFalse;
@@ -914,8 +885,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                 }
           if ((type == BilevelType) || (type == GrayscaleType))
             {
-              q=QueueCacheViewAuthenticPixels(image_view,0,offset,
-                image->columns,1,exception);
+              q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
               for (x=0; x < (long) image->columns; x++)
               {
                 if ((type == BilevelType) &&
@@ -929,11 +899,10 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                 q++;
               }
             }
-          sync=SyncCacheViewAuthenticPixels(image_view,exception);
+          sync=SyncAuthenticPixels(image,exception);
           if (sync == MagickFalse)
             status=MagickFalse;
         }
-        image_view=DestroyCacheView(image_view);
         quantum_info=DestroyQuantumInfo(quantum_info);
         if (status == MagickFalse)
           ThrowReaderException(CorruptImageError,"UnableToReadImageData");
@@ -982,10 +951,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
         quantum_info=AcquireQuantumInfo(image_info,image);
         if (quantum_info == (QuantumInfo *) NULL)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
-        image_view=AcquireCacheView(image);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type)
-#endif
         for (y=0; y < (long) image->rows; y++)
         {
           long
@@ -1012,9 +977,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if (status == MagickFalse)
             continue;
           pixels=GetQuantumPixels(quantum_info);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp critical (MagickCore_ReadPNMImage)
-#endif
           {
             count=ReadBlob(image,extent,pixels);
             if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -1031,17 +993,16 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           }
           if (count != (ssize_t) extent)
             status=MagickFalse;
-          q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1,
-            exception);
+          q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
           if (q == (PixelPacket *) NULL)
             {
               status=MagickFalse;
               continue;
             }
-          indexes=GetCacheViewAuthenticIndexQueue(image_view);
+          indexes=GetAuthenticIndexQueue(image);
           p=pixels;
           if ((image->depth == 8) || (image->depth == 16))
-            (void) ImportQuantumPixels(image,image_view,quantum_info,
+            (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
               quantum_type,pixels,exception);
           else
             switch (quantum_type)
@@ -1193,11 +1154,10 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                 break;
               }
             }
-          sync=SyncCacheViewAuthenticPixels(image_view,exception);
+          sync=SyncAuthenticPixels(image,exception);
           if (sync == MagickFalse)
             status=MagickFalse;
         }
-        image_view=DestroyCacheView(image_view);
         quantum_info=DestroyQuantumInfo(quantum_info);
         if (status == MagickFalse)
           ThrowReaderException(CorruptImageError,"UnableToReadImageData");
@@ -1225,10 +1185,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
         SetQuantumScale(quantum_info,(MagickRealType) QuantumRange*
           fabs(quantum_scale));
         extent=GetQuantumExtent(image,quantum_info,quantum_type);
-        image_view=AcquireCacheView(image);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type)
-#endif
         for (y=0; y < (long) image->rows; y++)
         {
           long
@@ -1252,9 +1208,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if (status == MagickFalse)
             continue;
           pixels=GetQuantumPixels(quantum_info);
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001)
-  #pragma omp critical (MagickCore_ReadPNMImage)
-#endif
           {
             count=ReadBlob(image,extent,pixels);
             if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -1271,22 +1224,21 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           }
           if ((size_t) count != extent)
             status=MagickFalse;
-          q=QueueCacheViewAuthenticPixels(image_view,0,(long) (image->rows-
-            offset-1),image->columns,1,exception);
+          q=QueueAuthenticPixels(image,0,(long) (image->rows-offset-1),
+            image->columns,1,exception);
           if (q == (PixelPacket *) NULL)
             {
               status=MagickFalse;
               continue;
             }
-          length=ImportQuantumPixels(image,image_view,quantum_info,quantum_type,
-            pixels,exception);
+          length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
+            quantum_type,pixels,exception);
           if (length != extent)
             status=MagickFalse;
-          sync=SyncCacheViewAuthenticPixels(image_view,exception);
+          sync=SyncAuthenticPixels(image,exception);
           if (sync == MagickFalse)
             status=MagickFalse;
         }
-        image_view=DestroyCacheView(image_view);
         quantum_info=DestroyQuantumInfo(quantum_info);
         if (status == MagickFalse)
           ThrowReaderException(CorruptImageError,"UnableToReadImageData");
index a2d6be7e1ddb84b293519e7bca51642519024c3f..54cd8e41317484ccb164b6d3b7001f167fd53edd 100644 (file)
@@ -134,7 +134,7 @@ static inline long GetNextUTFCode(const char *text,size_t *octets)
   return(-1);
 }
 
-static long GetUTFCode(const char *text)
+static inline long GetUTFCode(const char *text)
 {
   size_t
     octets;
@@ -142,7 +142,7 @@ static long GetUTFCode(const char *text)
   return(GetNextUTFCode(text,&octets));
 }
 
-static size_t GetUTFOctets(const char *text)
+static inline size_t GetUTFOctets(const char *text)
 {
   size_t
     octets;