]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 25 Jul 2015 18:05:50 +0000 (18:05 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 25 Jul 2015 18:05:50 +0000 (18:05 +0000)
MagickCore/option.c
MagickWand/convert.c
MagickWand/identify.c
MagickWand/mogrify.c
MagickWand/operation.c
utilities/convert.1
utilities/convert.1.in
utilities/identify.1
utilities/identify.1.in
utilities/mogrify.1
utilities/mogrify.1.in

index 2b78b9e6f5a93ea8962f71f8739fb82c231e809c..20e2cded62df9a7e288a4240bb5192eade5f9b18 100644 (file)
@@ -515,8 +515,8 @@ static const OptionInfo
     { "-magnify", 0L, SimpleOperatorFlag, MagickFalse },
     { "+map", 0L, ReplacedOptionFlag | ListOperatorFlag | FireOptionFlag, MagickTrue },
     { "-map", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
-    { "+mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
-    { "-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
+    { "+mask", 0L, DeprecateOptionFlag | NeverInterpretArgsFlag, MagickFalse },
+    { "-mask", 1L, DeprecateOptionFlag | NeverInterpretArgsFlag, MagickFalse },
     { "-matte", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
     { "+matte", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
     { "+mattecolor", 0L, ImageInfoOptionFlag, MagickFalse },
@@ -601,6 +601,8 @@ static const OptionInfo
     { "+random-threshold", 1L, DeprecateOptionFlag, MagickTrue },
     { "-random-threshold", 1L, SimpleOperatorFlag, MagickFalse },
     { "-read", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
+    { "+read-mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
+    { "-read-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
     { "+recolor", 1L, DeprecateOptionFlag, MagickTrue },
     { "-recolor", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
     { "+red-primary", 0L, ImageInfoOptionFlag, MagickFalse },
@@ -788,6 +790,8 @@ static const OptionInfo
     { "-window-group", 1L, NonMagickOptionFlag, MagickFalse },
     { "-write", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse },
     { "+write", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse },
+    { "+write-mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
+    { "-write-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
     { (char *) NULL, 0L, UndefinedOptionFlag, MagickFalse }
   },
   ComposeOptions[] =
index 9ed4d9999858677fee64b63ae193b425c3828fe1..0384d68d8a7efbfe3909cb0b0e33e6c783c6b377 100644 (file)
@@ -405,7 +405,6 @@ static MagickBooleanType ConvertUsage(void)
       "-label string        assign a label to an image",
       "-limit type value    pixel cache resource limit",
       "-loop iterations     add Netscape loop extension to your GIF animation",
-      "-mask filename       associate a mask with the image",
       "-matte               store matte channel if the image has one",
       "-mattecolor color    frame color",
       "-moments             report image moments",
@@ -418,6 +417,7 @@ static MagickBooleanType ConvertUsage(void)
       "-preview type        image preview type",
       "-quality value       JPEG/MIFF/PNG compression level",
       "-quiet               suppress all warning messages",
+      "-read-mask filename  associate a read mask with the image",
       "-red-primary point   chromaticity red primary point",
       "-regard-warnings     pay attention to warning messages",
       "-remap filename      transform image colors to match this set of colors",
@@ -448,6 +448,7 @@ static MagickBooleanType ConvertUsage(void)
       "                     virtual pixel access method",
       "-weight type         render text with this font weight",
       "-white-point point   chromaticity white point",
+      "-write-mask filename associate a write mask with the image",
       (char *) NULL
     },
     *stack_operators[]=
index 68b8bc3629c923f96866c5f9510285376d20338c..f3f98fdab7a4994465cc031bdb2abee5c5fe8966 100644 (file)
@@ -137,13 +137,13 @@ static MagickBooleanType IdentifyUsage(void)
       "-interlace type      type of image interlacing scheme",
       "-interpolate method  pixel color interpolation method",
       "-limit type value    pixel cache resource limit",
-      "-mask filename       associate a mask with the image",
       "-matte               store matte channel if the image has one",
       "-moments             report image moments",
       "-monitor             monitor progress",
       "-ping                efficiently determine image attributes",
       "-precision value     maximum number of significant digits to print",
       "-quiet               suppress all warning messages",
+      "-read-mask filename  associate a read mask with the image",
       "-regard-warnings     pay attention to warning messages",
       "-respect-parentheses settings remain in effect until parenthesis boundary",
       "-sampling-factor geometry",
index 7a449893310b0cf73a4475fe0a290e094ed92bd0..8fe15fb6932df634206decc4baa5944e89be17a6 100644 (file)
@@ -2529,6 +2529,31 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
             (void) RandomThresholdImage(*image,argv[i+1],exception);
             break;
           }
+        if (LocaleCompare("read-mask",option+1) == 0)
+          {
+            Image
+              *mask;
+
+            (void) SyncImageSettings(mogrify_info,*image,exception);
+            if (*option == '+')
+              {
+                /*
+                  Remove a mask.
+                */
+                (void) SetImageMask(*image,ReadPixelMask,(Image *) NULL,
+                  exception);
+                break;
+              }
+            /*
+              Set the image mask.
+            */
+            mask=GetImageCache(mogrify_info,argv[i+1],exception);
+            if (mask == (Image *) NULL)
+              break;
+            (void) SetImageMask(*image,ReadPixelMask,mask,exception);
+            mask=DestroyImage(mask);
+            break;
+          }
         if (LocaleCompare("region",option+1) == 0)
           {
             (void) SyncImageSettings(mogrify_info,*image,exception);
@@ -3272,6 +3297,31 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
             (void) WhiteThresholdImage(*image,argv[i+1],exception);
             break;
           }
+        if (LocaleCompare("write-mask",option+1) == 0)
+          {
+            Image
+              *mask;
+
+            (void) SyncImageSettings(mogrify_info,*image,exception);
+            if (*option == '+')
+              {
+                /*
+                  Remove a mask.
+                */
+                (void) SetImageMask(*image,WritePixelMask,(Image *) NULL,
+                  exception);
+                break;
+              }
+            /*
+              Set the image mask.
+            */
+            mask=GetImageCache(mogrify_info,argv[i+1],exception);
+            if (mask == (Image *) NULL)
+              break;
+            (void) SetImageMask(*image,WritePixelMask,mask,exception);
+            mask=DestroyImage(mask);
+            break;
+          }
         break;
       }
       default:
@@ -3615,7 +3665,6 @@ static MagickBooleanType MogrifyUsage(void)
       "-label string        assign a label to an image",
       "-limit type value    pixel cache resource limit",
       "-loop iterations     add Netscape loop extension to your GIF animation",
-      "-mask filename       associate a mask with the image",
       "-matte               store matte channel if the image has one",
       "-mattecolor color    frame color",
       "-monitor             monitor progress",
@@ -3628,6 +3677,7 @@ static MagickBooleanType MogrifyUsage(void)
       "-preview type        image preview type",
       "-quality value       JPEG/MIFF/PNG compression level",
       "-quiet               suppress all warning messages",
+      "-read-mask filename  associate a read mask with the image",
       "-red-primary point   chromaticity red primary point",
       "-regard-warnings     pay attention to warning messages",
       "-remap filename      transform image colors to match this set of colors",
@@ -3657,6 +3707,7 @@ static MagickBooleanType MogrifyUsage(void)
       "                     virtual pixel access method",
       "-weight type         render text with this font weight",
       "-white-point point   chromaticity white point",
+      "-write-mask filename associate a write mask with the image",
       (char *) NULL
     },
     *stack_operators[]=
@@ -5658,6 +5709,15 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
               ThrowMogrifyInvalidArgumentException(option,argv[i]);
             break;
           }
+        if (LocaleCompare("read-mask",option+1) == 0)
+          {
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) argc)
+              ThrowMogrifyException(OptionError,"MissingArgument",option);
+            break;
+          }
         if (LocaleCompare("red-primary",option+1) == 0)
           {
             if (*option == '+')
@@ -6358,6 +6418,15 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
               ThrowMogrifyException(OptionError,"MissingArgument",option);
             break;
           }
+        if (LocaleCompare("write-mask",option+1) == 0)
+          {
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) argc)
+              ThrowMogrifyException(OptionError,"MissingArgument",option);
+            break;
+          }
         ThrowMogrifyException(OptionError,"UnrecognizedOption",option)
       }
       case '?':
index fc8dd30ccaf65a02c423b29cad3c3f9e3f311574..8156af1e7e9f91b73ae35a3a428e269b6fa7174f 100644 (file)
@@ -2740,22 +2740,9 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
         }
       if (LocaleCompare("mask",option+1) == 0)
         {
-          /* Note: arguments do not have percent escapes expanded */
-          Image
-            *mask;
-
-          if (IfPlusOp)
-            { /* Remove a mask. */
-              (void) SetImageMask(_image,ReadPixelMask,(Image *) NULL,
-                _exception);
-              break;
-            }
-          /* Set the image mask. */
-          mask=GetImageCache(_image_info,arg1,_exception);
-          if (mask == (Image *) NULL)
-            break;
-          (void) SetImageMask(_image,ReadPixelMask,mask,_exception);
-          mask=DestroyImage(mask);
+          CLIWandWarnReplaced("-read-mask");
+          (void) CLISimpleOperatorImage(cli_wand,"-read-mask",NULL,NULL,
+            exception);
           break;
         }
       if (LocaleCompare("matte",option+1) == 0)
