Exemplo n.º 1
0
        public NeonEffect()
        {
            var saturationLightnessEffect = new SaturationLightnessEffect(null, new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(0, 36),
                new Point(45, 60),
                new Point(104, 146),
                new Point(197, 207),
                new Point(255, 245)
            }));


            var hslEffect = new HueSaturationLightnessEffect
            {
                SaturationCurve = PhotoshopAlike.CreateCurveFromHueRangeAdjustments(
                    new PhotoshopAlike.HueRangeAdjustment(0, 60),
                    new PhotoshopAlike.HueRangeAdjustment(1, -5),
                    new PhotoshopAlike.HueRangeAdjustment(2, -7),
                    new PhotoshopAlike.HueRangeAdjustment(3, -10),
                    new PhotoshopAlike.HueRangeAdjustment(5, 25),
                    new PhotoshopAlike.HueRangeAdjustment(6, 22))
            };


            LayerList.AddRange(
                new AdjustmentLayer(LayerStyle.Normal(), saturationLightnessEffect),
                new AdjustmentLayer(LayerStyle.Normal(), Lookups.NeonCurvesEffect),
                new AdjustmentLayer(LayerStyle.Normal(), hslEffect),
                new AdjustmentLayer(LayerStyle.Normal(), context => new CachingEffect()),
                new AdjustmentLayer(LayerStyle.Softlight(0.75), context => new SDKTestApp_Native.HighpassEffect(32, false, 8))
                );
        }
Exemplo n.º 2
0
        public NeonEffect()
        {
            var saturationLightnessEffect = new SaturationLightnessEffect(null, new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(0, 36),
                new Point(45, 60),
                new Point(104, 146),
                new Point(197, 207),
                new Point(255, 245)
            }));

         
            var hslEffect = new HueSaturationLightnessEffect
            {
                SaturationCurve = PhotoshopAlike.CreateCurveFromHueRangeAdjustments(
                    new PhotoshopAlike.HueRangeAdjustment(0, 60),
                    new PhotoshopAlike.HueRangeAdjustment(1, -5),
                    new PhotoshopAlike.HueRangeAdjustment(2, -7),
                    new PhotoshopAlike.HueRangeAdjustment(3, -10),
                    new PhotoshopAlike.HueRangeAdjustment(5, 25),
                    new PhotoshopAlike.HueRangeAdjustment(6, 22))
            };

            
            LayerList.AddRange(
                 new AdjustmentLayer(LayerStyle.Normal(), saturationLightnessEffect),
                new AdjustmentLayer(LayerStyle.Normal(), Lookups.NeonCurvesEffect),
				new AdjustmentLayer(LayerStyle.Normal(), hslEffect),
                new AdjustmentLayer(LayerStyle.Normal(), context => new CachingEffect()),
                new AdjustmentLayer(LayerStyle.Softlight(0.75), context => new SDKTestApp_Native.HighpassEffect(32, false, 8))
            );
        }
Exemplo n.º 3
0
        public HslAdjustmentEffect()
        {
            m_saturation = new int[ChannelCount];
            m_lightness  = new int[ChannelCount];

            m_filtersWithoutMasterLightness = new HueSaturationLightnessEffect();
            m_masterLightnessCurve          = new Curve(CurveInterpolation.Linear);
            m_allEffects = new CurvesEffect(m_filtersWithoutMasterLightness, m_masterLightnessCurve);
            m_tempCurve  = new Curve(CurveInterpolation.Linear);
        }
Exemplo n.º 4
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            m_filtersWithoutMasterLightness = null;
            m_lightness  = null;
            m_saturation = null;
            DisposeAndSetToNull(ref m_masterLightnessCurve);
            DisposeAndSetToNull(ref m_tempCurve);
        }
        public void Ctor_Reader()
        {
            var reader = new MetafileReader(new byte[]
            {
                /* Hue Level */ 0x01, 0x00, 0x00, 0x00,
                /* Saturation Level */ 0x02, 0x00, 0x00, 0x00,
                /* Lightness Level */ 0x03, 0x00, 0x00, 0x00
            }, 0);

            var effect = new HueSaturationLightnessEffect(reader);

            Assert.Equal(1, effect.HueLevel);
            Assert.Equal(2, effect.SaturationLevel);
            Assert.Equal(3, effect.LightnessLevel);
            Assert.Equal(12u, effect.Size);
            Assert.Equal(new Guid("{8B2DD6C3-EB07-4D87-A5F0-7108E26A9C5F}"), effect.Identifier);
        }
