public SeaShellEffect() { m_hueSaturationEffect = new HueSaturationEffect() { Saturation = 0.6 -1 }; m_vibranceEffect = new VibranceEffect() { Level = .6 }; m_splitToningEffect = new SplitToneEffect { ShadowsHue = 230, ShadowsSaturation = 37, HighlightsHue = 50, HighlightsSaturation = 20 }; var globalCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(0, 10), new Point(32, 68), new Point(64, 119), new Point(96, 158), new Point(128, 187), new Point(160, 209), new Point(192, 226), new Point(255, 248) }); var curve = new Curve(CurveInterpolation.Linear, new[] { new Point(10, 0), new Point(32, 27), new Point(70, 70) }); var redCurve = globalCurve; var greenCurve = Curve.Compose(curve, globalCurve, null); var blueCurve = globalCurve; var curvesEffect = new CurvesEffect(redCurve, greenCurve, blueCurve); var colorizationLayerList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect()), new Layer(LayerStyle.Multiply(), context => new ColorImageSource(context.HintedRenderSize, Color.FromArgb(0xff, 0xff, 0xe6, 0x99))) ); LayerList.AddRange( new AdjustmentLayer(LayerStyle.Normal(0.2), context => colorizationLayerList.ToImageProvider(context.BackgroundImage, context.HintedRenderSize, context.HintedRenderSize)), new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(-0.15)), new AdjustmentLayer(LayerStyle.Normal(), curvesEffect), new AdjustmentLayer(LayerStyle.Normal(), m_hueSaturationEffect), new AdjustmentLayer(LayerStyle.Normal(), m_vibranceEffect), new AdjustmentLayer(LayerStyle.Normal(), m_splitToningEffect) ); Editors.Add(new RangeEditorViewModel<SeaShellEffect>("SaturationLevel", -1.0, 1.0, this, filter => filter.SaturationLevel, (filter, value) => filter.SaturationLevel = value)); // Editors.Add(new RangeEditorViewModel<SeaShellEffect>("ContrastLevel", -1.0, 1.0, this, filter => filter.ContrastLevel, (filter, value) => filter.ContrastLevel = value)); Editors.Add(new RangeEditorViewModel<SeaShellEffect>("VibranceLevel", 0, 1.0, this, filter => filter.VibranceLevel, (filter, value) => filter.VibranceLevel = value)); Editors.Add(new RangeEditorViewModel<SeaShellEffect>("ShadowsHue", 0, 365, this, filter => filter.ShadowsHue, (filter, value) => filter.ShadowsHue = (int)value)); Editors.Add(new RangeEditorViewModel<SeaShellEffect>("ShadowsSaturation", 0, 100, this, filter => filter.ShadowsSaturation, (filter, value) => filter.ShadowsSaturation = (int)value)); Editors.Add(new RangeEditorViewModel<SeaShellEffect>("HighlightsHue", 0, 365, this, filter => filter.HighlightsHue, (filter, value) => filter.HighlightsHue = (int)value)); Editors.Add(new RangeEditorViewModel<SeaShellEffect>("HighlightsSaturation", 0, 100, this, filter => filter.HighlightsSaturation, (filter, value) => filter.HighlightsSaturation = (int)value)); }
public OldPosterEffect() { // Curves var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(38, 17), new Point(160, 210), new Point(231, 250), new Point(255, 255) } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Poster2.png", "ms-appx:///images/Filters_Portrait_Overlay_Poster2.png", "ms-appx:///images/Filters_Square_Overlay_Poster2.png"); LayerList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new Layer(LayerStyle.Multiply(), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255, 255, 167, 151))), new Layer(LayerStyle.Normal(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) ); }
protected CreativeStudioEffect() { CanRenderAtPreviewSize = false; Lookups.Preload(); LayerList = new LayerList(); EffectCategory = EffectCategoryEnum.CreativeStudio; }
public PopEffect() { var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(68, 60), new Point(144, 163), new Point(255, 255), } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Pop3.png", "ms-appx:///images/Filters_Portrait_Overlay_Pop3.png", "ms-appx:///images/Filters_Square_Overlay_Pop3.png"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(1.0)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new AdjustmentLayer(LayerStyle.Normal(), new LevelsEffect(0.7, 0.7 / 2, 0)), new Layer(LayerStyle.Screen(1.0), context => new ColorImageSource(context.HintedRenderSize, Color.FromArgb(255, 108, 0, 148))), new Layer(LayerStyle.Lighten(), context => overlayFactory.CreateAsync(context.HintedRenderSize)) }; }
public DreamEffect() { Name = "Dream"; var diagonalGradient = new LinearGradient { StartPoint = new Point(0.0, 0.0), EndPoint = new Point(1.0, 1.0), Stops = new[] { new GradientStop {Offset = 0, Color = Color.FromArgb(255, 133, 147, 201)}, new GradientStop {Offset = 1.0, Color = Color.FromArgb(255, 245, 152, 157)} } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Dream.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Dream.jpg", "ms-appx:///images/Filters_Square_Overlay_Dream.jpg"); LayerList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), new LevelsEffect(0.75, 0.85, 0.15)), new Layer(LayerStyle.Softlight(), context => new GradientImageSource(context.BackgroundLayer.ImageSize, diagonalGradient)), new Layer(LayerStyle.Overlay(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) ); }
public FantasticEffect() { var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(68, 60), new Point(144, 163), new Point(255, 255), } }; var overlayFactory1 = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Fantastic1.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Fantastic1.jpg", "ms-appx:///images/Filters_Square_Overlay_Fantastic1.jpg"); var overlayFactory2 = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Fantastic2.png", "ms-appx:///images/Filters_Portrait_Overlay_Fantastic2.png", "ms-appx:///images/Filters_Square_Overlay_Fantastic2.png"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(1.0)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new Layer(LayerStyle.Softlight(), context => overlayFactory1.CreateAsync(context.BackgroundLayer.ImageSize)), new Layer(LayerStyle.Normal(), context => overlayFactory2.CreateAsync(context.BackgroundLayer.ImageSize)) }; }
public BWEffect() { var curvesEffect = new CurvesEffect(new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0,0), new Point(41, 59), new Point(112, 146), new Point(189, 211), new Point(255, 255), } }); m_lomoStack = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new LomoEffect(0.3, 0.0, LomoVignetting.High, LomoStyle.Neutral)) }; LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), curvesEffect), new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect()), new AdjustmentLayer(LayerStyle.Normal(), new SharpnessEffect(0.15)), new Layer(LayerStyle.Hardlight(0.1), context => m_lomoStack.ToImageProvider(context.BackgroundImage, context.HintedRenderSize)) }; }
public void FindDependenciesRecursive(LayerList registryLayers) { foreach (var section in _slice.Sections.Where(s => s.SectionType == SliceSection.Type.DEP)) { foreach (var line in section.Lines) { var semName = new SemName(line); var dep = registryLayers.FindLayer(semName.NamePart); if (dep != null) { Dependencies.Add(dep); dep.FindDependenciesRecursive(registryLayers); } } } if (Dependencies.Count == 0) { foreach (var section in _slice.Sections.Where(s => s.SectionType == SliceSection.Type.OS)) { foreach (var line in section.Lines) { var semName = new SemName(line); if (semName.NamePart != Name) { var os = registryLayers.FindLayer(semName.NamePart); if (os != null) { Dependencies.Add(os); } } } } } }
public void LayerListCanBeCreatedWithLayers() { var layerList = new LayerList(new Layer[] { new Layer(LayerStyle.Add(0.5), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255,128,128,128))), new AdjustmentLayer(LayerStyle.Normal(), new BrightnessEffect(0.9)) }); }
public QuartzEffect() { m_cachingEffect = new CachingEffect(); var curve = new Curve(); curve.SetPoint(16, 7); curve.SetPoint(39, 24); curve.SetPoint(208, 223); curve.SetPoint(234, 247); var positiveBrightnessCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(48, 124), new Point(64, 162), new Point(80, 193), new Point(96, 214), new Point(112, 229), new Point(128, 239), new Point(144, 245), new Point(160, 249), new Point(192, 253), new Point(240, 255) }); var negativeBrightnessCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(160, 63), new Point(192, 79), new Point(208, 90), new Point(224, 106), new Point(236, 123), new Point(244, 141), new Point(248, 156), new Point(252, 183) }); var brightnessCurve = Curve.Interpolate(new Curve(), positiveBrightnessCurve, 0.1, null); var clarityList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), m_cachingEffect), new AdjustmentLayer(LayerStyle.Softlight(), new SDKTestApp_Native.HighpassEffect(100, true, 8)) ); LayerList.AddRange( new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(curve)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(brightnessCurve)), // Clarity new Layer(LayerStyle.Darken(), context => clarityList.ToImageProvider(context.BackgroundImage, context.HintedRenderSize)), new AdjustmentLayer(LayerStyle.Normal(), new HueSaturationEffect(0, 0.65-1)), new AdjustmentLayer(LayerStyle.Normal(), new VibranceEffect() { Level = 0.1 }), new AdjustmentLayer(LayerStyle.Normal(), new SDKTestApp_Native.SplitToneEffect() { HighlightsSaturation = 42, HighlightsHue = 45 }) ); }
public LightEffect() { var globalCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(0, 0), new Point(41, 59), new Point(112, 146), new Point(189, 211), new Point(255, 255) }); var redCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(18, 0), new Point(126, 116), new Point(255, 228), }); Curve.Compose(redCurve, globalCurve, redCurve); var greenCurve = globalCurve; var blueCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(0, 44), new Point(113, 138), new Point(230, 255), }); Curve.Compose(blueCurve, globalCurve, blueCurve); var gradient = new RadialGradient { EllipseRadius = new EllipseRadius(1.5, 0), CenterPoint = new Point(0.5, 0.5), Stops = new[] { new GradientStop {Offset = 0, Color = Color.FromArgb(0, 0, 0, 0)}, new GradientStop {Offset = 1, Color = Color.FromArgb(255, 255, 255, 255)} } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Light.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Light.jpg", "ms-appx:///images/Filters_Square_Overlay_Light.jpg"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(0.2), new CurvesEffect(redCurve, greenCurve, blueCurve)), new Layer(LayerStyle.Softlight(0.3), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255, 200, 200, 200))), new Layer(LayerStyle.Softlight(0.7), context => new GradientImageSource(context.BackgroundLayer.ImageSize, gradient)), new Layer(LayerStyle.Screen(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) }; }
public FreshEffect() { var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(167, 195), new Point(255, 255), } }; var redCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 19), new Point(147, 116), new Point(184, 184), new Point(255, 255) } }; var greenCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(142, 133), new Point(183, 183), new Point(255, 255) } }; var blueCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(155, 130), new Point(205, 181), new Point(255, 255) } }; LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(0.2)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Darken(), new CurvesEffect(redCurve, greenCurve, blueCurve)) }; }
public virtual void FindDependenciesRecursive(LayerList layerList) { foreach (var depInfo in Slice.DepInfos) { var layer = layerList.FindLayer(depInfo); if (!Dependencies.Contains(layer)) Dependencies.Add(layer); } foreach (var dep in Dependencies) { dep.FindDependenciesRecursive(layerList); } }
public virtual Layer MakeLayer() { var layerParams = Args.GetLayerParams(); var osParam = Args.GetOsParam(); var list = new List<Slice>(); var dirList = new SliceDirectoryList(Args.SlicesDir); dirList.ForEach(dir => list.AddRange(dir.FindByOs(osParam))); var layers = new LayerList(list); var layer = layers.FindLayer(layerParams[0]); //todo: check layer found and has good dependencies return layer; }
public MintEffect() { var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(167, 195), } }; var redCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(106, 50), new Point(160, 163), new Point(255, 255) } }; var greenCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(74, 96), new Point(255, 255) } }; var blueCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(49, 84), new Point(205, 168), new Point(255, 255) } }; LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(0.2)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Normal(0.5), new CurvesEffect(redCurve, greenCurve, blueCurve)) }; }
/// <summary> /// Finds all slices requested on the cmd line and /// build the layers into a list /// </summary> /// <returns></returns> protected virtual LayerList BuildLayers() { var layerParams = Args.GetLayerParams(); var osParam = Args.GetOsParam(); var layerInfos = layerParams.Select(layerParam => new SemVerInfo(layerParam)).ToList(); var osInfo = new SemVerInfo(osParam); var dirList = new SliceDirectoryList(Args.SlicesDir, Args.VersionInfo.FileMajorPart); var sliceList = dirList.Scan(osInfo); sliceList.CheckDepInfos(); var layerList = new LayerList(sliceList, layerInfos, osInfo); return layerList; }
/// <summary> /// Finds all versions of requested layers for specific OS and lists them. /// </summary> void ICommand.Run() { var layerParams = Args.GetLayerParams(); var osParam = Args.GetOsParam(); var list = new List<Slice>(); var dirList = new SliceDirectoryList(Args.SlicesDir); dirList.ForEach(dir => list.AddRange(dir.FindByOs(osParam))); var layers = new LayerList(list).FindLayers(layerParams); foreach (var layer in layers) { Console.WriteLine(layer.Name); } }
/// <summary> /// All missing layers in the registry /// </summary> /// <param name="layerList"></param> protected virtual void ReportAllMissing(LayerList layerList) { Console.WriteLine(); if (layerList.SliceList.MissingInfos.Count == 0) { Console.WriteLine("All Missing: None"); } else { Console.WriteLine("All Missing:"); foreach (var info in layerList.SliceList.MissingInfos) { Console.WriteLine(info.Name); } } }
public ElegantEffect() { var globalCurve = new Curve(CurveInterpolation.Linear) { Points = new[] { new Point(0, 0), new Point(52, 78), new Point(168,195), new Point(255, 255) } }; LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(0.6), new HueSaturationEffect(0, -0.3)), new AdjustmentLayer(LayerStyle.Normal(0.6), new CurvesEffect(globalCurve)) }; }
public BoldEffect() { var curvesEffect = new CurvesEffect(new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(69, 66), new Point(212, 218), new Point(255, 255) } }); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), curvesEffect), new AdjustmentLayer(LayerStyle.Hardlight(), new SDKTestApp_Native.HighpassEffect(8,false,0)), new AdjustmentLayer(LayerStyle.Normal(0.2), new HueSaturationEffect(-0.4, -1.0)) }; }
public VintageEffect() { var globalCurve = new Curve { Points = new[] { new Point(0,0), new Point(41, 59), new Point(112, 146), new Point(189, 211), new Point(255, 255), } }; LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Normal(0.8), new AntiqueEffect()), new AdjustmentLayer(LayerStyle.Softlight(0.4), new LevelsEffect(145 / 255.0, (145 + 80) / 2.0 / 255.0, 80 / 255.0)) }; }
public BWBoldEffect() { var curvesEffect = new CurvesEffect(new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(69, 66), new Point(212, 218), new Point(255, 255) } }); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect()), new AdjustmentLayer(LayerStyle.Normal(), curvesEffect), new AdjustmentLayer(LayerStyle.Normal(), new SharpnessEffect(0.1)), new AdjustmentLayer(LayerStyle.Hardlight(), new SDKTestApp_Native.HighpassEffect(15, false, 2)) }; }
public GlamMeEffect() { EffectCategory = EffectCategoryEnum.GlamMe; var redCurve = new Curve(CurveInterpolation.Linear); var greenCurve = new Curve(CurveInterpolation.Linear) { Points = new[] { new Point(0, 0), new Point(69, 66), new Point(163, 170), new Point(255, 255), } }; var blueCurve = new Curve(CurveInterpolation.Linear) { Points = new[] { new Point(0, 0), new Point(76, 72), new Point(156, 161), new Point(255, 255), } }; LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new LevelsEffect(232.0 / 255.0, 119.0 / 255.0, 6.0 / 255.0)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(redCurve, greenCurve, blueCurve)), new AdjustmentLayer(LayerStyle.Normal(), new VibranceEffect() { Level = 0.13 }), new AdjustmentLayer(LayerStyle.Normal(), new ExposureEffect(ExposureMode.Gamma, 1.0 - 0.92)), new AdjustmentLayer(LayerStyle.Normal(), new SharpnessEffect(0.1)) }; }
public OpalEffect() { m_cachingEffect = new CachingEffect(); var clarityList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), m_cachingEffect), new AdjustmentLayer(LayerStyle.Softlight(), new SDKTestApp_Native.HighpassEffect(100, true, 8)) ); m_selectiveColorEffect = new SelectiveColorEffect { Red = new CMYK {Yellow = 5}, Yellow = new CMYK {Yellow = 40, Key = 15}, Green = new CMYK {Cyan = 20, Yellow = 20, Key = 30}, Cyan = new CMYK {Key = 61}, Blue = new CMYK {Key = 30} }; LayerList.AddRange( // Clarity new Layer(LayerStyle.Darken(0.5), context => clarityList.ToImageProvider(context.BackgroundImage, context.HintedRenderSize)), new AdjustmentLayer(LayerStyle.Normal(), m_selectiveColorEffect), new AdjustmentLayer(LayerStyle.Normal(), new HueSaturationEffect(0.0, 0.06)), new AdjustmentLayer(LayerStyle.Normal(), new VibranceEffect() { Level = 0.1 }), new Layer(LayerStyle.Overlay(), context => new ColorImageSource(context.HintedRenderSize, Color.FromArgb(0xFF, 0xFF, 0xE6, 0x99))) ); /* Editors.Add(new RangeEditorViewModel<OpalEffect>("SaturationLevel", -1.0, 1.0, this, filter => filter.SaturationLevel, (filter, value) => filter.SaturationLevel = value)); // Editors.Add(new RangeEditorViewModel<OpalEffect>("ContrastLevel", -1.0, 1.0, this, filter => filter.ContrastLevel, (filter, value) => filter.ContrastLevel = value)); Editors.Add(new RangeEditorViewModel<OpalEffect>("VibranceLevel", 0, 1.0, this, filter => filter.VibranceLevel, (filter, value) => filter.VibranceLevel = value)); Editors.Add(new RangeEditorViewModel<OpalEffect>("ShadowsHue", 0, 365, this, filter => filter.ShadowsHue, (filter, value) => filter.ShadowsHue = (int)value)); Editors.Add(new RangeEditorViewModel<OpalEffect>("ShadowsSaturation", 0, 100, this, filter => filter.ShadowsSaturation, (filter, value) => filter.ShadowsSaturation = (int)value)); Editors.Add(new RangeEditorViewModel<OpalEffect>("HighlightsHue", 0, 365, this, filter => filter.HighlightsHue, (filter, value) => filter.HighlightsHue = (int)value)); Editors.Add(new RangeEditorViewModel<OpalEffect>("HighlightsSaturation", 0, 100, this, filter => filter.HighlightsSaturation, (filter, value) => filter.HighlightsSaturation = (int)value)); */ }
public Page(double width, double height) { if (width < 0) { throw new System.ArgumentOutOfRangeException("width"); } if (height < 0) { throw new System.ArgumentOutOfRangeException("height"); } this.Shapes = new ShapeList(this); this.Connects = new List<Connect>(); this.PageProperties = new Sections.PageProperties(); this.PageProperties.PageWidth.Result = width; this.PageProperties.PageHeight.Result = height; this.PrintProperties = new Sections.PrintProperties(); this.PageLayout = new Sections.PageLayout(); this._id = Page.idgen.GetNextID(); var culture = System.Globalization.CultureInfo.InvariantCulture; this.Name = string.Format(culture, "Page-{0}", this._id + 1); this.Layers = new LayerList(); }
public BasicModel(Globe globe, LayerList layers) { this.setGlobe(globe); this.setLayers(layers != null ? layers : new LayerList(/*empty list*/)); // an empty list is ok }
internal DappleModel(LayerList oTarget) { m_oViewedDatasets = new ViewedDatasetsModel(oTarget); m_oRootNode = new AvailableServersModelNode(this); m_oSelectedNode = m_oRootNode; }
/// <summary> /// Removes all layers /// </summary> public void RemoveAllLayers() { LayerList.Clear(); }
public void LayerListCanBeCreatedWithBackgroundImageAndLayers() { var backgroundImage = new ColorImageSource(new Size(100, 100), Colors.AliceBlue); var layerList = new LayerList(backgroundImage, backgroundImage.ImageSize, new Layer[] { new Layer(LayerStyle.Add(0.5), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255,128,128,128))), new AdjustmentLayer(LayerStyle.Normal(), new BrightnessEffect(0.9)) }); }
public void LayerListCanBeCreatedWithBackgroundImage() { var backgroundImage = new ColorImageSource(new Size(100, 100), Colors.AliceBlue); var layerList = new LayerList(backgroundImage, backgroundImage.ImageSize); }
internal ViewedDatasetsModel(LayerList oTarget) { m_oLayerList = oTarget; }
public void LayerListCanBeCreated() { var layerList = new LayerList(); }
public async Task ImageProviderTopology() { var backgroundImage = new ColorImageSource(new Size(100, 100), Color.FromArgb(255, 128, 128, 128)); var layerList = new LayerList(backgroundImage, backgroundImage.ImageSize, new Layer[] { new Layer(LayerStyle.Multiply(), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255,32,16,8))), new AdjustmentLayer(LayerStyle.Screen(0.5), new ContrastEffect(0.7)), new AdjustmentLayer(LayerStyle.Normal(), new BrightnessEffect(0.7)), new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect()) }); var layersEffect = await layerList.ToImageProvider(new Size(50,50)).AsTask(); var chain = GetChain(layersEffect); Assert.AreEqual(5, chain.Count); Assert.AreSame(backgroundImage, chain.FirstOrDefault()); Assert.IsInstanceOfType(chain[1],typeof(BlendEffect)); // Layer with ColorImageSource Assert.IsInstanceOfType(((BlendEffect)chain[1]).ForegroundSource, typeof(ColorImageSource)); Assert.IsInstanceOfType(chain[2], typeof(BlendEffect)); Assert.IsInstanceOfType(((BlendEffect)chain[2]).ForegroundSource, typeof(ContrastEffect)); Assert.IsInstanceOfType(chain[3], typeof(BrightnessEffect)); Assert.IsInstanceOfType(chain[4], typeof(GrayscaleEffect)); }
public async Task RenderWithBackgroundAndDifferentRenderSizePassedInToImageProvider() { var layerList = new LayerList(new Layer[] { new Layer(LayerStyle.Add(), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255,32,16,8))) }); var backgroundImage = new ColorImageSource(new Size(100, 100), Color.FromArgb(255, 128, 128, 128)); var layersEffect = await layerList.ToImageProvider(backgroundImage, backgroundImage.ImageSize, new Size(50,50)).AsTask(); var bitmap = new Bitmap(new Size(50,50), ColorMode.Bgra8888); var bitmapRenderer = new BitmapRenderer(layersEffect, bitmap); var renderedBitmap = await bitmapRenderer.RenderAsync(); var pixels = bitmap.Buffers[0].Buffer.ToArray(); Assert.AreEqual(136, pixels[0]); Assert.AreEqual(144, pixels[1]); Assert.AreEqual(160, pixels[2]); Assert.AreEqual(255, pixels[3]); }
/// <summary> /// Removes the layer at the specified index /// </summary> /// <param name="index"></param> public void RemoveLayerAt(int index) { LayerList.RemoveAt(index); }
/// <summary> /// Removes a layer from the layer list /// </summary> /// <param name="name">Name of layer to remove</param> public void RemoveLayer(string name) { LayerList.Remove(name); }