private static State <FilterChainState, XElementBuilder> BuildFloodGenerator(Color color) => XElementBuilder.WithName("feFlood") .Add( new XAttribute("flood-color", SvgColorFactory.SvgColor(color)), new XAttribute("flood-opacity", SvgColorFactory.SvgOpacity(color)) ) .Pipe(BuildOutputOnlyFilter);
private static State <FilterChainState, IEnumerable <XElement> > BuildSpecularLightingGenerator(SpecularLightingGenerator specularLightingGenerator, CoordinatesConverter converter) => XElementBuilder.WithName("feSpecularLighting") .Add( new XAttribute("surfaceScale", specularLightingGenerator.SurfaceScale), new XAttribute("specularConstant", specularLightingGenerator.SpecularConstant), new XAttribute("specularExponent", specularLightingGenerator.SpecularExponent), new XAttribute("lighting-color", SvgColorFactory.SvgColor(specularLightingGenerator.LightColor))) .Add(BuildLightComponent(specularLightingGenerator.Light, converter)) .Pipe(BuildOutputOnlyFilter) .Select(x => new[] { x.Build() }.AsEnumerable());
private static State <FilterChainState, IEnumerable <XElement> > BuildDiffuseLightingGenerator( DiffuseLightingGenerator diffuseLightingGenerator, CoordinatesConverter converter) { XElement lightComponent = diffuseLightingGenerator.Light.Pipe(x => BuildLightComponent(x, converter)); var elementCore = XElementBuilder.WithName("feDiffuseLighting") .Add( new XAttribute("lighting-color", SvgColorFactory.SvgColor(diffuseLightingGenerator.LightColor)), new XAttribute("surfaceScale", diffuseLightingGenerator.SurfaceScale), new XAttribute("diffuseConstant", diffuseLightingGenerator.DiffuseConstant)) .Add(lightComponent); return(BuildIOFilter(elementCore).Select(x => x.Build()).Select(x => new[] { x }.AsEnumerable())); }