Exemplo n.º 6
0
        public HSLProcessor()
        {
            List <Curve> curves = new List <Curve>();


            Name = "HSL";
            m_HueSaturationLightnessEffect = new HueSaturationLightnessEffect();

            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(0, 0), new Point(255, 0) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(220, 255) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(170, 220), new Point(220, 255) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(0, 255), new Point(255, 0) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 50), new Point(170, 220), new Point(220, 190) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(10, 10), new Point(220, 255) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(255, 255) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(80, 20), new Point(220, 255) }));

            m_SaturationLightnessCurves = curves.ToArray();

            curves = new List <Curve>();

            curves.Add(new Curve());
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(0, 0), new Point(255, 510) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(170, 220), new Point(220, 255) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(0, 255), new Point(255, 0) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 50), new Point(170, 220), new Point(220, 190) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(10, 10), new Point(220, 255) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(255, 255) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(80, 20), new Point(220, 255) }));

            m_HueCurves = curves.ToArray();

            m_propertyDescriptions = new Dictionary <string, PropertyDescription>();
            m_propertyDescriptions.Add("HueCurveIndex", new PropertyDescription(0, m_HueCurves.Length - 1, 0));
            m_propertyDescriptions.Add("SaturationCurveIndex", new PropertyDescription(0, m_SaturationLightnessCurves.Length - 1, 0));
            m_propertyDescriptions.Add("LightnessCurveIndex", new PropertyDescription(0, m_SaturationLightnessCurves.Length - 1, 0));

            AddEditors();

            SetupEffectCategory(m_HueSaturationLightnessEffect);
        }
Exemplo n.º 7
0
        public HSLProcessor()            
        {
            List<Curve> curves = new List<Curve>();

			
			Name = "HSL";
			m_HueSaturationLightnessEffect = new HueSaturationLightnessEffect();

            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(0, 0), new Point(255, 0) }));
            curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(220, 255) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(170, 220), new Point(220, 255) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(0, 255), new Point(255, 0) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 50), new Point(170, 220), new Point(220, 190) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(10, 10), new Point(220, 255) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(255, 255) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(80, 20), new Point(220, 255) }));

			m_SaturationLightnessCurves = curves.ToArray();

			curves = new List<Curve>();

			curves.Add(new Curve());
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(0, 0), new Point(255, 510) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(170, 220), new Point(220, 255) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(0, 255), new Point(255, 0) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 50), new Point(170, 220), new Point(220, 190) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(10, 10), new Point(220, 255) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(255, 255) }));
			curves.Add(new Curve(CurveInterpolation.NaturalCubicSpline, new[] { new Point(30, 0), new Point(80, 20), new Point(220, 255) }));

			m_HueCurves = curves.ToArray();

            m_propertyDescriptions = new Dictionary<string, PropertyDescription>();
            m_propertyDescriptions.Add("HueCurveIndex", new PropertyDescription(0, m_HueCurves.Length - 1, 0));
            m_propertyDescriptions.Add("SaturationCurveIndex", new PropertyDescription(0, m_SaturationLightnessCurves.Length - 1, 0));
            m_propertyDescriptions.Add("LightnessCurveIndex", new PropertyDescription(0, m_SaturationLightnessCurves.Length - 1, 0));

            AddEditors();
           
            SetupEffectCategory(m_HueSaturationLightnessEffect);
        }        
