]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/composite.c
Add RobidouxSharp filter depreciate Bessel Filter and Static Gravity
[imagemagick] / MagickCore / composite.c
index 59a36e6560dd7571d002bc15da22c0e28e31a0af..88cd17f7334ebe2d3e04633bc4753f7ac0798f92 100644 (file)
 %  The format of the CompositeImage method is:
 %
 %      MagickBooleanType CompositeImage(Image *image,
-%        const CompositeOperator compose,Image *composite_image,
-%        const ssize_t x_offset,const ssize_t y_offset,ExceptionInfo *exception)
+%        const Image *composite_image,const CompositeOperator compose,
+%        const MagickBooleanType clip_to_self,const ssize_t x_offset,
+%        const ssize_t y_offset,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
 %    o image: the destination image, modified by he composition
 %
+%    o composite_image: the composite (source) image.
+%
 %    o compose: This operator affects how the composite is applied to
 %      the image.  The operators and how they are utilized are listed here
 %      http://www.w3.org/TR/SVG12/#compositing.
 %
-%    o composite_image: the composite (source) image.
+%    o clip_to_self: set to MagickTrue to limit composition to area composed.
 %
 %    o x_offset: the column offset of the composited image.
 %
 %        Compose methods needing such arguments include "BlendCompositeOp" and
 %        "DisplaceCompositeOp".
 %
-%    o "compose:outside-overlay"
-%        Modify how the composition is to effect areas not directly covered
-%        by the 'composite_image' at the offset given.  Normally this is
-%        dependant on the 'compose' method, especially Duff-Porter methods.
-%
-%        If set to "false" then disable all normal handling of pixels not
-%        covered by the composite_image.  Typically used for repeated tiling
-%        of the composite_image by the calling API.
-%
-%        Previous to IM v6.5.3-3  this was called "modify-outside-overlay"
-%
 %    o exception: return any errors or warnings in this structure.
 %
 */
 
-static void CompositeHSB(const Quantum red,const Quantum green,
-  const Quantum blue,double *hue,double *saturation,double *brightness)
+/*
+   Composition based on the SVG specification:
+
+   A Composition is defined by...
+      Color Function :  f(Sc,Dc)  where Sc and Dc are the normizalized colors
+      Blending areas :  X = 1     for area of overlap, ie: f(Sc,Dc)
+                        Y = 1     for source preserved
+                        Z = 1     for destination preserved
+
+   Conversion to transparency (then optimized)
+      Dca' = f(Sc, Dc)*Sa*Da + Y*Sca*(1-Da) + Z*Dca*(1-Sa)
+      Da'  = X*Sa*Da + Y*Sa*(1-Da) + Z*Da*(1-Sa)
+
+   Where...
+      Sca = Sc*Sa     normalized Source color divided by Source alpha
+      Dca = Dc*Da     normalized Dest color divided by Dest alpha
+      Dc' = Dca'/Da'  the desired color value for this channel.
+
+   Da' in in the follow formula as 'gamma'  The resulting alpla value.
+
+   Most functions use a blending mode of over (X=1,Y=1,Z=1) this results in
+   the following optimizations...
+      gamma = Sa+Da-Sa*Da;
+      gamma = 1 - QuantiumScale*alpha * QuantiumScale*beta;
+      opacity = QuantiumScale*alpha*beta;  // over blend, optimized 1-Gamma
+
+   The above SVG definitions also definate that Mathematical Composition
+   methods should use a 'Over' blending mode for Alpha Channel.
+   It however was not applied for composition modes of 'Plus', 'Minus',
+   the modulus versions of 'Add' and 'Subtract'.
+
+   Mathematical operator changes to be applied from IM v6.7...
+
+    1) Modulus modes 'Add' and 'Subtract' are obsoleted and renamed
+       'ModulusAdd' and 'ModulusSubtract' for clarity.
+
+    2) All mathematical compositions work as per the SVG specification
+       with regard to blending.  This now includes 'ModulusAdd' and
+       'ModulusSubtract'.
+
+    3) When the special channel flag 'sync' (syncronize channel updates)
+       is turned off (enabled by default) then mathematical compositions are
+       only performed on the channels specified, and are applied
+       independantally of each other.  In other words the mathematics is
+       performed as 'pure' mathematical operations, rather than as image
+       operations.
+*/
+static void CompositeHSB(const double red,const double green,
+  const double blue,double *hue,double *saturation,double *brightness)
 {
   double
-    delta;
-
-  Quantum
+    delta,
     max,
     min;
 
@@ -262,6 +299,7 @@ static inline double MagickMin(const double x,const double y)
     return(x);
   return(y);
 }