@@ -3070,6 +3057,26 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
           (void) RandomThresholdImage(_image,arg1,_exception);
           break;
         }
+      if (LocaleCompare("read-mask",option+1) == 0)
+        {
+          /* Note: arguments do not have percent escapes expanded */
+          Image
+            *mask;
+
+          if (IfPlusOp)
+            { /* Remove a mask. */
+              (void) SetImageMask(_image,ReadPixelMask,(Image *) NULL,
+                _exception);
+              break;
+            }
+          /* Set the image mask. */
+          mask=GetImageCache(_image_info,arg1,_exception);
+          if (mask == (Image *) NULL)
+            break;
+          (void) SetImageMask(_image,ReadPixelMask,mask,_exception);
+          mask=DestroyImage(mask);
+          break;
+        }
       if (LocaleCompare("recolor",option+1) == 0)
         {
           CLIWandWarnReplaced("-color-matrix");
@@ -3519,6 +3526,26 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
           (void) WhiteThresholdImage(_image,arg1,_exception);
           break;
         }
+      if (LocaleCompare("write-mask",option+1) == 0)
+        {
+          /* Note: arguments do not have percent escapes expanded */
+          Image
+            *mask;
+
+          if (IfPlusOp)
+            { /* Remove a mask. */
+              (void) SetImageMask(_image,WritePixelMask,(Image *) NULL,
+                _exception);
+              break;
+            }
+          /* Set the image mask. */
+          mask=GetImageCache(_image_info,arg1,_exception);
+          if (mask == (Image *) NULL)
+            break;
+          (void) SetImageMask(_image,WritePixelMask,mask,_exception);
+          mask=DestroyImage(mask);
+          break;
+        }
       CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option);
     }
     default:
