1- // Copyright (c) Six Labors and contributors.
1+ // Copyright (c) Six Labors and contributors.
22// Licensed under the Apache License, Version 2.0.
33
44using SixLabors . ImageSharp . Processing . Processors . Transforms ;
@@ -13,86 +13,86 @@ public static class KnownResamplers
1313 /// <summary>
1414 /// Gets the Bicubic sampler that implements the bicubic kernel algorithm W(x)
1515 /// </summary>
16- public static IResampler Bicubic { get ; } = new BicubicResampler ( ) ;
16+ public static IResampler Bicubic { get ; } = default ( BicubicResampler ) ;
1717
1818 /// <summary>
1919 /// Gets the Box sampler that implements the box algorithm. Similar to nearest neighbor when upscaling.
2020 /// When downscaling the pixels will average, merging pixels together.
2121 /// </summary>
22- public static IResampler Box { get ; } = new BoxResampler ( ) ;
22+ public static IResampler Box { get ; } = default ( BoxResampler ) ;
2323
2424 /// <summary>
2525 /// Gets the Catmull-Rom sampler, a well known standard Cubic Filter often used as a interpolation function
2626 /// </summary>
27- public static IResampler CatmullRom { get ; } = new CatmullRomResampler ( ) ;
27+ public static IResampler CatmullRom { get ; } = CubicResampler . CatmullRom ;
2828
2929 /// <summary>
3030 /// Gets the Hermite sampler. A type of smoothed triangular interpolation filter that rounds off strong edges while
3131 /// preserving flat 'color levels' in the original image.
3232 /// </summary>
33- public static IResampler Hermite { get ; } = new HermiteResampler ( ) ;
33+ public static IResampler Hermite { get ; } = CubicResampler . Hermite ;
3434
3535 /// <summary>
3636 /// Gets the Lanczos kernel sampler that implements smooth interpolation with a radius of 2 pixels.
3737 /// This algorithm provides sharpened results when compared to others when downsampling.
3838 /// </summary>
39- public static IResampler Lanczos2 { get ; } = new Lanczos2Resampler ( ) ;
39+ public static IResampler Lanczos2 { get ; } = LanczosResampler . Lanczos2 ;
4040
4141 /// <summary>
4242 /// Gets the Lanczos kernel sampler that implements smooth interpolation with a radius of 3 pixels
4343 /// This algorithm provides sharpened results when compared to others when downsampling.
4444 /// </summary>
45- public static IResampler Lanczos3 { get ; } = new Lanczos3Resampler ( ) ;
45+ public static IResampler Lanczos3 { get ; } = LanczosResampler . Lanczos3 ;
4646
4747 /// <summary>
4848 /// Gets the Lanczos kernel sampler that implements smooth interpolation with a radius of 5 pixels
4949 /// This algorithm provides sharpened results when compared to others when downsampling.
5050 /// </summary>
51- public static IResampler Lanczos5 { get ; } = new Lanczos5Resampler ( ) ;
51+ public static IResampler Lanczos5 { get ; } = LanczosResampler . Lanczos5 ;
5252
5353 /// <summary>
5454 /// Gets the Lanczos kernel sampler that implements smooth interpolation with a radius of 8 pixels
5555 /// This algorithm provides sharpened results when compared to others when downsampling.
5656 /// </summary>
57- public static IResampler Lanczos8 { get ; } = new Lanczos8Resampler ( ) ;
57+ public static IResampler Lanczos8 { get ; } = LanczosResampler . Lanczos8 ;
5858
5959 /// <summary>
6060 /// Gets the Mitchell-Netravali sampler. This seperable cubic algorithm yields a very good equilibrium between
6161 /// detail preservation (sharpness) and smoothness.
6262 /// </summary>
63- public static IResampler MitchellNetravali { get ; } = new MitchellNetravaliResampler ( ) ;
63+ public static IResampler MitchellNetravali { get ; } = CubicResampler . MitchellNetravali ;
6464
6565 /// <summary>
6666 /// Gets the Nearest-Neighbour sampler that implements the nearest neighbor algorithm. This uses a very fast, unscaled filter
6767 /// which will select the closest pixel to the new pixels position.
6868 /// </summary>
69- public static IResampler NearestNeighbor { get ; } = new NearestNeighborResampler ( ) ;
69+ public static IResampler NearestNeighbor { get ; } = default ( NearestNeighborResampler ) ;
7070
7171 /// <summary>
7272 /// Gets the Robidoux sampler. This algorithm developed by Nicolas Robidoux providing a very good equilibrium between
7373 /// detail preservation (sharpness) and smoothness comparable to <see cref="MitchellNetravali"/>.
7474 /// </summary>
75- public static IResampler Robidoux { get ; } = new RobidouxResampler ( ) ;
75+ public static IResampler Robidoux { get ; } = CubicResampler . Robidoux ;
7676
7777 /// <summary>
7878 /// Gets the Robidoux Sharp sampler. A sharpened form of the <see cref="Robidoux"/> sampler
7979 /// </summary>
80- public static IResampler RobidouxSharp { get ; } = new RobidouxSharpResampler ( ) ;
80+ public static IResampler RobidouxSharp { get ; } = CubicResampler . RobidouxSharp ;
8181
8282 /// <summary>
83- /// Gets the Spline sampler. A seperable cubic algorithm similar to <see cref="MitchellNetravali"/> but yielding smoother results.
83+ /// Gets the Spline sampler. A separable cubic algorithm similar to <see cref="MitchellNetravali"/> but yielding smoother results.
8484 /// </summary>
85- public static IResampler Spline { get ; } = new SplineResampler ( ) ;
85+ public static IResampler Spline { get ; } = CubicResampler . Spline ;
8686
8787 /// <summary>
8888 /// Gets the Triangle sampler, otherwise known as Bilinear. This interpolation algorithm can be used where perfect image transformation
8989 /// with pixel matching is impossible, so that one can calculate and assign appropriate intensity values to pixels
9090 /// </summary>
91- public static IResampler Triangle { get ; } = new TriangleResampler ( ) ;
91+ public static IResampler Triangle { get ; } = default ( TriangleResampler ) ;
9292
9393 /// <summary>
9494 /// Gets the Welch sampler. A high speed algorithm that delivers very sharpened results.
9595 /// </summary>
96- public static IResampler Welch { get ; } = new WelchResampler ( ) ;
96+ public static IResampler Welch { get ; } = default ( WelchResampler ) ;
9797 }
98- }
98+ }
0 commit comments