]> granicus.if.org Git - imagemagick/commitdiff
Added Rotation Expansion for single Built-in kernels (globally)
authoranthony <anthony@git.imagemagick.org>
Sun, 23 May 2010 23:08:57 +0000 (23:08 +0000)
committeranthony <anthony@git.imagemagick.org>
Sun, 23 May 2010 23:08:57 +0000 (23:08 +0000)
ChangeLog
magick/morphology.c

index 4bc018b04cc052a9e3cd69502718bdb0d4d1f533..ea593f21dc4d64d21a89442a5c5a4df06815cbed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,7 +7,10 @@
     while HitAndMiss defaults to "Lighten" (union of all kernel results).
     Other morphology methods defaults still to be decided.
   * Added HitAndMiss Kernel: Ridges  (find ridges and pixel width lines)
+  * Rotation Expansion of single kernels '^' and '@' flags in arguments
+    EG: -set option:showkernel 1 -morphology Convolve 'Blur:0x2^'
   * ExpandKernelInfo() (rotation expand) now groks symmetrical kernels.
+    So the above will only produce a list of 2 kernels, not 4 kernels
 
 2010-05-18  6.6.2.0 Anthony Thyssen <A.Thyssen@griffith...>
   * Separation of internal function MorphologyAppy() from
@@ -15,7 +18,8 @@
   * Rewrite of MorphologyApply() to output better 'verbose' messages
   * Better handling of Gaussian tyle filters (bug fixes)
   * Bug fix and optimization of kernel size calculations in "gem.c"
-  * Allow kernel rotation flags in 'user defined' kernels
+  * Allow '^' or '@' flags in 'user defined' kernel size arguments to
+    expand kernel into a rotated list.
     EG: -set option:showkernel 1 -morphology Thinning  '3@: 0,1,0 0,1,0 0,0,0'
   * Allow a scaled unity kernel to be added to kernel (EdgeDet->Sharpen)
     EG: -set option:convolve:scale [kernel_scale][^!],[unity_scale][%]
index a1b7f806481271d69d78877452df02921fd83d0b..4df42c2f741fdd61f9a84fc4d7720a391631a53c 100644 (file)
@@ -364,6 +364,9 @@ static KernelInfo *ParseKernelArray(const char *kernel_string)
 
 static KernelInfo *ParseKernelName(const char *kernel_string)
 {
+  KernelInfo
+    *kernel;
+
   char
     token[MaxTextExtent];
 
@@ -447,7 +450,17 @@ static KernelInfo *ParseKernelName(const char *kernel_string)
       break;
   }
 
-  return(AcquireKernelBuiltIn((KernelInfoType)type, &args));
+  kernel = AcquireKernelBuiltIn((KernelInfoType)type, &args);
+
+  /* global expand to rotated kernel list - only for single kernels */
+  if ( kernel->next == (KernelInfo *) NULL ) {
+    if ( (flags & AreaValue) != 0 )         /* '@' symbol in kernel args */
+      ExpandKernelInfo(kernel, 45.0);
+    else if ( (flags & MinimumValue) != 0 ) /* '^' symbol in kernel args */
+      ExpandKernelInfo(kernel, 90.0);
+  }
+
+  return(kernel);
 }
 
 MagickExport KernelInfo *AcquireKernelInfo(const char *kernel_string)