+
 static inline double MagickMax(const double x,const double y)
 {
   if (x > y)
@@ -270,8 +308,8 @@ static inline double MagickMax(const double x,const double y)
 }
 
 static MagickBooleanType CompositeOverImage(Image *image,
-  const Image *composite_image,const ssize_t x_offset,const ssize_t y_offset,
-  ExceptionInfo *exception)
+  const Image *composite_image,const MagickBooleanType clip_to_self,
+  const ssize_t x_offset,const ssize_t y_offset,ExceptionInfo *exception)
 {
 #define CompositeImageTag  "Composite/Image"
 
@@ -279,11 +317,7 @@ static MagickBooleanType CompositeOverImage(Image *image,
     *composite_view,
     *image_view;
 
-  const char
-    *value;
-
   MagickBooleanType
-    modify_outside_overlay,
     status;
 
   MagickOffsetType
@@ -292,20 +326,13 @@ static MagickBooleanType CompositeOverImage(Image *image,
   ssize_t
     y;
 
-  /*
-    Prepare composite image.
-  */
-  modify_outside_overlay=MagickFalse;
-  value=GetImageArtifact(composite_image,"compose:outside-overlay");
-  if (value != (const char *) NULL)
-    modify_outside_overlay=IsMagickTrue(value);
   /*
     Composite image.
   */
   status=MagickTrue;
   progress=0;
-  image_view=AcquireCacheView(image);
-  composite_view=AcquireCacheView(composite_image);
+  composite_view=AcquireVirtualCacheView(composite_image,exception);
+  image_view=AcquireAuthenticCacheView(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(static,4) shared(progress,status)
 #endif
@@ -328,7 +355,7 @@ static MagickBooleanType CompositeOverImage(Image *image,
 
     if (status == MagickFalse)
       continue;
-    if (modify_outside_overlay == MagickFalse)
+    if (clip_to_self != MagickFalse)
       {
         if (y < y_offset)
           continue;
@@ -372,7 +399,7 @@ static MagickBooleanType CompositeOverImage(Image *image,
       register ssize_t
         i;
 
-      if (modify_outside_overlay == MagickFalse)
+      if (clip_to_self != MagickFalse)
         {
           if (x < x_offset)
             {
@@ -505,8 +532,9 @@ static MagickBooleanType CompositeOverImage(Image *image,
 }
 
 MagickExport MagickBooleanType CompositeImage(Image *image,
-  const CompositeOperator compose,const Image *composite_image,
-  const ssize_t x_offset,const ssize_t y_offset,ExceptionInfo *exception)
+  const Image *composite_image,const CompositeOperator compose,
+  const MagickBooleanType clip_to_self,const ssize_t x_offset,
+  const ssize_t y_offset,ExceptionInfo *exception)
 {
 #define CompositeImageTag  "Composite/Image"
 
@@ -514,9 +542,6 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
     *composite_view,
     *image_view;
 
-  const char
-    *value;
-
   GeometryInfo
     geometry_info;
 
@@ -524,7 +549,6 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
     *destination_image;
 
   MagickBooleanType
-    modify_outside_overlay,
     status;
 
   MagickOffsetType
@@ -545,53 +569,6 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
   ssize_t
     y;
 
-  /*
-     Composition based on the SVG specification:
-
-     A Composition is defined by...
-        Color Function :  f(Sc,Dc)  where Sc and Dc are the normizalized colors
-        Blending areas :  X = 1     for area of overlap, ie: f(Sc,Dc)
-                          Y = 1     for source preserved
-                          Z = 1     for destination preserved
-
-     Conversion to transparency (then optimized)
-        Dca' = f(Sc, Dc)*Sa*Da + Y*Sca*(1-Da) + Z*Dca*(1-Sa)
-        Da'  = X*Sa*Da + Y*Sa*(1-Da) + Z*Da*(1-Sa)
-
-     Where...
-        Sca = Sc*Sa     normalized Source color divided by Source alpha
-        Dca = Dc*Da     normalized Dest color divided by Dest alpha
-        Dc' = Dca'/Da'  the desired color value for this channel.
-
-     Da' in in the follow formula as 'gamma'  The resulting alpla value.
-
-     Most functions use a blending mode of over (X=1,Y=1,Z=1) this results in
-     the following optimizations...
-        gamma = Sa+Da-Sa*Da;
-        gamma = 1 - QuantiumScale*alpha * QuantiumScale*beta;
-        opacity = QuantiumScale*alpha*beta;  // over blend, optimized 1-Gamma
-
-     The above SVG definitions also definate that Mathematical Composition
-     methods should use a 'Over' blending mode for Alpha Channel.
-     It however was not applied for composition modes of 'Plus', 'Minus',
-     the modulus versions of 'Add' and 'Subtract'.
-
-     Mathematical operator changes to be applied from IM v6.7...
-
-      1) Modulus modes 'Add' and 'Subtract' are obsoleted and renamed
-         'ModulusAdd' and 'ModulusSubtract' for clarity.
-
-      2) All mathematical compositions work as per the SVG specification
-         with regard to blending.  This now includes 'ModulusAdd' and
-         'ModulusSubtract'.
-
-      3) When the special channel flag 'sync' (syncronize channel updates)
-         is turned off (enabled by default) then mathematical compositions are
-         only performed on the channels specified, and are applied
-         independantally of each other.  In other words the mathematics is
-         performed as 'pure' mathematical operations, rather than as image
-         operations.
-  */
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
@@ -600,37 +577,24 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
   assert(composite_image->signature == MagickSignature);
   if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
     return(MagickFalse);
+  if ((IsGrayColorspace(image->colorspace) != MagickFalse) &&
+      (IsGrayColorspace(composite_image->colorspace) == MagickFalse))
+    (void) TransformImageColorspace(image,sRGBColorspace,exception);
   if ((compose == OverCompositeOp) || (compose == SrcOverCompositeOp))
     {
-      status=CompositeOverImage(image,composite_image,x_offset,y_offset,
-        exception);
+      status=CompositeOverImage(image,composite_image,clip_to_self,x_offset,
+        y_offset,exception);
       return(status);
     }
   destination_image=(Image *) NULL;
   amount=0.5;
   destination_dissolve=1.0;
-  modify_outside_overlay=MagickFalse;
   percent_brightness=100.0;
   percent_saturation=100.0;
   source_dissolve=1.0;
   threshold=0.05f;
   switch (compose)
   {
-    case ClearCompositeOp:
-    case DstAtopCompositeOp:
-    case DstInCompositeOp:
-    case InCompositeOp:
-    case OutCompositeOp:
-    case SrcCompositeOp:
-    case SrcInCompositeOp:
-    case SrcOutCompositeOp:
-    {
-      /*
-        Modify destination outside the overlaid region.
-      */
-      modify_outside_overlay=MagickTrue;
-      break;
-    }
     case CopyCompositeOp:
     {
       if ((x_offset < 0) || (y_offset < 0))
@@ -640,8 +604,8 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
       if ((y_offset+(ssize_t) composite_image->rows) >= (ssize_t) image->rows)
         break;
       status=MagickTrue;
-      image_view=AcquireCacheView(image);
-      composite_view=AcquireCacheView(composite_image);
+      composite_view=AcquireVirtualCacheView(composite_image,exception);
+      image_view=AcquireAuthenticCacheView(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
       #pragma omp parallel for schedule(static,4) shared(status)
 #endif
@@ -732,7 +696,6 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
       */
       if (image->matte == MagickFalse)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
-      modify_outside_overlay=MagickTrue;
       break;
     }
     case BlurCompositeOp:
@@ -741,6 +704,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
         *composite_view,
         *destination_view;
 
+      const char
+        *value;
+
       PixelInfo
         pixel;
 
@@ -805,11 +771,14 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
         }
       /*
         Blur Image by resampling.
+        FUTURE: this is currently broken, especially for small sigma blurs
+        This needs to be fixed to use a non-user filter setup that provides
+        far more control than currently available.
       */
       resample_filter=AcquireResampleFilter(image,exception);
-      SetResampleFilter(resample_filter,CubicFilter);
-      destination_view=AcquireCacheView(destination_image);
-      composite_view=AcquireCacheView(composite_image);
+      SetResampleFilter(resample_filter,GaussianFilter); /* was blur*2 */
+      composite_view=AcquireVirtualCacheView(composite_image,exception);
+      destination_view=AcquireAuthenticCacheView(destination_image,exception);
       for (y=0; y < (ssize_t) composite_image->rows; y++)
       {
         MagickBooleanType
@@ -857,7 +826,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
             GetPixelRed(composite_image,p),blur.y2*QuantumScale*
             GetPixelGreen(composite_image,p));
           (void) ResamplePixelColor(resample_filter,(double) x_offset+x,
-            (double) y_offset+y,&pixel);
+            (double) y_offset+y,&pixel,exception);
           SetPixelInfoPixel(destination_image,&pixel,q);
           p+=GetPixelChannels(composite_image);
           q+=GetPixelChannels(destination_image);
@@ -880,6 +849,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
         *destination_view,
         *image_view;
 
+      const char
+        *value;
+
       PixelInfo
         pixel;
 
@@ -978,9 +950,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
         displacement/distortion map.  -- Like a lens...
       */
       GetPixelInfo(image,&pixel);
-      image_view=AcquireCacheView(image);
-      destination_view=AcquireCacheView(destination_image);
-      composite_view=AcquireCacheView(composite_image);
+      image_view=AcquireVirtualCacheView(image,exception);
+      composite_view=AcquireVirtualCacheView(composite_image,exception);
+      destination_view=AcquireAuthenticCacheView(destination_image,exception);
       for (y=0; y < (ssize_t) composite_image->rows; y++)
       {
         MagickBooleanType
@@ -1045,6 +1017,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
     }
     case DissolveCompositeOp:
     {
+      const char
+        *value;
+
       /*
         Geometry arguments to dissolve factors.
       */
@@ -1065,17 +1040,14 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
             destination_dissolve=geometry_info.sigma/100.0;
           if ((destination_dissolve-MagickEpsilon) < 0.0)
             destination_dissolve=0.0;
-          modify_outside_overlay=MagickTrue;
-          if ((destination_dissolve+MagickEpsilon) > 1.0 )
-            {
-              destination_dissolve=1.0;
-              modify_outside_overlay=MagickFalse;
-            }
         }
       break;
     }
     case BlendCompositeOp:
     {
+      const char
+        *value;
+
       value=GetImageArtifact(composite_image,"compose:args");
       if (value != (char *) NULL)
         {
@@ -1084,14 +1056,14 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           destination_dissolve=1.0-source_dissolve;
           if ((flags & SigmaValue) != 0)
             destination_dissolve=geometry_info.sigma/100.0;
-          modify_outside_overlay=MagickTrue;
-          if ((destination_dissolve+MagickEpsilon) > 1.0)
-            modify_outside_overlay=MagickFalse;
         }
       break;
     }
     case MathematicsCompositeOp:
     {
+      const char
+        *value;
+
       /*
         Just collect the values from "compose:args", setting.
         Unused values are set to zero automagically.
@@ -1108,6 +1080,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
     }
     case ModulateCompositeOp:
     {
+      const char
+        *value;
+
       /*
         Determine the brightness and saturation scale.
       */
@@ -1123,6 +1098,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
     }
     case ThresholdCompositeOp:
     {
+      const char
+        *value;
+
       /*
         Determine the amount and threshold.
       */
@@ -1141,17 +1119,14 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
     default:
       break;
   }
-  value=GetImageArtifact(composite_image,"compose:outside-overlay");
-  if (value != (const char *) NULL)
-    modify_outside_overlay=IsMagickTrue(value);
   /*
     Composite image.
   */
   status=MagickTrue;
   progress=0;
   midpoint=((MagickRealType) QuantumRange+1.0)/2;
-  image_view=AcquireCacheView(image);
-  composite_view=AcquireCacheView(composite_image);
+  composite_view=AcquireVirtualCacheView(composite_image,exception);
+  image_view=AcquireAuthenticCacheView(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(static,4) shared(progress,status)
 #endif
@@ -1168,6 +1143,10 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
       red,
       saturation;
 
+    PixelInfo
+      destination_pixel,
+      source_pixel;
+
     register const Quantum
       *restrict p;
 
@@ -1179,7 +1158,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
 
     if (status == MagickFalse)
       continue;
-    if (modify_outside_overlay == MagickFalse)
+    if (clip_to_self != MagickFalse)
       {
         if (y < y_offset)
           continue;
@@ -1213,6 +1192,8 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
     hue=0.0;
     saturation=0.0;
     brightness=0.0;
+    GetPixelInfo(image,&destination_pixel);
+    GetPixelInfo(composite_image,&source_pixel);
     for (x=0; x < (ssize_t) image->columns; x++)
     {
       MagickRealType
@@ -1231,7 +1212,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
       size_t
         channels;
 
-      if (modify_outside_overlay == MagickFalse)
+      if (clip_to_self != MagickFalse)
         {
           if (x < x_offset)
             {
@@ -1432,6 +1413,21 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           q+=GetPixelChannels(image);
           continue;
         }
+      switch (compose)
+      {
+        case ColorizeCompositeOp:
+        case HueCompositeOp:
+        case LuminizeCompositeOp:
+        case ModulateCompositeOp:
+        case SaturateCompositeOp:
+        {
+          GetPixelInfoPixel(composite_image,p,&source_pixel);
+          GetPixelInfoPixel(image,q,&destination_pixel);
+          break;
+        }
+        default:
+          break;
+      }
       for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
       {
         double
@@ -1706,10 +1702,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
                 pixel=Sc;
                 break;
               }
-            CompositeHSB(GetPixelRed(image,q),GetPixelGreen(image,q),
-              GetPixelBlue(image,q),&sans,&sans,&brightness);
-            CompositeHSB(GetPixelRed(composite_image,p),
-              GetPixelGreen(composite_image,p),GetPixelBlue(composite_image,p),
+            CompositeHSB(destination_pixel.red,destination_pixel.green,
+              destination_pixel.blue,&sans,&sans,&brightness);
+            CompositeHSB(source_pixel.red,source_pixel.green,source_pixel.blue,
               &hue,&saturation,&sans);
             HSBComposite(hue,saturation,brightness,&red,&green,&blue);
             switch (channel)
@@ -1873,10 +1868,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
                 pixel=Sc;
                 break;
               }
-            CompositeHSB(GetPixelRed(image,q),GetPixelGreen(image,q),
-              GetPixelBlue(image,q),&hue,&saturation,&brightness);
-            CompositeHSB(GetPixelRed(composite_image,p),
-              GetPixelGreen(composite_image,p),GetPixelBlue(composite_image,p),
+            CompositeHSB(destination_pixel.red,destination_pixel.green,
+              destination_pixel.blue,&hue,&saturation,&brightness);
+            CompositeHSB(source_pixel.red,source_pixel.green,source_pixel.blue,
               &hue,&sans,&sans);
             HSBComposite(hue,saturation,brightness,&red,&green,&blue);
             switch (channel)
@@ -1954,10 +1948,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
                 pixel=Sc;
                 break;
               }
-            CompositeHSB(GetPixelRed(image,q),GetPixelGreen(image,q),
-              GetPixelBlue(image,q),&hue,&saturation,&brightness);
-            CompositeHSB(GetPixelRed(composite_image,p),
-              GetPixelGreen(composite_image,p),GetPixelBlue(composite_image,p),
+            CompositeHSB(destination_pixel.red,destination_pixel.green,
+              destination_pixel.blue,&hue,&saturation,&brightness);
+            CompositeHSB(source_pixel.red,source_pixel.green,source_pixel.blue,
               &sans,&sans,&brightness);
             HSBComposite(hue,saturation,brightness,&red,&green,&blue);
             switch (channel)
@@ -2026,8 +2019,8 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
                 pixel=Dc;
                 break;
               }
-            CompositeHSB(GetPixelRed(image,q),GetPixelGreen(image,q),
-              GetPixelBlue(image,q),&hue,&saturation,&brightness);
+            CompositeHSB(destination_pixel.red,destination_pixel.green,
+              destination_pixel.blue,&hue,&saturation,&brightness);
             brightness+=(0.01*percent_brightness*offset)/midpoint;
             saturation*=0.01*percent_saturation;
             HSBComposite(hue,saturation,brightness,&red,&green,&blue);
@@ -2142,10 +2135,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
                 pixel=Sc;
                 break;
               }
-            CompositeHSB(GetPixelRed(image,q),GetPixelGreen(image,q),
-              GetPixelBlue(image,q),&hue,&saturation,&brightness);
-            CompositeHSB(GetPixelRed(composite_image,p),
-              GetPixelGreen(composite_image,p),GetPixelBlue(composite_image,p),
+            CompositeHSB(destination_pixel.red,destination_pixel.green,
+              destination_pixel.blue,&hue,&saturation,&brightness);
+            CompositeHSB(source_pixel.red,source_pixel.green,source_pixel.blue,
               &sans,&saturation,&sans);
             HSBComposite(hue,saturation,brightness,&red,&green,&blue);
             switch (channel)
@@ -2348,9 +2340,9 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture,
           MagickBooleanType
             thread_status;
 
-          thread_status=CompositeImage(image,image->compose,texture_image,x+
-            texture_image->tile_offset.x,y+texture_image->tile_offset.y,
-            exception);
+          thread_status=CompositeImage(image,texture_image,image->compose,
+            MagickFalse,x+texture_image->tile_offset.x,y+
+            texture_image->tile_offset.y,exception);
           if (thread_status == MagickFalse)
             {
               status=thread_status;
@@ -2380,8 +2372,8 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture,
     Tile texture onto the image background (optimized).
   */
   status=MagickTrue;
-  image_view=AcquireCacheView(image);
-  texture_view=AcquireCacheView(texture_image);
+  texture_view=AcquireVirtualCacheView(texture_image,exception);
+  image_view=AcquireAuthenticCacheView(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(static) shared(status)
 #endif