Skip to content
Newer
Older
100644 41 lines (36 sloc) 1.36 KB
d203da5 @jpobst Initial import.
jpobst authored Dec 24, 2012
1 /////////////////////////////////////////////////////////////////////////////////
2 // Paint.NET //
3 // Copyright (C) dotPDN LLC, Rick Brewster, Tom Jackson, and contributors. //
4 // Portions Copyright (C) Microsoft Corporation. All Rights Reserved. //
5 // See license-pdn.txt for full licensing and attribution details. //
6 // //
7 // Ported to Pinta by: Jonathan Pobst <monkey@jpobst.com> //
8 /////////////////////////////////////////////////////////////////////////////////
9
10 using System;
11 using Pinta.ImageManipulation.UnaryPixelOperations;
12
13 namespace Pinta.ImageManipulation.Effects
14 {
15 public class SepiaEffect : BaseEffect
16 {
17 private DesaturateOp desat_op = new DesaturateOp ();
18 private LevelOp level_op = new LevelOp (
19 ColorBgra.Black,
20 ColorBgra.White,
21 new float[] { 1.2f, 1.0f, 0.8f },
22 ColorBgra.Black,
23 ColorBgra.White);
24
6a49a00 @jpobst Provide default values and documentation on all effect constructors.
jpobst authored Dec 25, 2012
25 /// <summary>
26 /// Creates a new effect that will apply a sepia tone to an image.
27 /// </summary>
28 public SepiaEffect ()
29 {
30 }
31
d203da5 @jpobst Initial import.
jpobst authored Dec 25, 2012
32 #region Algorithm Code Ported From PDN
33 protected override void RenderLine (ISurface src, ISurface dest, Rectangle roi)
34 {
35 desat_op.Apply (src, dest, roi);
36 level_op.Apply (dest, dest, roi);
37 }
38 #endregion
39 }
40 }
Something went wrong with that request. Please try again.