index ae94f0411d3998b08f7acd45544a2c382d4f1d24..767599f452f7362246d33409f59ee9adcd8f0cdd 100644 (file)
@@ -67,7 +67,6 @@ Image Settings:
   \-label string        assign a label to an image
   \-limit type value    pixel cache resource limit
   \-loop iterations     add Netscape loop extension to your GIF animation
-  \-mask filename       associate a mask with the image
   \-matte               store matte channel if the image has one
   \-mattecolor color    frame color
   \-metric type         measure differences between images with this metric
@@ -81,6 +80,7 @@ Image Settings:
   \-preview type        image preview type
   \-quality value       JPEG/MIFF/PNG compression level
   \-quiet               suppress all warning messages
+  \-read-mask filename  associate a read mask with the image
   \-red-primary point   chromaticity red primary point
   \-regard-warnings     pay attention to warning messages
   \-remap filename      transform image colors to match this set of colors
@@ -113,6 +113,7 @@ Image Settings:
                        virtual pixel access method
   \-weight type         render text with this font weight
   \-white-point point   chromaticity white point
+  \-write-mask filename associate a write mask with the image
 
 Image Operators:
   \-adaptive-blur geometry
index ebd9c9c098d156d07239e1214aa443c6ec25d2e9..1b352f4e458bf2b01ab4ec63fe0863f059cc9aee 100644 (file)
@@ -67,7 +67,6 @@ Image Settings:
   \-label string        assign a label to an image
   \-limit type value    pixel cache resource limit
   \-loop iterations     add Netscape loop extension to your GIF animation
-  \-mask filename       associate a mask with the image
   \-matte               store matte channel if the image has one
   \-mattecolor color    frame color
   \-metric type         measure differences between images with this metric
@@ -81,6 +80,7 @@ Image Settings:
   \-preview type        image preview type
   \-quality value       JPEG/MIFF/PNG compression level
   \-quiet               suppress all warning messages
+  \-read-mask filename  associate a read mask with the image
   \-red-primary point   chromaticity red primary point
   \-regard-warnings     pay attention to warning messages
   \-remap filename      transform image colors to match this set of colors
