]> granicus.if.org Git - imagemagick/blobdiff - MagickWand/pixel-iterator.c
(no commit message)
[imagemagick] / MagickWand / pixel-iterator.c
index 096c94e2643677f9a3d75805b4dcfafc91cbe5f7..06a9899dbcdbb5f2dbd2b93ec749b8c20586c327 100644 (file)
@@ -23,7 +23,7 @@
 %                                March 2003                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2013 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  %
@@ -72,9 +72,6 @@ struct _PixelIterator
   ExceptionInfo
     *exception;
 
-  Image
-    *image;
-
   CacheView
     *view;
 
@@ -165,8 +162,7 @@ WandExport PixelIterator *ClonePixelIterator(const PixelIterator *iterator)
   assert(iterator->signature == WandSignature);
   if (iterator->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name);
-  clone_iterator=(PixelIterator *) AcquireMagickMemory(
-    sizeof(*clone_iterator));
+  clone_iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*clone_iterator));
   if (clone_iterator == (PixelIterator *) NULL)
     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
       iterator->name);
@@ -176,8 +172,6 @@ WandExport PixelIterator *ClonePixelIterator(const PixelIterator *iterator)
     PixelIteratorId,(double) clone_iterator->id);
   clone_iterator->exception=AcquireExceptionInfo();
   InheritException(clone_iterator->exception,iterator->exception);
-  clone_iterator->image=CloneImage(iterator->image,0,0,MagickTrue,
-    iterator->exception);
   clone_iterator->view=CloneCacheView(iterator->view);
   clone_iterator->region=iterator->region;
   clone_iterator->active=iterator->active;
@@ -220,7 +214,6 @@ WandExport PixelIterator *DestroyPixelIterator(PixelIterator *iterator)
   assert(iterator->signature == WandSignature);
   if (iterator->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name);
-  iterator->image=DestroyImage(iterator->image);
   iterator->view=DestroyCacheView(iterator->view);
   iterator->pixel_wands=DestroyPixelWands(iterator->pixel_wands,
     iterator->region.width);
@@ -332,7 +325,6 @@ WandExport PixelIterator *NewPixelIterator(MagickWand *wand)
   (void) FormatLocaleString(iterator->name,MaxTextExtent,"%s-%.20g",
     PixelIteratorId,(double) iterator->id);
   iterator->exception=exception;
-  iterator->image=CloneImage(image,0,0,MagickTrue,iterator->exception);
   iterator->view=view;
   SetGeometry(image,&iterator->region);
   iterator->region.width=image->columns;
@@ -397,7 +389,7 @@ WandExport MagickBooleanType PixelClearIteratorException(
 %
 %  The format of the NewPixelRegionIterator method is:
 %
-%      PixelIterator NewPixelRegionIterator(MagickWand *wand,const ssize_t x,
+%      PixelIterator *NewPixelRegionIterator(MagickWand *wand,const ssize_t x,
 %        const ssize_t y,const size_t width,const size_t height)
 %
 %  A description of each parameter follows:
@@ -515,8 +507,9 @@ WandExport PixelWand **PixelGetCurrentIteratorRow(PixelIterator *iterator,
     return((PixelWand **) NULL);
   for (x=0; x < (ssize_t) iterator->region.width; x++)
   {
-    PixelSetQuantumPixel(iterator->image,pixels,iterator->pixel_wands[x]);
-    pixels+=GetPixelChannels(iterator->image);
+    PixelSetQuantumPixel(GetCacheViewImage(iterator->view),pixels,
+      iterator->pixel_wands[x]);
+    pixels+=GetPixelChannels(GetCacheViewImage(iterator->view));
   }
   *number_wands=iterator->region.width;
   return(iterator->pixel_wands);
@@ -696,8 +689,9 @@ WandExport PixelWand **PixelGetNextIteratorRow(PixelIterator *iterator,
     return((PixelWand **) NULL);
   for (x=0; x < (ssize_t) iterator->region.width; x++)
   {
-    PixelSetQuantumPixel(iterator->image,pixels,iterator->pixel_wands[x]);
-    pixels+=GetPixelChannels(iterator->image);
+    PixelSetQuantumPixel(GetCacheViewImage(iterator->view),pixels,
+      iterator->pixel_wands[x]);
+    pixels+=GetPixelChannels(GetCacheViewImage(iterator->view));
   }
   *number_wands=iterator->region.width;
   return(iterator->pixel_wands);
@@ -754,8 +748,9 @@ WandExport PixelWand **PixelGetPreviousIteratorRow(PixelIterator *iterator,
     return((PixelWand **) NULL);
   for (x=0; x < (ssize_t) iterator->region.width; x++)
   {
-    PixelSetQuantumPixel(iterator->image,pixels,iterator->pixel_wands[x]);
-    pixels+=GetPixelChannels(iterator->image);
+    PixelSetQuantumPixel(GetCacheViewImage(iterator->view),pixels,
+      iterator->pixel_wands[x]);
+    pixels+=GetPixelChannels(GetCacheViewImage(iterator->view));
   }
   *number_wands=iterator->region.width;
   return(iterator->pixel_wands);
@@ -944,8 +939,9 @@ WandExport MagickBooleanType PixelSyncIterator(PixelIterator *iterator)
     return(MagickFalse);
   for (x=0; x < (ssize_t) iterator->region.width; x++)
   {
-    PixelGetQuantumPixel(iterator->image,iterator->pixel_wands[x],pixels);
-    pixels+=GetPixelChannels(iterator->image);
+    PixelGetQuantumPixel(GetCacheViewImage(iterator->view),
+      iterator->pixel_wands[x],pixels);
+    pixels+=GetPixelChannels(GetCacheViewImage(iterator->view));
   }
   if (SyncCacheViewAuthenticPixels(iterator->view,iterator->exception) == MagickFalse)
     return(MagickFalse);