private void ExecuteBrightnessContrast(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "brightness")
arguments["brightness"] = Variables.GetValue<Percentage>(attribute);
else if (attribute.Name == "channels")
arguments["channels"] = Variables.GetValue<Channels>(attribute);
else if (attribute.Name == "contrast")
arguments["contrast"] = Variables.GetValue<Percentage>(attribute);
}
if (OnlyContains(arguments, "brightness", "contrast"))
image.BrightnessContrast((Percentage)arguments["brightness"], (Percentage)arguments["contrast"]);
else if (OnlyContains(arguments, "brightness", "contrast", "channels"))
image.BrightnessContrast((Percentage)arguments["brightness"], (Percentage)arguments["contrast"], (Channels)arguments["channels"]);
else
throw new ArgumentException("Invalid argument combination for 'brightnessContrast', allowed combinations are: [brightness, contrast] [brightness, contrast, channels]");
}
private void ExecuteCannyEdge(XmlElement element, MagickImage image)