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