Exemplo n.º 8
0
        public SunsetEffect()
        {
            var curvesEffectTask = new LookupCurves("Images\\sunset_table.bmp").GetEffectAsync();

            var hslEffect = new HueSaturationLightnessEffect()
            {
                SaturationCurve = EffectPhotoExtensions.CreateCurveFromHueRangeAdjustments(
                    new EffectPhotoExtensions.HueRangeAdjustment(0, 19),    // master
                    new EffectPhotoExtensions.HueRangeAdjustment(1, 15),    // red
                    new EffectPhotoExtensions.HueRangeAdjustment(2, 5),     // etc
                    new EffectPhotoExtensions.HueRangeAdjustment(5, 15),
                    new EffectPhotoExtensions.HueRangeAdjustment(6, 20)),
                LightnessCurve = EffectPhotoExtensions.CreateCurveFromHueRangeAdjustments(
                    new EffectPhotoExtensions.HueRangeAdjustment(1, -5),
                    new EffectPhotoExtensions.HueRangeAdjustment(2, -5),
                    new EffectPhotoExtensions.HueRangeAdjustment(5, -5),
                    new EffectPhotoExtensions.HueRangeAdjustment(6, -5))
            };


            var curvesEffect = new CurvesEffect(new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(255, 255 - EffectPhotoExtensions.ConvertAdjustmentLevel(5))
            }));

            LayerList.AddRange(
                // Curves
                // HSL
                new AdjustmentLayer(LayerStyle.Normal(), curvesEffectTask),
                new AdjustmentLayer(LayerStyle.Normal(), hslEffect),
                new AdjustmentLayer(LayerStyle.Normal(), curvesEffect),

                // Gradient
                new Layer(LayerStyle.Overlay(0.35), context => Lookups.SunsetVignette.GetAsync(context.BackgroundLayer.ImageSize))
                );
        }
Exemplo n.º 9
0
        public SunsetEffect()
        {
            var curvesEffectTask = new LookupCurves("Images\\sunset_table.bmp").GetEffectAsync();

			var hslEffect = new HueSaturationLightnessEffect()
                {
                    SaturationCurve = EffectPhotoExtensions.CreateCurveFromHueRangeAdjustments(
                        new EffectPhotoExtensions.HueRangeAdjustment(0, 19), // master
                        new EffectPhotoExtensions.HueRangeAdjustment(1, 15), // red
                        new EffectPhotoExtensions.HueRangeAdjustment(2, 5), // etc
                        new EffectPhotoExtensions.HueRangeAdjustment(5, 15),
                        new EffectPhotoExtensions.HueRangeAdjustment(6, 20)),
                    LightnessCurve = EffectPhotoExtensions.CreateCurveFromHueRangeAdjustments(
                        new EffectPhotoExtensions.HueRangeAdjustment(1, -5),
                        new EffectPhotoExtensions.HueRangeAdjustment(2, -5),
                        new EffectPhotoExtensions.HueRangeAdjustment(5, -5),
                        new EffectPhotoExtensions.HueRangeAdjustment(6, -5))
                };


            var curvesEffect = new CurvesEffect(new Curve(CurveInterpolation.Linear, new[]
                {
                    new Point(255, 255 - EffectPhotoExtensions.ConvertAdjustmentLevel(5))
                }));

            LayerList.AddRange(
                // Curves
                // HSL
                new AdjustmentLayer(LayerStyle.Normal(), curvesEffectTask),
                new AdjustmentLayer(LayerStyle.Normal(), hslEffect),
				new AdjustmentLayer(LayerStyle.Normal(), curvesEffect),

                // Gradient
                new Layer(LayerStyle.Overlay(0.35), context => Lookups.SunsetVignette.GetAsync(context.BackgroundLayer.ImageSize))
            );
        }
        public RetrotoneEffect()
        {
            // Curves
            var globalCurve = new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(0, 45),
                new Point(33, 57),
                new Point(178, 207),
                new Point(255, 236)
            });

            var curves = new Curve[3];

            curves[0] = new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(10, 0),
                new Point(34, 25),
                new Point(124, 119),
                new Point(255, 246),
                new Point(255, 255)
            });

            curves[1] = new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(0, 0),
                new Point(37, 32),
                new Point(209, 213),
                new Point(255, 250),
                new Point(255, 255)
            });

            curves[2] = new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(0, 52),
                new Point(29, 62),
                new Point(100, 102),
                new Point(176, 171),
                new Point(222, 211),
                new Point(255, 239),
                new Point(255, 255)
            });

            Curve.Compose(globalCurve, curves[0], curves[0]);
            Curve.Compose(globalCurve, curves[1], curves[1]);
            Curve.Compose(globalCurve, curves[2], curves[2]);
            
            var curvesEffect = new CurvesEffect(curves[0], curves[1], curves[2]);

            var hslEffect = new HueSaturationLightnessEffect
            {
                SaturationCurve = EffectPhotoExtensions.CreateCurveFromHueRangeAdjustments(
                    new EffectPhotoExtensions.HueRangeAdjustment(0, -25),
                    new EffectPhotoExtensions.HueRangeAdjustment(2, 5),
                    new EffectPhotoExtensions.HueRangeAdjustment(5, 10)),
                LightnessCurve = EffectPhotoExtensions.CreateCurveFromHueRangeAdjustments(
                    new EffectPhotoExtensions.HueRangeAdjustment(1, -4),
                    new EffectPhotoExtensions.HueRangeAdjustment(2, -9),
                    new EffectPhotoExtensions.HueRangeAdjustment(3, -4),
                    new EffectPhotoExtensions.HueRangeAdjustment(4, -4),
                    new EffectPhotoExtensions.HueRangeAdjustment(5, -9),
                    new EffectPhotoExtensions.HueRangeAdjustment(6, -4))
            };

            LayerList.AddRange(
                new AdjustmentLayer(LayerStyle.Normal(), curvesEffect),

                // Hue/Saturation    
                new AdjustmentLayer(LayerStyle.Normal(), hslEffect),

                // Noise
                new Layer(LayerStyle.Overlay(), context => new NoiseImageSource(context.BackgroundLayer.ImageSize, 13)),

                // Vignette
                new Layer(new LayerStyle(BlendFunction.Hardlight, 0.25, context => Lookups.RetrotoneVignette.GetAsync(context.BackgroundLayer.ImageSize)),
                    context => new ColorImageSource(context.BackgroundLayer.ImageSize, Windows.UI.Color.FromArgb(255, 0, 0, 0)))
            );
        }
