private void ExecuteModulate(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
arguments[attribute.Name] = Variables.GetValue<Percentage>(attribute);
}
if (OnlyContains(arguments, "brightness"))
image.Modulate((Percentage)arguments["brightness"]);
else if (OnlyContains(arguments, "brightness", "saturation"))
image.Modulate((Percentage)arguments["brightness"], (Percentage)arguments["saturation"]);
else if (OnlyContains(arguments, "brightness", "saturation", "hue"))
image.Modulate((Percentage)arguments["brightness"], (Percentage)arguments["saturation"], (Percentage)arguments["hue"]);
else
throw new ArgumentException("Invalid argument combination for 'modulate', allowed combinations are: [brightness] [brightness, saturation] [brightness, saturation, hue]");
}
private void ExecuteMorphology(XmlElement element, MagickImage image)