]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 24 Feb 2012 00:19:10 +0000 (00:19 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 24 Feb 2012 00:19:10 +0000 (00:19 +0000)
MagickCore/option.c
MagickWand/convert.c
MagickWand/mogrify.c
MagickWand/operation.c
utilities/convert.1.in
utilities/mogrify.1.in

index 4030692c0d36cb8a8fc10f5017a66996cf9542ca..246bf0abc708776a5ca114464642433811e20379 100644 (file)
@@ -158,8 +158,8 @@ static const OptionInfo
   CommandOptions[] =
   {
     /* WARNING: this must be sorted by name, then by switch character
-       So that it can be referanced using a binary search for speed.
-       See  GetCommandOptionInfo() below for details.
+       So that it can be referenced using a binary search for speed.
+       See GetCommandOptionInfo() below for details.
 
        Check on sort...
            magick -list command > t1
@@ -239,6 +239,9 @@ static const OptionInfo
     { "-cdl", 1L, SimpleOperatorOptionFlag, MagickFalse },
     { "+channel", 0L, ImageInfoOptionFlag | SimpleOperatorOptionFlag, MagickFalse },
     { "-channel", 1L, ImageInfoOptionFlag | SimpleOperatorOptionFlag, MagickFalse },
+    { "-channel-extract", 1L, SimpleOperatorOptionFlag, MagickFalse },
+    { "-channel-inject", 0L, ListOperatorOptionFlag | FireOptionFlag, MagickTrue },
+    { "-channel-swap", 1L, SimpleOperatorOptionFlag, MagickFalse },
     { "+charcoal", 0L, DeprecateOptionFlag, MagickTrue },
     { "-charcoal", 0L, SimpleOperatorOptionFlag, MagickFalse },
     { "+chop", 1L, DeprecateOptionFlag, MagickTrue },
index a3d6c73154b610feea05e86899426ed73403727e..fd6fc267eac283d4f810c5eb32a4a08639a2f525 100644 (file)
@@ -135,6 +135,16 @@ static MagickBooleanType ConcatenateImages(int argc,char **argv,
 static MagickBooleanType ConvertUsage(void)
 {
   static const char
+    *channel_operators[]=
+    {
+      "-channel-extract channel-list",
+      "                     extract the channels in order",
+      "-channel-inject channel-list",
+      "                     inject the channels in order",
+      "-channel-swap channel,channel",
+      "                     swap channels",
+      (char *) NULL
+    },
     *miscellaneous[]=
     {
       "-debug events        display copious debugging information",
@@ -441,6 +451,9 @@ static MagickBooleanType ConvertUsage(void)
   (void) printf("\nImage Operators:\n");
   for (p=operators; *p != (char *) NULL; p++)
     (void) printf("  %s\n",*p);
+  (void) printf("\nImage Channel Operators:\n");
+  for (p=channel_operators; *p != (char *) NULL; p++)
+    (void) printf("  %s\n",*p);
   (void) printf("\nImage Sequence Operators:\n");
   for (p=sequence_operators; *p != (char *) NULL; p++)
     (void) printf("  %s\n",*p);
@@ -877,6 +890,54 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
                 argv[i]);
             break;
           }
+        if (LocaleCompare("channel-extract",option+1) == 0)
+          {
+            ssize_t
+              channel;
+
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowConvertException(OptionError,"MissingArgument",option);
+            channel=ParseChannelOption(argv[i]);
+            if (channel < 0)
+              ThrowConvertException(OptionError,"UnrecognizedChannelType",
+                argv[i]);
+            break;
+          }
+        if (LocaleCompare("channel-inject",option+1) == 0)
+          {
+            ssize_t
+              channel;
+
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowConvertException(OptionError,"MissingArgument",option);
+            channel=ParseChannelOption(argv[i]);
+            if (channel < 0)
+              ThrowConvertException(OptionError,"UnrecognizedChannelType",
+                argv[i]);
+            break;
+          }
+        if (LocaleCompare("channel-swap",option+1) == 0)
+          {
+            ssize_t
+              channel;
+
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowConvertException(OptionError,"MissingArgument",option);
+            channel=ParseChannelOption(argv[i]);
+            if (channel < 0)
+              ThrowConvertException(OptionError,"UnrecognizedChannelType",
+                argv[i]);
+            break;
+          }
         if (LocaleCompare("charcoal",option+1) == 0)
           {
             if (*option == '+')
index b3441ec1c040e3a5cee60a642d95a6c9c854ce3c..16baf3281f775a14e4bde1a2e32d7dd6da5df659 100644 (file)
@@ -1037,6 +1037,16 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
               exception);
             break;
           }
+        if (LocaleCompare("channel-extract",option+1) == 0)
+          {
+            puts("stand by...");
+            break;
+          }
+        if (LocaleCompare("channel-swap",option+1) == 0)
+          {
+            puts("stand by...");
+            break;
+          }
         if (LocaleCompare("charcoal",option+1) == 0)
           {
             /*
@@ -3255,6 +3265,16 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
 static MagickBooleanType MogrifyUsage(void)
 {
   static const char
+    *channel_operators[]=
+    {
+      "-channel-extract channel-list",
+      "                     extract the channels in order",
+      "-channel-inject channel-list",
+      "                     inject the channels in order",
+      "-channel-swap channel,channel",
+      "                     swap channels",
+      (char *) NULL
+    },
     *miscellaneous[]=
     {
       "-debug events        display copious debugging information",
@@ -3560,6 +3580,9 @@ static MagickBooleanType MogrifyUsage(void)
   (void) printf("\nImage Operators:\n");
   for (p=operators; *p != (char *) NULL; p++)
     (void) printf("  %s\n",*p);
+  (void) printf("\nImage Channel Operators:\n");
+  for (p=channel_operators; *p != (char *) NULL; p++)
+    (void) printf("  %s\n",*p);
   (void) printf("\nImage Sequence Operators:\n");
   for (p=sequence_operators; *p != (char *) NULL; p++)
     (void) printf("  %s\n",*p);
@@ -4025,6 +4048,54 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
                 argv[i]);
             break;
           }
+        if (LocaleCompare("channel-extract",option+1) == 0)
+          {
+            ssize_t
+              channel;
+
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowMogrifyException(OptionError,"MissingArgument",option);
+            channel=ParseChannelOption(argv[i]);
+            if (channel < 0)
+              ThrowMogrifyException(OptionError,"UnrecognizedChannelType",
+                argv[i]);
+            break;
+          }
+        if (LocaleCompare("channel-inject",option+1) == 0)
+          {
+            ssize_t
+              channel;
+
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowMogrifyException(OptionError,"MissingArgument",option);
+            channel=ParseChannelOption(argv[i]);
+            if (channel < 0)
+              ThrowMogrifyException(OptionError,"UnrecognizedChannelType",
+                argv[i]);
+            break;
+          }
+        if (LocaleCompare("channel-swap",option+1) == 0)
+          {
+            ssize_t
+              channel;
+
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowMogrifyException(OptionError,"MissingArgument",option);
+            channel=ParseChannelOption(argv[i]);
+            if (channel < 0)
+              ThrowMogrifyException(OptionError,"UnrecognizedChannelType",
+                argv[i]);
+            break;
+          }
         if (LocaleCompare("cdl",option+1) == 0)
           {
             if (*option == '+')
@@ -7319,6 +7390,11 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
       }
       case 'c':
       {
+        if (LocaleCompare("channel-inject",option+1) == 0)
+          {
+            puts("stand by...");
+            break;
+          }
         if (LocaleCompare("clut",option+1) == 0)
           {
             Image
index 0db0bf651359799107d2dfa0421e19d7def1830e..34b33aa430333444447a35d089ef18aea4bf4df7 100644 (file)
@@ -1771,6 +1771,16 @@ static void WandSimpleOperatorImage(MagickWand *wand,
           SetPixelChannelMapMask(image,image_info->channel);
           break;
         }
+      if (LocaleCompare("channel-extract",option) == 0)
+        {
+          puts("stand by...");
+          break;
+        }
+      if (LocaleCompare("channel-swap",option) == 0)
+        {
+          puts("stand by...");
+          break;
+        }
       if (LocaleCompare("charcoal",option) == 0)
         {
           flags=ParseGeometry(arg1,&geometry_info);
@@ -3423,19 +3433,24 @@ WandExport void WandListOperatorImages(MagickWand *wand,
     }
     case 'c':
     {
+      if (LocaleCompare("channel-inject",option) == 0)
+        {
+          puts("stand by...");
+          break;
+        }
       if (LocaleCompare("clut",option) == 0)
         {
-          /* FUTURE - make this a compose option (and thus layers compose )
-             or perhaps compose last image over all other images.
-          */
           Image
             *clut_image;
 
+          /* FUTURE - make this a compose option (and thus layers compose )
+             or perhaps compose last image over all other images.
+          */
           new_images=RemoveFirstImageFromList(&images);
           clut_image=RemoveLastImageFromList(&images);
           /* FUTURE - produce Exception, rather than silent fail */
           if (clut_image == (Image *) NULL)
-              break;
+            break;
           (void) ClutImage(new_images,clut_image,images->interpolate,exception);
           clut_image=DestroyImage(clut_image);
           break;
index dd0d02deaca0ac91b7b78e80c62f88d1ec48fba2..ff76a523e0d889b093f7d4ae03e21cecd939192f 100644 (file)
@@ -225,6 +225,15 @@ Image Operators:
   \-white-threshold value
                        force all pixels above the threshold into white
 
+
+Image Channel Operators:
+  \-channel-extract channel-list
+                        extract the channels in order
+  \-channel-inject channel-list
+                        inject the channels in order
+  \-channel-swap channel,channel
+                        swap the channels
+
 Image Sequence Operators:
   \-affinity filename   transform image colors to match this set of colors
   \-append              append an image sequence top to bottom (use +append for left to right)
index f0fdf41406cf3ebf9e6dd78d1bc9433af4e74b26..7ea8e1fd0c1949ca8b51f50b52f3e8fa0a157cab 100644 (file)
@@ -227,6 +227,14 @@ Image Operators:
   \-white-threshold value
                        force all pixels above the threshold into white
 
+Image Channel Operators:
+  \-channel-extract channel-list
+                        extract the channels in order
+  \-channel-inject channel-list
+                        inject the channels in order
+  \-channel-swap channel,channel
+                        swap the channels
+
 Image Sequence Operators:
   \-affinity filename   transform image colors to match this set of colors
   \-append              append an image sequence top to botto (use +append for left to right)