private void ExecuteNegate(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "channels")
arguments["channels"] = Variables.GetValue<Channels>(attribute);
else if (attribute.Name == "onlyGrayscale")
arguments["onlyGrayscale"] = Variables.GetValue<Boolean>(attribute);
}
if (arguments.Count == 0)
image.Negate();
else if (OnlyContains(arguments, "channels"))
image.Negate((Channels)arguments["channels"]);
else if (OnlyContains(arguments, "onlyGrayscale"))
image.Negate((Boolean)arguments["onlyGrayscale"]);
else if (OnlyContains(arguments, "onlyGrayscale", "channels"))
image.Negate((Boolean)arguments["onlyGrayscale"], (Channels)arguments["channels"]);
else
throw new ArgumentException("Invalid argument combination for 'negate', allowed combinations are: [] [channels] [onlyGrayscale] [onlyGrayscale, channels]");
}
private static void ExecuteNormalize(MagickImage image)