Exemplo n.º 11
0
        public RetrotoneEffect()
        {
            // Curves
            var globalCurve = new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(0, 45),
                new Point(33, 57),
                new Point(178, 207),
                new Point(255, 236)
            });

            var curves = new Curve[3];

            curves[0] = new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(10, 0),
                new Point(34, 25),
                new Point(124, 119),
                new Point(255, 246),
                new Point(255, 255)
            });

            curves[1] = new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(0, 0),
                new Point(37, 32),
                new Point(209, 213),
                new Point(255, 250),
                new Point(255, 255)
            });

            curves[2] = new Curve(CurveInterpolation.Linear, new[]
            {
                new Point(0, 52),
                new Point(29, 62),
                new Point(100, 102),
                new Point(176, 171),
                new Point(222, 211),
                new Point(255, 239),
                new Point(255, 255)
            });

            Curve.Compose(globalCurve, curves[0], curves[0]);
            Curve.Compose(globalCurve, curves[1], curves[1]);
            Curve.Compose(globalCurve, curves[2], curves[2]);

            var curvesEffect = new CurvesEffect(curves[0], curves[1], curves[2]);

            var hslEffect = new HueSaturationLightnessEffect
            {
                SaturationCurve = EffectPhotoExtensions.CreateCurveFromHueRangeAdjustments(
                    new EffectPhotoExtensions.HueRangeAdjustment(0, -25),
                    new EffectPhotoExtensions.HueRangeAdjustment(2, 5),
                    new EffectPhotoExtensions.HueRangeAdjustment(5, 10)),
                LightnessCurve = EffectPhotoExtensions.CreateCurveFromHueRangeAdjustments(
                    new EffectPhotoExtensions.HueRangeAdjustment(1, -4),
                    new EffectPhotoExtensions.HueRangeAdjustment(2, -9),
                    new EffectPhotoExtensions.HueRangeAdjustment(3, -4),
                    new EffectPhotoExtensions.HueRangeAdjustment(4, -4),
                    new EffectPhotoExtensions.HueRangeAdjustment(5, -9),
                    new EffectPhotoExtensions.HueRangeAdjustment(6, -4))
            };

            LayerList.AddRange(
                new AdjustmentLayer(LayerStyle.Normal(), curvesEffect),

                // Hue/Saturation
                new AdjustmentLayer(LayerStyle.Normal(), hslEffect),

                // Noise
                new Layer(LayerStyle.Overlay(), context => new NoiseImageSource(context.BackgroundLayer.ImageSize, 13)),

                // Vignette
                new Layer(new LayerStyle(BlendFunction.Hardlight, 0.25, context => Lookups.RetrotoneVignette.GetAsync(context.BackgroundLayer.ImageSize)),
                          context => new ColorImageSource(context.BackgroundLayer.ImageSize, Windows.UI.Color.FromArgb(255, 0, 0, 0)))
                );
        }