private void ExecuteFx(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "channels")
arguments["channels"] = Variables.GetValue<Channels>(attribute);
else if (attribute.Name == "expression")
arguments["expression"] = Variables.GetValue<String>(attribute);
}
if (OnlyContains(arguments, "expression"))
image.Fx((String)arguments["expression"]);
else if (OnlyContains(arguments, "expression", "channels"))
image.Fx((String)arguments["expression"], (Channels)arguments["channels"]);
else
throw new ArgumentException("Invalid argument combination for 'fx', allowed combinations are: [expression] [expression, channels]");
}
private void ExecuteGammaCorrect(XmlElement element, MagickImage image)