private void ExecuteCannyEdge(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "lower")
arguments["lower"] = Variables.GetValue<Percentage>(attribute);
else if (attribute.Name == "radius")
arguments["radius"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "sigma")
arguments["sigma"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "upper")
arguments["upper"] = Variables.GetValue<Percentage>(attribute);
}
if (arguments.Count == 0)
image.CannyEdge();
else if (OnlyContains(arguments, "radius", "sigma", "lower", "upper"))
image.CannyEdge((double)arguments["radius"], (double)arguments["sigma"], (Percentage)arguments["lower"], (Percentage)arguments["upper"]);
else
throw new ArgumentException("Invalid argument combination for 'cannyEdge', allowed combinations are: [] [radius, sigma, lower, upper]");
}
private void ExecuteCharcoal(XmlElement element, MagickImage image)