private void ExecuteBlackThreshold(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 == "threshold")
arguments["threshold"] = Variables.GetValue<Percentage>(attribute);
}
if (OnlyContains(arguments, "threshold"))
image.BlackThreshold((Percentage)arguments["threshold"]);
else if (OnlyContains(arguments, "threshold", "channels"))
image.BlackThreshold((Percentage)arguments["threshold"], (Channels)arguments["channels"]);
else
throw new ArgumentException("Invalid argument combination for 'blackThreshold', allowed combinations are: [threshold] [threshold, channels]");
}
private void ExecuteBlueShift(XmlElement element, MagickImage image)