private static State <FilterChainState, XElement> BuildDropShadowFilter(DropShadowFilter filter, CoordinatesConverter converter) { var svgVector = filter.ShadowVector.Pipe(converter.ToSvgVector); var element = XElementBuilder.WithName("feDropShadow").Add( new XAttribute("dx", svgVector.Dx), new XAttribute("dy", svgVector.Dy), new XAttribute("stdDeviation", converter.ScaleDistance(filter.StdDeviation))); return(element.Pipe(BuildIOFilter).Select(x => x.Build())); }
public static void AreEqual(DropShadowFilter expected, DropShadowFilter actual, string message) { Assert.AreEqual(expected.BlurX, actual.BlurX, message + ".BlurX"); Assert.AreEqual(expected.BlurY, actual.BlurY, message + ".BlurY"); AssertColors.AreEqual(expected.Color, actual.Color, message + ".Color"); Assert.AreEqual(expected.CompositeSource, actual.CompositeSource); Assert.AreEqual(expected.InnerShadow, actual.InnerShadow); Assert.AreEqual(expected.Knockout, actual.Knockout); Assert.AreEqual(expected.Passes, actual.Passes); Assert.AreEqual(expected.Strength, actual.Strength); Assert.AreEqual(expected.Angle, actual.Angle); Assert.AreEqual(expected.Distance, actual.Distance); }
static Filter ReadConcreteFilter(DropShadowFilter filter, SwfStreamReader reader) { filter.DropShadowColor = SwfColor.Read(reader, true); filter.BlurX = reader.ReadFixedPoint_16_16(); filter.BlurY = reader.ReadFixedPoint_16_16(); filter.Angle = reader.ReadFixedPoint_16_16(); filter.Distance = reader.ReadFixedPoint_16_16(); filter.Strength = reader.ReadFixedPoint_8_8(); filter.InnerShadow = reader.ReadBit(); filter.Knockout = reader.ReadBit(); filter.CompositeSource = reader.ReadBit(); filter.Passes = reader.ReadUnsignedBits(5); return(filter); }
public static XElement ToXml(DropShadowFilter filter) { return new XElement(TAG_NAME, new XAttribute("angle", CommonFormatter.Format(filter.Angle)), new XAttribute("blurX", CommonFormatter.Format(filter.BlurX)), new XAttribute("blurY", CommonFormatter.Format(filter.BlurY)), new XAttribute("distance", CommonFormatter.Format(filter.Distance)), new XAttribute("innerShadow", CommonFormatter.Format(filter.InnerShadow)), new XAttribute("knockout", CommonFormatter.Format(filter.Knockout)), new XAttribute("compositeSource", CommonFormatter.Format(filter.CompositeSource)), new XAttribute("passes", filter.Passes), new XAttribute("strength", CommonFormatter.Format(filter.Strength)), new XElement("color", XColorRGBA.ToXml(filter.Color)) ); }
public static XElement ToXml(DropShadowFilter filter) { return(new XElement(TAG_NAME, new XAttribute("angle", CommonFormatter.Format(filter.Angle)), new XAttribute("blurX", CommonFormatter.Format(filter.BlurX)), new XAttribute("blurY", CommonFormatter.Format(filter.BlurY)), new XAttribute("distance", CommonFormatter.Format(filter.Distance)), new XAttribute("innerShadow", CommonFormatter.Format(filter.InnerShadow)), new XAttribute("knockout", CommonFormatter.Format(filter.Knockout)), new XAttribute("compositeSource", CommonFormatter.Format(filter.CompositeSource)), new XAttribute("passes", filter.Passes), new XAttribute("strength", CommonFormatter.Format(filter.Strength)), new XElement("color", XColorRGBA.ToXml(filter.Color)) )); }
public XElement Visit(DropShadowFilter filter, object arg) { return(XDropShadowFilter.ToXml(filter)); }