private void ExecuteLevelColors(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "blackColor")
arguments["blackColor"] = Variables.GetValue<MagickColor>(attribute);
else if (attribute.Name == "channels")
arguments["channels"] = Variables.GetValue<Channels>(attribute);
else if (attribute.Name == "whiteColor")
arguments["whiteColor"] = Variables.GetValue<MagickColor>(attribute);
}
if (OnlyContains(arguments, "blackColor", "whiteColor"))
image.LevelColors((MagickColor)arguments["blackColor"], (MagickColor)arguments["whiteColor"]);
else if (OnlyContains(arguments, "blackColor", "whiteColor", "channels"))
image.LevelColors((MagickColor)arguments["blackColor"], (MagickColor)arguments["whiteColor"], (Channels)arguments["channels"]);
else
throw new ArgumentException("Invalid argument combination for 'levelColors', allowed combinations are: [blackColor, whiteColor] [blackColor, whiteColor, channels]");
}
private void ExecuteLinearStretch(XmlElement element, MagickImage image)