]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authoranthony <anthony@git.imagemagick.org>
Thu, 10 Jun 2010 07:13:20 +0000 (07:13 +0000)
committeranthony <anthony@git.imagemagick.org>
Thu, 10 Jun 2010 07:13:20 +0000 (07:13 +0000)
magick/morphology.c

index ab66f3e9937d68406d246163e64cc1c4878e8edc..058aeb8ce21d65b2a2e097cecbcdf33a21987d6f 100644 (file)
@@ -1292,7 +1292,9 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
         break;
       }
     case SobelKernel:
-      { switch ( (int) args->rho ) {
+#if 0
+      { /* Sobel with optional 'sub-types' */
+        switch ( (int) args->rho ) {
           default:
           case 0:
             kernel=ParseKernelArray("3: 1,0,-1  2,0,-2  1,0,-1");
@@ -1315,6 +1317,16 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
             ScaleKernelInfo(kernel, 0.25, NoValue);
             break;
         }
+#else
+      { /* Simple Sobel kernel */
+        kernel=ParseKernelArray("3: 1,0,-1  2,0,-2  1,0,-1");
+        if (kernel == (KernelInfo *) NULL)
+          return(kernel);
+        kernel->type = type;
+        RotateKernelInfo(kernel, args->rho);
+        break;
+      }
+#endif
         if ( fabs(args->sigma) > MagickEpsilon )
           /* Rotate by correctly supplied 'angle' */
           RotateKernelInfo(kernel, args->sigma);