private void ExecuteSolarize(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "factor")
arguments["factor"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "factorPercentage")
arguments["factorPercentage"] = Variables.GetValue<Percentage>(attribute);
}
if (arguments.Count == 0)
image.Solarize();
else if (OnlyContains(arguments, "factor"))
image.Solarize((double)arguments["factor"]);
else if (OnlyContains(arguments, "factorPercentage"))
image.Solarize((Percentage)arguments["factorPercentage"]);
else
throw new ArgumentException("Invalid argument combination for 'solarize', allowed combinations are: [] [factor] [factorPercentage]");
}
private void ExecuteSparseColor(XmlElement element, MagickImage image)