]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 15 Feb 2010 02:00:01 +0000 (02:00 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 15 Feb 2010 02:00:01 +0000 (02:00 +0000)
magick/cache.c
magick/geometry.h

index 8379c66b917282739df487954cea050bc967515b..8eed032d7f81f937f1aad776083df664e321ea79 100644 (file)
@@ -49,6 +49,7 @@
 #include "magick/composite-private.h"
 #include "magick/exception.h"
 #include "magick/exception-private.h"
+#include "magick/geometry.h"
 #include "magick/list.h"
 #include "magick/log.h"
 #include "magick/magick.h"
@@ -5009,28 +5010,29 @@ static PixelPacket *SetPixelCacheNexusPixels(const Image *image,
       number_pixels=(MagickSizeType) cache_info->columns*cache_info->rows;
       if ((offset >= 0) && (((MagickSizeType) offset+length) < number_pixels))
         {
-          long
-            x,
-            y;
-
-          x=nexus_info->region.x+nexus_info->region.width;
-          y=nexus_info->region.y+nexus_info->region.height;
-          if ((nexus_info->region.x >= 0) &&
-              (x <= (long) cache_info->columns) &&
-              (nexus_info->region.y >= 0) && (y <= (long) cache_info->rows))
-            if ((nexus_info->region.height == 1UL) ||
-                ((nexus_info->region.x == 0) &&
-                ((nexus_info->region.width % cache_info->columns) == 0)))
-              {
-                /*
-                  Pixels are accessed directly from memory.
-                */
-                nexus_info->pixels=cache_info->pixels+offset;
-                nexus_info->indexes=(IndexPacket *) NULL;
-                if (cache_info->active_index_channel != MagickFalse)
-                  nexus_info->indexes=cache_info->indexes+offset;
-                return(nexus_info->pixels);
-              }
+          OffsetInfo
+            offset_info;
+
+          offset_info.x=nexus_info->region.x+nexus_info->region.width;
+          offset_info.y=nexus_info->region.y+nexus_info->region.height;
+          if (((nexus_info->region.x >= 0) &&
+               (offset_info.x <= (long) cache_info->columns) &&
+               (nexus_info->region.y >= 0) &&
+               (offset_info.y <= (long) cache_info->rows)) &&
+              ((nexus_info->region.height == 1UL) ||
+               ((nexus_info->region.x == 0) &&
+               ((nexus_info->region.width == cache_info->columns) ||
+                ((nexus_info->region.width % cache_info->columns) == 0)))))
+            {
+              /*
+                Pixels are accessed directly from memory.
+              */
+              nexus_info->pixels=cache_info->pixels+offset;
+              nexus_info->indexes=(IndexPacket *) NULL;
+              if (cache_info->active_index_channel != MagickFalse)
+                nexus_info->indexes=cache_info->indexes+offset;
+              return(nexus_info->pixels);
+            }
         }
     }
   /*
index 3b1826d8e24cdb046cc656898e237e2b9ff312ba..8cb89646881cc019d0cb15bf9f6ff73825375c00 100644 (file)
@@ -108,6 +108,13 @@ typedef struct _GeometryInfo
     chi;
 } GeometryInfo;
 
+typedef struct _OffsetInfo
+{
+  long
+    x,
+    y;
+} OffsetInfo;
+
 typedef struct _RectangleInfo
 {
   unsigned long