@@ -113,6 +113,7 @@ Image Settings:
                        virtual pixel access method
   \-weight type         render text with this font weight
   \-white-point point   chromaticity white point
+  \-write-mask filename associate a write mask with the image
 
 Image Operators:
   \-adaptive-blur geometry
index 8df0696a9a137eb6f984b8b20b98621731358375..5a2e83d2e72c3675ac51ef7197c11f9d620dafd1 100644 (file)
@@ -35,13 +35,13 @@ Image Settings:
   \-limit type value    pixel cache resource limit
   \-list type           Color, Configure, Delegate, Format, Magic, Module,
                        Resource, or Type
-  \-mask filename       associate a mask with the image
   \-matte               store matte channel if the image has one
   \-moments             report image moments
   \-monitor             monitor progress
   \-ping                efficiently determine image attributes
   \-precision value     maximum number of significant digits to print
   \-quiet               suppress all warning messages
+  \-read-mask filename  associate a read mask with the image
   \-regard-warnings     pay attention to warning messages
   \-respect-parentheses settings remain in effect until parenthesis boundary
   \-sampling-factor geometry
index fd166d7cc66fce6eecfdad7e14b4f5a6c3d1017c..7c5090a1a4967434007f9151d02f2fca931206b7 100644 (file)
@@ -35,13 +35,13 @@ Image Settings:
   \-limit type value    pixel cache resource limit
   \-list type           Color, Configure, Delegate, Format, Magic, Module,
                        Resource, or Type
-  \-mask filename       associate a mask with the image
   \-matte               store matte channel if the image has one
   \-moments             report image moments
   \-monitor             monitor progress
   \-ping                efficiently determine image attributes
   \-precision value     maximum number of significant digits to print
   \-quiet               suppress all warning messages
+  \-read-mask filename  associate a read mask with the image
   \-regard-warnings     pay attention to warning messages
   \-respect-parentheses settings remain in effect until parenthesis boundary
   \-sampling-factor geometry
index 2fe945d46a36021168e438cdcf15027666bb81e9..0d165f126416888982fc97119db5783247d4901b 100644 (file)
@@ -62,7 +62,6 @@ Image Settings:
   \-label string        assign a label to an image
   \-limit type value    pixel cache resource limit
   \-loop iterations     add Netscape loop extension to your GIF animation
-  \-mask filename       associate a mask with the image
   \-matte               store matte channel if the image has one
   \-mattecolor color    frame color
   \-metric type         measure differences between images with this metric
@@ -80,6 +79,7 @@ Image Settings:
   \-preview type        image preview type
   \-quality value       JPEG/MIFF/PNG compression level
   \-quiet               suppress all warning messages
+  \-read-mask filename  associate a read mask with the image
   \-red-primary point   chromaticity red primary point
   \-regard-warnings     pay attention to warning messages
   \-remap filename      transform image colors to match this set of colors
@@ -109,6 +109,7 @@ Image Settings:
                        virtual pixel access method
   \-weight type         render text with this font weight
   \-white-point point   chromaticity white point
+  \-write-mask filename associate a write mask with the image
 
 Image Operators:
   \-adaptive-blur geometry
index e338ae5a7099ba2c2cad489e9b4e102e201df4cc..b8aa8a4ae1556426b5bd268b2890eed743aecccd 100644 (file)
@@ -62,7 +62,6 @@ Image Settings:
   \-label string        assign a label to an image
   \-limit type value    pixel cache resource limit
   \-loop iterations     add Netscape loop extension to your GIF animation
-  \-mask filename       associate a mask with the image
   \-matte               store matte channel if the image has one
   \-mattecolor color    frame color
   \-metric type         measure differences between images with this metric
@@ -80,6 +79,7 @@ Image Settings:
   \-preview type        image preview type
   \-quality value       JPEG/MIFF/PNG compression level
   \-quiet               suppress all warning messages
+  \-read-mask filename  associate a read mask with the image
   \-red-primary point   chromaticity red primary point
   \-regard-warnings     pay attention to warning messages
   \-remap filename      transform image colors to match this set of colors
@@ -109,6 +109,7 @@ Image Settings:
                        virtual pixel access method
   \-weight type         render text with this font weight
   \-white-point point   chromaticity white point
+  \-write-mask filename associate a write mask with the image
 
 Image Operators:
   \-adaptive-blur geometry