diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.Generated.cs b/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.Generated.cs index d31e07c62..acd9fba9c 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.Generated.cs @@ -17,6 +17,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalSrc(background, source, amount); @@ -35,6 +38,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplySrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplySrc(background, source, amount); @@ -53,6 +59,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddSrc(background, source, amount); @@ -71,6 +80,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractSrc(background, source, amount); @@ -89,6 +101,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenSrc(background, source, amount); @@ -107,6 +122,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenSrc(background, source, amount); @@ -125,6 +143,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenSrc(background, source, amount); @@ -143,6 +164,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlaySrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlaySrc(background, source, amount); @@ -161,6 +185,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightSrc(background, source, amount); @@ -179,6 +206,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalSrcAtop(background, source, amount); @@ -197,6 +227,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplySrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplySrcAtop(background, source, amount); @@ -215,6 +248,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddSrcAtop(background, source, amount); @@ -233,6 +269,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractSrcAtop(background, source, amount); @@ -251,6 +290,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenSrcAtop(background, source, amount); @@ -269,6 +311,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenSrcAtop(background, source, amount); @@ -287,6 +332,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenSrcAtop(background, source, amount); @@ -305,6 +353,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlaySrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlaySrcAtop(background, source, amount); @@ -323,6 +374,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightSrcAtop(background, source, amount); @@ -341,6 +395,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalSrcOver(background, source, amount); @@ -359,6 +416,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplySrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplySrcOver(background, source, amount); @@ -377,6 +437,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddSrcOver(background, source, amount); @@ -395,6 +458,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractSrcOver(background, source, amount); @@ -413,6 +479,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenSrcOver(background, source, amount); @@ -431,6 +500,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenSrcOver(background, source, amount); @@ -449,6 +521,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenSrcOver(background, source, amount); @@ -467,6 +542,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlaySrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlaySrcOver(background, source, amount); @@ -485,6 +563,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightSrcOver(background, source, amount); @@ -503,6 +584,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalSrcIn(background, source, amount); @@ -521,6 +605,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplySrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplySrcIn(background, source, amount); @@ -539,6 +626,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddSrcIn(background, source, amount); @@ -557,6 +647,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractSrcIn(background, source, amount); @@ -575,6 +668,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenSrcIn(background, source, amount); @@ -593,6 +689,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenSrcIn(background, source, amount); @@ -611,6 +710,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenSrcIn(background, source, amount); @@ -629,6 +731,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlaySrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlaySrcIn(background, source, amount); @@ -647,6 +752,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightSrcIn(background, source, amount); @@ -665,6 +773,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalSrcOut(background, source, amount); @@ -683,6 +794,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplySrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplySrcOut(background, source, amount); @@ -701,6 +815,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddSrcOut(background, source, amount); @@ -719,6 +836,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractSrcOut(background, source, amount); @@ -737,6 +857,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenSrcOut(background, source, amount); @@ -755,6 +878,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenSrcOut(background, source, amount); @@ -773,6 +899,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenSrcOut(background, source, amount); @@ -791,6 +920,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlaySrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlaySrcOut(background, source, amount); @@ -809,6 +941,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightSrcOut(background, source, amount); @@ -827,6 +962,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalDest(background, source, amount); @@ -845,6 +983,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplyDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplyDest(background, source, amount); @@ -863,6 +1004,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddDest(background, source, amount); @@ -881,6 +1025,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractDest(background, source, amount); @@ -899,6 +1046,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenDest(background, source, amount); @@ -917,6 +1067,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenDest(background, source, amount); @@ -935,6 +1088,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenDest(background, source, amount); @@ -953,6 +1109,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlayDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlayDest(background, source, amount); @@ -971,6 +1130,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightDest(background, source, amount); @@ -989,6 +1151,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalDestAtop(background, source, amount); @@ -1007,6 +1172,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplyDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplyDestAtop(background, source, amount); @@ -1025,6 +1193,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddDestAtop(background, source, amount); @@ -1043,6 +1214,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractDestAtop(background, source, amount); @@ -1061,6 +1235,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenDestAtop(background, source, amount); @@ -1079,6 +1256,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenDestAtop(background, source, amount); @@ -1097,6 +1277,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenDestAtop(background, source, amount); @@ -1115,6 +1298,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlayDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlayDestAtop(background, source, amount); @@ -1133,6 +1319,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightDestAtop(background, source, amount); @@ -1151,6 +1340,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalDestOver(background, source, amount); @@ -1169,6 +1361,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplyDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplyDestOver(background, source, amount); @@ -1187,6 +1382,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddDestOver(background, source, amount); @@ -1205,6 +1403,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractDestOver(background, source, amount); @@ -1223,6 +1424,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenDestOver(background, source, amount); @@ -1241,6 +1445,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenDestOver(background, source, amount); @@ -1259,6 +1466,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenDestOver(background, source, amount); @@ -1277,6 +1487,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlayDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlayDestOver(background, source, amount); @@ -1295,6 +1508,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightDestOver(background, source, amount); @@ -1313,6 +1529,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalDestIn(background, source, amount); @@ -1331,6 +1550,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplyDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplyDestIn(background, source, amount); @@ -1349,6 +1571,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddDestIn(background, source, amount); @@ -1367,6 +1592,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractDestIn(background, source, amount); @@ -1385,6 +1613,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenDestIn(background, source, amount); @@ -1403,6 +1634,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenDestIn(background, source, amount); @@ -1421,6 +1655,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenDestIn(background, source, amount); @@ -1439,6 +1676,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlayDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlayDestIn(background, source, amount); @@ -1457,6 +1697,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightDestIn(background, source, amount); @@ -1475,6 +1718,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalDestOut(background, source, amount); @@ -1493,6 +1739,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplyDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplyDestOut(background, source, amount); @@ -1511,6 +1760,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddDestOut(background, source, amount); @@ -1529,6 +1781,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractDestOut(background, source, amount); @@ -1547,6 +1802,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenDestOut(background, source, amount); @@ -1565,6 +1823,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenDestOut(background, source, amount); @@ -1583,6 +1844,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenDestOut(background, source, amount); @@ -1601,6 +1865,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlayDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlayDestOut(background, source, amount); @@ -1619,6 +1886,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightDestOut(background, source, amount); @@ -1637,6 +1907,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalClear(background, source, amount); @@ -1655,6 +1928,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplyClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplyClear(background, source, amount); @@ -1673,6 +1949,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddClear(background, source, amount); @@ -1691,6 +1970,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractClear(background, source, amount); @@ -1709,6 +1991,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenClear(background, source, amount); @@ -1727,6 +2012,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenClear(background, source, amount); @@ -1745,6 +2033,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenClear(background, source, amount); @@ -1763,6 +2054,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlayClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlayClear(background, source, amount); @@ -1781,6 +2075,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightClear(background, source, amount); @@ -1799,6 +2096,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct NormalXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.NormalXor(background, source, amount); @@ -1817,6 +2117,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct MultiplyXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.MultiplyXor(background, source, amount); @@ -1835,6 +2138,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct AddXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.AddXor(background, source, amount); @@ -1853,6 +2159,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct SubtractXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.SubtractXor(background, source, amount); @@ -1871,6 +2180,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct ScreenXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.ScreenXor(background, source, amount); @@ -1889,6 +2201,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct DarkenXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.DarkenXor(background, source, amount); @@ -1907,6 +2222,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct LightenXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.LightenXor(background, source, amount); @@ -1925,6 +2243,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct OverlayXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.OverlayXor(background, source, amount); @@ -1943,6 +2264,9 @@ internal static class AssociatedAlphaPixelBlenderOperators /// public readonly struct HardLightXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.HardLightXor(background, source, amount); @@ -1966,1299 +2290,543 @@ internal static partial class AssociatedAlphaPixelBlenders where TPixel : unmanaged, IPixel { /// - /// Blends pixels with the "NormalSrc" composition equation. + /// Gets the shared blender for the "NormalSrc" composition equation. /// - public sealed class NormalSrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrc Instance { get; } = new(); - } + public static PixelBlender NormalSrc => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrc" composition equation. + /// Gets the shared blender for the "MultiplySrc" composition equation. /// - public sealed class MultiplySrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrc Instance { get; } = new(); - } + public static PixelBlender MultiplySrc => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrc" composition equation. + /// Gets the shared blender for the "AddSrc" composition equation. /// - public sealed class AddSrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrc Instance { get; } = new(); - } + public static PixelBlender AddSrc => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrc" composition equation. + /// Gets the shared blender for the "SubtractSrc" composition equation. /// - public sealed class SubtractSrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrc Instance { get; } = new(); - } + public static PixelBlender SubtractSrc => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrc" composition equation. + /// Gets the shared blender for the "ScreenSrc" composition equation. /// - public sealed class ScreenSrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrc Instance { get; } = new(); - } + public static PixelBlender ScreenSrc => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrc" composition equation. + /// Gets the shared blender for the "DarkenSrc" composition equation. /// - public sealed class DarkenSrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrc Instance { get; } = new(); - } + public static PixelBlender DarkenSrc => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrc" composition equation. + /// Gets the shared blender for the "LightenSrc" composition equation. /// - public sealed class LightenSrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrc Instance { get; } = new(); - } + public static PixelBlender LightenSrc => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrc" composition equation. + /// Gets the shared blender for the "OverlaySrc" composition equation. /// - public sealed class OverlaySrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrc Instance { get; } = new(); - } + public static PixelBlender OverlaySrc => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrc" composition equation. + /// Gets the shared blender for the "HardLightSrc" composition equation. /// - public sealed class HardLightSrc : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrc Instance { get; } = new(); - } + public static PixelBlender HardLightSrc => PixelBlender.Instance; /// - /// Blends pixels with the "NormalSrcAtop" composition equation. + /// Gets the shared blender for the "NormalSrcAtop" composition equation. /// - public sealed class NormalSrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrcAtop Instance { get; } = new(); - } + public static PixelBlender NormalSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrcAtop" composition equation. + /// Gets the shared blender for the "MultiplySrcAtop" composition equation. /// - public sealed class MultiplySrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrcAtop Instance { get; } = new(); - } + public static PixelBlender MultiplySrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrcAtop" composition equation. + /// Gets the shared blender for the "AddSrcAtop" composition equation. /// - public sealed class AddSrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrcAtop Instance { get; } = new(); - } + public static PixelBlender AddSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrcAtop" composition equation. + /// Gets the shared blender for the "SubtractSrcAtop" composition equation. /// - public sealed class SubtractSrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrcAtop Instance { get; } = new(); - } + public static PixelBlender SubtractSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrcAtop" composition equation. + /// Gets the shared blender for the "ScreenSrcAtop" composition equation. /// - public sealed class ScreenSrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrcAtop Instance { get; } = new(); - } + public static PixelBlender ScreenSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrcAtop" composition equation. + /// Gets the shared blender for the "DarkenSrcAtop" composition equation. /// - public sealed class DarkenSrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrcAtop Instance { get; } = new(); - } + public static PixelBlender DarkenSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrcAtop" composition equation. + /// Gets the shared blender for the "LightenSrcAtop" composition equation. /// - public sealed class LightenSrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrcAtop Instance { get; } = new(); - } + public static PixelBlender LightenSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrcAtop" composition equation. + /// Gets the shared blender for the "OverlaySrcAtop" composition equation. /// - public sealed class OverlaySrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrcAtop Instance { get; } = new(); - } + public static PixelBlender OverlaySrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrcAtop" composition equation. + /// Gets the shared blender for the "HardLightSrcAtop" composition equation. /// - public sealed class HardLightSrcAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrcAtop Instance { get; } = new(); - } + public static PixelBlender HardLightSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "NormalSrcOver" composition equation. + /// Gets the shared blender for the "NormalSrcOver" composition equation. /// - public sealed class NormalSrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrcOver Instance { get; } = new(); - } + public static PixelBlender NormalSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrcOver" composition equation. + /// Gets the shared blender for the "MultiplySrcOver" composition equation. /// - public sealed class MultiplySrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrcOver Instance { get; } = new(); - } + public static PixelBlender MultiplySrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrcOver" composition equation. + /// Gets the shared blender for the "AddSrcOver" composition equation. /// - public sealed class AddSrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrcOver Instance { get; } = new(); - } + public static PixelBlender AddSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrcOver" composition equation. + /// Gets the shared blender for the "SubtractSrcOver" composition equation. /// - public sealed class SubtractSrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrcOver Instance { get; } = new(); - } + public static PixelBlender SubtractSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrcOver" composition equation. + /// Gets the shared blender for the "ScreenSrcOver" composition equation. /// - public sealed class ScreenSrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrcOver Instance { get; } = new(); - } + public static PixelBlender ScreenSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrcOver" composition equation. + /// Gets the shared blender for the "DarkenSrcOver" composition equation. /// - public sealed class DarkenSrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrcOver Instance { get; } = new(); - } + public static PixelBlender DarkenSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrcOver" composition equation. + /// Gets the shared blender for the "LightenSrcOver" composition equation. /// - public sealed class LightenSrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrcOver Instance { get; } = new(); - } + public static PixelBlender LightenSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrcOver" composition equation. + /// Gets the shared blender for the "OverlaySrcOver" composition equation. /// - public sealed class OverlaySrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrcOver Instance { get; } = new(); - } + public static PixelBlender OverlaySrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrcOver" composition equation. + /// Gets the shared blender for the "HardLightSrcOver" composition equation. /// - public sealed class HardLightSrcOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrcOver Instance { get; } = new(); - } + public static PixelBlender HardLightSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "NormalSrcIn" composition equation. + /// Gets the shared blender for the "NormalSrcIn" composition equation. /// - public sealed class NormalSrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrcIn Instance { get; } = new(); - } + public static PixelBlender NormalSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrcIn" composition equation. + /// Gets the shared blender for the "MultiplySrcIn" composition equation. /// - public sealed class MultiplySrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrcIn Instance { get; } = new(); - } + public static PixelBlender MultiplySrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrcIn" composition equation. + /// Gets the shared blender for the "AddSrcIn" composition equation. /// - public sealed class AddSrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrcIn Instance { get; } = new(); - } + public static PixelBlender AddSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrcIn" composition equation. + /// Gets the shared blender for the "SubtractSrcIn" composition equation. /// - public sealed class SubtractSrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrcIn Instance { get; } = new(); - } + public static PixelBlender SubtractSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrcIn" composition equation. + /// Gets the shared blender for the "ScreenSrcIn" composition equation. /// - public sealed class ScreenSrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrcIn Instance { get; } = new(); - } + public static PixelBlender ScreenSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrcIn" composition equation. + /// Gets the shared blender for the "DarkenSrcIn" composition equation. /// - public sealed class DarkenSrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrcIn Instance { get; } = new(); - } + public static PixelBlender DarkenSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrcIn" composition equation. + /// Gets the shared blender for the "LightenSrcIn" composition equation. /// - public sealed class LightenSrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrcIn Instance { get; } = new(); - } + public static PixelBlender LightenSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrcIn" composition equation. + /// Gets the shared blender for the "OverlaySrcIn" composition equation. /// - public sealed class OverlaySrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrcIn Instance { get; } = new(); - } + public static PixelBlender OverlaySrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrcIn" composition equation. + /// Gets the shared blender for the "HardLightSrcIn" composition equation. /// - public sealed class HardLightSrcIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrcIn Instance { get; } = new(); - } + public static PixelBlender HardLightSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "NormalSrcOut" composition equation. + /// Gets the shared blender for the "NormalSrcOut" composition equation. /// - public sealed class NormalSrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrcOut Instance { get; } = new(); - } + public static PixelBlender NormalSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrcOut" composition equation. + /// Gets the shared blender for the "MultiplySrcOut" composition equation. /// - public sealed class MultiplySrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrcOut Instance { get; } = new(); - } + public static PixelBlender MultiplySrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrcOut" composition equation. + /// Gets the shared blender for the "AddSrcOut" composition equation. /// - public sealed class AddSrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrcOut Instance { get; } = new(); - } + public static PixelBlender AddSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrcOut" composition equation. + /// Gets the shared blender for the "SubtractSrcOut" composition equation. /// - public sealed class SubtractSrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrcOut Instance { get; } = new(); - } + public static PixelBlender SubtractSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrcOut" composition equation. + /// Gets the shared blender for the "ScreenSrcOut" composition equation. /// - public sealed class ScreenSrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrcOut Instance { get; } = new(); - } + public static PixelBlender ScreenSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrcOut" composition equation. + /// Gets the shared blender for the "DarkenSrcOut" composition equation. /// - public sealed class DarkenSrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrcOut Instance { get; } = new(); - } + public static PixelBlender DarkenSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrcOut" composition equation. + /// Gets the shared blender for the "LightenSrcOut" composition equation. /// - public sealed class LightenSrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrcOut Instance { get; } = new(); - } + public static PixelBlender LightenSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrcOut" composition equation. + /// Gets the shared blender for the "OverlaySrcOut" composition equation. /// - public sealed class OverlaySrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrcOut Instance { get; } = new(); - } + public static PixelBlender OverlaySrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrcOut" composition equation. + /// Gets the shared blender for the "HardLightSrcOut" composition equation. /// - public sealed class HardLightSrcOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrcOut Instance { get; } = new(); - } + public static PixelBlender HardLightSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDest" composition equation. + /// Gets the shared blender for the "NormalDest" composition equation. /// - public sealed class NormalDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDest Instance { get; } = new(); - } + public static PixelBlender NormalDest => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDest" composition equation. + /// Gets the shared blender for the "MultiplyDest" composition equation. /// - public sealed class MultiplyDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDest Instance { get; } = new(); - } + public static PixelBlender MultiplyDest => PixelBlender.Instance; /// - /// Blends pixels with the "AddDest" composition equation. + /// Gets the shared blender for the "AddDest" composition equation. /// - public sealed class AddDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDest Instance { get; } = new(); - } + public static PixelBlender AddDest => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDest" composition equation. + /// Gets the shared blender for the "SubtractDest" composition equation. /// - public sealed class SubtractDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDest Instance { get; } = new(); - } + public static PixelBlender SubtractDest => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDest" composition equation. + /// Gets the shared blender for the "ScreenDest" composition equation. /// - public sealed class ScreenDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDest Instance { get; } = new(); - } + public static PixelBlender ScreenDest => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDest" composition equation. + /// Gets the shared blender for the "DarkenDest" composition equation. /// - public sealed class DarkenDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDest Instance { get; } = new(); - } + public static PixelBlender DarkenDest => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDest" composition equation. + /// Gets the shared blender for the "LightenDest" composition equation. /// - public sealed class LightenDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDest Instance { get; } = new(); - } + public static PixelBlender LightenDest => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDest" composition equation. + /// Gets the shared blender for the "OverlayDest" composition equation. /// - public sealed class OverlayDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDest Instance { get; } = new(); - } + public static PixelBlender OverlayDest => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDest" composition equation. + /// Gets the shared blender for the "HardLightDest" composition equation. /// - public sealed class HardLightDest : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDest Instance { get; } = new(); - } + public static PixelBlender HardLightDest => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDestAtop" composition equation. + /// Gets the shared blender for the "NormalDestAtop" composition equation. /// - public sealed class NormalDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDestAtop Instance { get; } = new(); - } + public static PixelBlender NormalDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDestAtop" composition equation. + /// Gets the shared blender for the "MultiplyDestAtop" composition equation. /// - public sealed class MultiplyDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDestAtop Instance { get; } = new(); - } + public static PixelBlender MultiplyDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "AddDestAtop" composition equation. + /// Gets the shared blender for the "AddDestAtop" composition equation. /// - public sealed class AddDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDestAtop Instance { get; } = new(); - } + public static PixelBlender AddDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDestAtop" composition equation. + /// Gets the shared blender for the "SubtractDestAtop" composition equation. /// - public sealed class SubtractDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDestAtop Instance { get; } = new(); - } + public static PixelBlender SubtractDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDestAtop" composition equation. + /// Gets the shared blender for the "ScreenDestAtop" composition equation. /// - public sealed class ScreenDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDestAtop Instance { get; } = new(); - } + public static PixelBlender ScreenDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDestAtop" composition equation. + /// Gets the shared blender for the "DarkenDestAtop" composition equation. /// - public sealed class DarkenDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDestAtop Instance { get; } = new(); - } + public static PixelBlender DarkenDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDestAtop" composition equation. + /// Gets the shared blender for the "LightenDestAtop" composition equation. /// - public sealed class LightenDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDestAtop Instance { get; } = new(); - } + public static PixelBlender LightenDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDestAtop" composition equation. + /// Gets the shared blender for the "OverlayDestAtop" composition equation. /// - public sealed class OverlayDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDestAtop Instance { get; } = new(); - } + public static PixelBlender OverlayDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDestAtop" composition equation. + /// Gets the shared blender for the "HardLightDestAtop" composition equation. /// - public sealed class HardLightDestAtop : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDestAtop Instance { get; } = new(); - } + public static PixelBlender HardLightDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDestOver" composition equation. + /// Gets the shared blender for the "NormalDestOver" composition equation. /// - public sealed class NormalDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDestOver Instance { get; } = new(); - } + public static PixelBlender NormalDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDestOver" composition equation. + /// Gets the shared blender for the "MultiplyDestOver" composition equation. /// - public sealed class MultiplyDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDestOver Instance { get; } = new(); - } + public static PixelBlender MultiplyDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "AddDestOver" composition equation. + /// Gets the shared blender for the "AddDestOver" composition equation. /// - public sealed class AddDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDestOver Instance { get; } = new(); - } + public static PixelBlender AddDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDestOver" composition equation. + /// Gets the shared blender for the "SubtractDestOver" composition equation. /// - public sealed class SubtractDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDestOver Instance { get; } = new(); - } + public static PixelBlender SubtractDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDestOver" composition equation. + /// Gets the shared blender for the "ScreenDestOver" composition equation. /// - public sealed class ScreenDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDestOver Instance { get; } = new(); - } + public static PixelBlender ScreenDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDestOver" composition equation. + /// Gets the shared blender for the "DarkenDestOver" composition equation. /// - public sealed class DarkenDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDestOver Instance { get; } = new(); - } + public static PixelBlender DarkenDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDestOver" composition equation. + /// Gets the shared blender for the "LightenDestOver" composition equation. /// - public sealed class LightenDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDestOver Instance { get; } = new(); - } + public static PixelBlender LightenDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDestOver" composition equation. + /// Gets the shared blender for the "OverlayDestOver" composition equation. /// - public sealed class OverlayDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDestOver Instance { get; } = new(); - } + public static PixelBlender OverlayDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDestOver" composition equation. + /// Gets the shared blender for the "HardLightDestOver" composition equation. /// - public sealed class HardLightDestOver : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDestOver Instance { get; } = new(); - } + public static PixelBlender HardLightDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDestIn" composition equation. + /// Gets the shared blender for the "NormalDestIn" composition equation. /// - public sealed class NormalDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDestIn Instance { get; } = new(); - } + public static PixelBlender NormalDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDestIn" composition equation. + /// Gets the shared blender for the "MultiplyDestIn" composition equation. /// - public sealed class MultiplyDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDestIn Instance { get; } = new(); - } + public static PixelBlender MultiplyDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "AddDestIn" composition equation. + /// Gets the shared blender for the "AddDestIn" composition equation. /// - public sealed class AddDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDestIn Instance { get; } = new(); - } + public static PixelBlender AddDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDestIn" composition equation. + /// Gets the shared blender for the "SubtractDestIn" composition equation. /// - public sealed class SubtractDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDestIn Instance { get; } = new(); - } + public static PixelBlender SubtractDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDestIn" composition equation. + /// Gets the shared blender for the "ScreenDestIn" composition equation. /// - public sealed class ScreenDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDestIn Instance { get; } = new(); - } + public static PixelBlender ScreenDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDestIn" composition equation. + /// Gets the shared blender for the "DarkenDestIn" composition equation. /// - public sealed class DarkenDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDestIn Instance { get; } = new(); - } + public static PixelBlender DarkenDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDestIn" composition equation. + /// Gets the shared blender for the "LightenDestIn" composition equation. /// - public sealed class LightenDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDestIn Instance { get; } = new(); - } + public static PixelBlender LightenDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDestIn" composition equation. + /// Gets the shared blender for the "OverlayDestIn" composition equation. /// - public sealed class OverlayDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDestIn Instance { get; } = new(); - } + public static PixelBlender OverlayDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDestIn" composition equation. + /// Gets the shared blender for the "HardLightDestIn" composition equation. /// - public sealed class HardLightDestIn : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDestIn Instance { get; } = new(); - } + public static PixelBlender HardLightDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDestOut" composition equation. + /// Gets the shared blender for the "NormalDestOut" composition equation. /// - public sealed class NormalDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDestOut Instance { get; } = new(); - } + public static PixelBlender NormalDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDestOut" composition equation. + /// Gets the shared blender for the "MultiplyDestOut" composition equation. /// - public sealed class MultiplyDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDestOut Instance { get; } = new(); - } + public static PixelBlender MultiplyDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "AddDestOut" composition equation. + /// Gets the shared blender for the "AddDestOut" composition equation. /// - public sealed class AddDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDestOut Instance { get; } = new(); - } + public static PixelBlender AddDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDestOut" composition equation. + /// Gets the shared blender for the "SubtractDestOut" composition equation. /// - public sealed class SubtractDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDestOut Instance { get; } = new(); - } + public static PixelBlender SubtractDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDestOut" composition equation. + /// Gets the shared blender for the "ScreenDestOut" composition equation. /// - public sealed class ScreenDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDestOut Instance { get; } = new(); - } + public static PixelBlender ScreenDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDestOut" composition equation. + /// Gets the shared blender for the "DarkenDestOut" composition equation. /// - public sealed class DarkenDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDestOut Instance { get; } = new(); - } + public static PixelBlender DarkenDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDestOut" composition equation. + /// Gets the shared blender for the "LightenDestOut" composition equation. /// - public sealed class LightenDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDestOut Instance { get; } = new(); - } + public static PixelBlender LightenDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDestOut" composition equation. + /// Gets the shared blender for the "OverlayDestOut" composition equation. /// - public sealed class OverlayDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDestOut Instance { get; } = new(); - } + public static PixelBlender OverlayDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDestOut" composition equation. + /// Gets the shared blender for the "HardLightDestOut" composition equation. /// - public sealed class HardLightDestOut : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDestOut Instance { get; } = new(); - } + public static PixelBlender HardLightDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "NormalClear" composition equation. + /// Gets the shared blender for the "NormalClear" composition equation. /// - public sealed class NormalClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalClear Instance { get; } = new(); - } + public static PixelBlender NormalClear => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyClear" composition equation. + /// Gets the shared blender for the "MultiplyClear" composition equation. /// - public sealed class MultiplyClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyClear Instance { get; } = new(); - } + public static PixelBlender MultiplyClear => PixelBlender.Instance; /// - /// Blends pixels with the "AddClear" composition equation. + /// Gets the shared blender for the "AddClear" composition equation. /// - public sealed class AddClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddClear Instance { get; } = new(); - } + public static PixelBlender AddClear => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractClear" composition equation. + /// Gets the shared blender for the "SubtractClear" composition equation. /// - public sealed class SubtractClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractClear Instance { get; } = new(); - } + public static PixelBlender SubtractClear => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenClear" composition equation. + /// Gets the shared blender for the "ScreenClear" composition equation. /// - public sealed class ScreenClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenClear Instance { get; } = new(); - } + public static PixelBlender ScreenClear => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenClear" composition equation. + /// Gets the shared blender for the "DarkenClear" composition equation. /// - public sealed class DarkenClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenClear Instance { get; } = new(); - } + public static PixelBlender DarkenClear => PixelBlender.Instance; /// - /// Blends pixels with the "LightenClear" composition equation. + /// Gets the shared blender for the "LightenClear" composition equation. /// - public sealed class LightenClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenClear Instance { get; } = new(); - } + public static PixelBlender LightenClear => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayClear" composition equation. + /// Gets the shared blender for the "OverlayClear" composition equation. /// - public sealed class OverlayClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayClear Instance { get; } = new(); - } + public static PixelBlender OverlayClear => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightClear" composition equation. + /// Gets the shared blender for the "HardLightClear" composition equation. /// - public sealed class HardLightClear : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightClear Instance { get; } = new(); - } + public static PixelBlender HardLightClear => PixelBlender.Instance; /// - /// Blends pixels with the "NormalXor" composition equation. + /// Gets the shared blender for the "NormalXor" composition equation. /// - public sealed class NormalXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalXor Instance { get; } = new(); - } + public static PixelBlender NormalXor => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyXor" composition equation. + /// Gets the shared blender for the "MultiplyXor" composition equation. /// - public sealed class MultiplyXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyXor Instance { get; } = new(); - } + public static PixelBlender MultiplyXor => PixelBlender.Instance; /// - /// Blends pixels with the "AddXor" composition equation. + /// Gets the shared blender for the "AddXor" composition equation. /// - public sealed class AddXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddXor Instance { get; } = new(); - } + public static PixelBlender AddXor => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractXor" composition equation. + /// Gets the shared blender for the "SubtractXor" composition equation. /// - public sealed class SubtractXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractXor Instance { get; } = new(); - } + public static PixelBlender SubtractXor => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenXor" composition equation. + /// Gets the shared blender for the "ScreenXor" composition equation. /// - public sealed class ScreenXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenXor Instance { get; } = new(); - } + public static PixelBlender ScreenXor => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenXor" composition equation. + /// Gets the shared blender for the "DarkenXor" composition equation. /// - public sealed class DarkenXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenXor Instance { get; } = new(); - } + public static PixelBlender DarkenXor => PixelBlender.Instance; /// - /// Blends pixels with the "LightenXor" composition equation. + /// Gets the shared blender for the "LightenXor" composition equation. /// - public sealed class LightenXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenXor Instance { get; } = new(); - } + public static PixelBlender LightenXor => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayXor" composition equation. + /// Gets the shared blender for the "OverlayXor" composition equation. /// - public sealed class OverlayXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayXor Instance { get; } = new(); - } + public static PixelBlender OverlayXor => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightXor" composition equation. + /// Gets the shared blender for the "HardLightXor" composition equation. /// - public sealed class HardLightXor : - AssociatedAlphaPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightXor Instance { get; } = new(); - } + public static PixelBlender HardLightXor => PixelBlender.Instance; } diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.Generated.tt b/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.Generated.tt index 801d76328..5fc7f91c4 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.Generated.tt @@ -61,6 +61,9 @@ foreach (var composer in composers) /// public readonly struct <#= blenderComposer #> : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => true; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => AssociatedAlphaPorterDuffFunctions.<#= blenderComposer #>(background, source, amount); @@ -95,16 +98,9 @@ foreach (var composer in composers) var blenderComposer = $"{blender}{composer}"; #> /// - /// Blends pixels with the "<#= blenderComposer #>" composition equation. + /// Gets the shared blender for the "<#= blenderComposer #>" composition equation. /// - public sealed class <#= blenderComposer #> : - AssociatedAlphaPixelBlender> - { - /// - /// Gets the shared blender instance. - /// - public static <#= blenderComposer #> Instance { get; } = new(); - } + public static PixelBlender <#= blenderComposer #> => PixelBlender>.Instance; <# } diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.cs b/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.cs index 6ce1235b4..0664e3fa0 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlenders.cs @@ -21,147 +21,147 @@ internal static partial class AssociatedAlphaPixelBlenders { PixelAlphaCompositionMode.Src => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplySrc.Instance, - PixelColorBlendingMode.Add => AddSrc.Instance, - PixelColorBlendingMode.Subtract => SubtractSrc.Instance, - PixelColorBlendingMode.Screen => ScreenSrc.Instance, - PixelColorBlendingMode.Darken => DarkenSrc.Instance, - PixelColorBlendingMode.Lighten => LightenSrc.Instance, - PixelColorBlendingMode.Overlay => OverlaySrc.Instance, - PixelColorBlendingMode.HardLight => HardLightSrc.Instance, - _ => NormalSrc.Instance, + PixelColorBlendingMode.Multiply => MultiplySrc, + PixelColorBlendingMode.Add => AddSrc, + PixelColorBlendingMode.Subtract => SubtractSrc, + PixelColorBlendingMode.Screen => ScreenSrc, + PixelColorBlendingMode.Darken => DarkenSrc, + PixelColorBlendingMode.Lighten => LightenSrc, + PixelColorBlendingMode.Overlay => OverlaySrc, + PixelColorBlendingMode.HardLight => HardLightSrc, + _ => NormalSrc, }, PixelAlphaCompositionMode.SrcAtop => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplySrcAtop.Instance, - PixelColorBlendingMode.Add => AddSrcAtop.Instance, - PixelColorBlendingMode.Subtract => SubtractSrcAtop.Instance, - PixelColorBlendingMode.Screen => ScreenSrcAtop.Instance, - PixelColorBlendingMode.Darken => DarkenSrcAtop.Instance, - PixelColorBlendingMode.Lighten => LightenSrcAtop.Instance, - PixelColorBlendingMode.Overlay => OverlaySrcAtop.Instance, - PixelColorBlendingMode.HardLight => HardLightSrcAtop.Instance, - _ => NormalSrcAtop.Instance, + PixelColorBlendingMode.Multiply => MultiplySrcAtop, + PixelColorBlendingMode.Add => AddSrcAtop, + PixelColorBlendingMode.Subtract => SubtractSrcAtop, + PixelColorBlendingMode.Screen => ScreenSrcAtop, + PixelColorBlendingMode.Darken => DarkenSrcAtop, + PixelColorBlendingMode.Lighten => LightenSrcAtop, + PixelColorBlendingMode.Overlay => OverlaySrcAtop, + PixelColorBlendingMode.HardLight => HardLightSrcAtop, + _ => NormalSrcAtop, }, PixelAlphaCompositionMode.SrcIn => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplySrcIn.Instance, - PixelColorBlendingMode.Add => AddSrcIn.Instance, - PixelColorBlendingMode.Subtract => SubtractSrcIn.Instance, - PixelColorBlendingMode.Screen => ScreenSrcIn.Instance, - PixelColorBlendingMode.Darken => DarkenSrcIn.Instance, - PixelColorBlendingMode.Lighten => LightenSrcIn.Instance, - PixelColorBlendingMode.Overlay => OverlaySrcIn.Instance, - PixelColorBlendingMode.HardLight => HardLightSrcIn.Instance, - _ => NormalSrcIn.Instance, + PixelColorBlendingMode.Multiply => MultiplySrcIn, + PixelColorBlendingMode.Add => AddSrcIn, + PixelColorBlendingMode.Subtract => SubtractSrcIn, + PixelColorBlendingMode.Screen => ScreenSrcIn, + PixelColorBlendingMode.Darken => DarkenSrcIn, + PixelColorBlendingMode.Lighten => LightenSrcIn, + PixelColorBlendingMode.Overlay => OverlaySrcIn, + PixelColorBlendingMode.HardLight => HardLightSrcIn, + _ => NormalSrcIn, }, PixelAlphaCompositionMode.SrcOut => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplySrcOut.Instance, - PixelColorBlendingMode.Add => AddSrcOut.Instance, - PixelColorBlendingMode.Subtract => SubtractSrcOut.Instance, - PixelColorBlendingMode.Screen => ScreenSrcOut.Instance, - PixelColorBlendingMode.Darken => DarkenSrcOut.Instance, - PixelColorBlendingMode.Lighten => LightenSrcOut.Instance, - PixelColorBlendingMode.Overlay => OverlaySrcOut.Instance, - PixelColorBlendingMode.HardLight => HardLightSrcOut.Instance, - _ => NormalSrcOut.Instance, + PixelColorBlendingMode.Multiply => MultiplySrcOut, + PixelColorBlendingMode.Add => AddSrcOut, + PixelColorBlendingMode.Subtract => SubtractSrcOut, + PixelColorBlendingMode.Screen => ScreenSrcOut, + PixelColorBlendingMode.Darken => DarkenSrcOut, + PixelColorBlendingMode.Lighten => LightenSrcOut, + PixelColorBlendingMode.Overlay => OverlaySrcOut, + PixelColorBlendingMode.HardLight => HardLightSrcOut, + _ => NormalSrcOut, }, PixelAlphaCompositionMode.Dest => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplyDest.Instance, - PixelColorBlendingMode.Add => AddDest.Instance, - PixelColorBlendingMode.Subtract => SubtractDest.Instance, - PixelColorBlendingMode.Screen => ScreenDest.Instance, - PixelColorBlendingMode.Darken => DarkenDest.Instance, - PixelColorBlendingMode.Lighten => LightenDest.Instance, - PixelColorBlendingMode.Overlay => OverlayDest.Instance, - PixelColorBlendingMode.HardLight => HardLightDest.Instance, - _ => NormalDest.Instance, + PixelColorBlendingMode.Multiply => MultiplyDest, + PixelColorBlendingMode.Add => AddDest, + PixelColorBlendingMode.Subtract => SubtractDest, + PixelColorBlendingMode.Screen => ScreenDest, + PixelColorBlendingMode.Darken => DarkenDest, + PixelColorBlendingMode.Lighten => LightenDest, + PixelColorBlendingMode.Overlay => OverlayDest, + PixelColorBlendingMode.HardLight => HardLightDest, + _ => NormalDest, }, PixelAlphaCompositionMode.DestAtop => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplyDestAtop.Instance, - PixelColorBlendingMode.Add => AddDestAtop.Instance, - PixelColorBlendingMode.Subtract => SubtractDestAtop.Instance, - PixelColorBlendingMode.Screen => ScreenDestAtop.Instance, - PixelColorBlendingMode.Darken => DarkenDestAtop.Instance, - PixelColorBlendingMode.Lighten => LightenDestAtop.Instance, - PixelColorBlendingMode.Overlay => OverlayDestAtop.Instance, - PixelColorBlendingMode.HardLight => HardLightDestAtop.Instance, - _ => NormalDestAtop.Instance, + PixelColorBlendingMode.Multiply => MultiplyDestAtop, + PixelColorBlendingMode.Add => AddDestAtop, + PixelColorBlendingMode.Subtract => SubtractDestAtop, + PixelColorBlendingMode.Screen => ScreenDestAtop, + PixelColorBlendingMode.Darken => DarkenDestAtop, + PixelColorBlendingMode.Lighten => LightenDestAtop, + PixelColorBlendingMode.Overlay => OverlayDestAtop, + PixelColorBlendingMode.HardLight => HardLightDestAtop, + _ => NormalDestAtop, }, PixelAlphaCompositionMode.DestOver => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplyDestOver.Instance, - PixelColorBlendingMode.Add => AddDestOver.Instance, - PixelColorBlendingMode.Subtract => SubtractDestOver.Instance, - PixelColorBlendingMode.Screen => ScreenDestOver.Instance, - PixelColorBlendingMode.Darken => DarkenDestOver.Instance, - PixelColorBlendingMode.Lighten => LightenDestOver.Instance, - PixelColorBlendingMode.Overlay => OverlayDestOver.Instance, - PixelColorBlendingMode.HardLight => HardLightDestOver.Instance, - _ => NormalDestOver.Instance, + PixelColorBlendingMode.Multiply => MultiplyDestOver, + PixelColorBlendingMode.Add => AddDestOver, + PixelColorBlendingMode.Subtract => SubtractDestOver, + PixelColorBlendingMode.Screen => ScreenDestOver, + PixelColorBlendingMode.Darken => DarkenDestOver, + PixelColorBlendingMode.Lighten => LightenDestOver, + PixelColorBlendingMode.Overlay => OverlayDestOver, + PixelColorBlendingMode.HardLight => HardLightDestOver, + _ => NormalDestOver, }, PixelAlphaCompositionMode.DestIn => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplyDestIn.Instance, - PixelColorBlendingMode.Add => AddDestIn.Instance, - PixelColorBlendingMode.Subtract => SubtractDestIn.Instance, - PixelColorBlendingMode.Screen => ScreenDestIn.Instance, - PixelColorBlendingMode.Darken => DarkenDestIn.Instance, - PixelColorBlendingMode.Lighten => LightenDestIn.Instance, - PixelColorBlendingMode.Overlay => OverlayDestIn.Instance, - PixelColorBlendingMode.HardLight => HardLightDestIn.Instance, - _ => NormalDestIn.Instance, + PixelColorBlendingMode.Multiply => MultiplyDestIn, + PixelColorBlendingMode.Add => AddDestIn, + PixelColorBlendingMode.Subtract => SubtractDestIn, + PixelColorBlendingMode.Screen => ScreenDestIn, + PixelColorBlendingMode.Darken => DarkenDestIn, + PixelColorBlendingMode.Lighten => LightenDestIn, + PixelColorBlendingMode.Overlay => OverlayDestIn, + PixelColorBlendingMode.HardLight => HardLightDestIn, + _ => NormalDestIn, }, PixelAlphaCompositionMode.DestOut => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplyDestOut.Instance, - PixelColorBlendingMode.Add => AddDestOut.Instance, - PixelColorBlendingMode.Subtract => SubtractDestOut.Instance, - PixelColorBlendingMode.Screen => ScreenDestOut.Instance, - PixelColorBlendingMode.Darken => DarkenDestOut.Instance, - PixelColorBlendingMode.Lighten => LightenDestOut.Instance, - PixelColorBlendingMode.Overlay => OverlayDestOut.Instance, - PixelColorBlendingMode.HardLight => HardLightDestOut.Instance, - _ => NormalDestOut.Instance, + PixelColorBlendingMode.Multiply => MultiplyDestOut, + PixelColorBlendingMode.Add => AddDestOut, + PixelColorBlendingMode.Subtract => SubtractDestOut, + PixelColorBlendingMode.Screen => ScreenDestOut, + PixelColorBlendingMode.Darken => DarkenDestOut, + PixelColorBlendingMode.Lighten => LightenDestOut, + PixelColorBlendingMode.Overlay => OverlayDestOut, + PixelColorBlendingMode.HardLight => HardLightDestOut, + _ => NormalDestOut, }, PixelAlphaCompositionMode.Clear => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplyClear.Instance, - PixelColorBlendingMode.Add => AddClear.Instance, - PixelColorBlendingMode.Subtract => SubtractClear.Instance, - PixelColorBlendingMode.Screen => ScreenClear.Instance, - PixelColorBlendingMode.Darken => DarkenClear.Instance, - PixelColorBlendingMode.Lighten => LightenClear.Instance, - PixelColorBlendingMode.Overlay => OverlayClear.Instance, - PixelColorBlendingMode.HardLight => HardLightClear.Instance, - _ => NormalClear.Instance, + PixelColorBlendingMode.Multiply => MultiplyClear, + PixelColorBlendingMode.Add => AddClear, + PixelColorBlendingMode.Subtract => SubtractClear, + PixelColorBlendingMode.Screen => ScreenClear, + PixelColorBlendingMode.Darken => DarkenClear, + PixelColorBlendingMode.Lighten => LightenClear, + PixelColorBlendingMode.Overlay => OverlayClear, + PixelColorBlendingMode.HardLight => HardLightClear, + _ => NormalClear, }, PixelAlphaCompositionMode.Xor => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplyXor.Instance, - PixelColorBlendingMode.Add => AddXor.Instance, - PixelColorBlendingMode.Subtract => SubtractXor.Instance, - PixelColorBlendingMode.Screen => ScreenXor.Instance, - PixelColorBlendingMode.Darken => DarkenXor.Instance, - PixelColorBlendingMode.Lighten => LightenXor.Instance, - PixelColorBlendingMode.Overlay => OverlayXor.Instance, - PixelColorBlendingMode.HardLight => HardLightXor.Instance, - _ => NormalXor.Instance, + PixelColorBlendingMode.Multiply => MultiplyXor, + PixelColorBlendingMode.Add => AddXor, + PixelColorBlendingMode.Subtract => SubtractXor, + PixelColorBlendingMode.Screen => ScreenXor, + PixelColorBlendingMode.Darken => DarkenXor, + PixelColorBlendingMode.Lighten => LightenXor, + PixelColorBlendingMode.Overlay => OverlayXor, + PixelColorBlendingMode.HardLight => HardLightXor, + _ => NormalXor, }, _ => colorMode switch { - PixelColorBlendingMode.Multiply => MultiplySrcOver.Instance, - PixelColorBlendingMode.Add => AddSrcOver.Instance, - PixelColorBlendingMode.Subtract => SubtractSrcOver.Instance, - PixelColorBlendingMode.Screen => ScreenSrcOver.Instance, - PixelColorBlendingMode.Darken => DarkenSrcOver.Instance, - PixelColorBlendingMode.Lighten => LightenSrcOver.Instance, - PixelColorBlendingMode.Overlay => OverlaySrcOver.Instance, - PixelColorBlendingMode.HardLight => HardLightSrcOver.Instance, - _ => NormalSrcOver.Instance, + PixelColorBlendingMode.Multiply => MultiplySrcOver, + PixelColorBlendingMode.Add => AddSrcOver, + PixelColorBlendingMode.Subtract => SubtractSrcOver, + PixelColorBlendingMode.Screen => ScreenSrcOver, + PixelColorBlendingMode.Darken => DarkenSrcOver, + PixelColorBlendingMode.Lighten => LightenSrcOver, + PixelColorBlendingMode.Overlay => OverlaySrcOver, + PixelColorBlendingMode.HardLight => HardLightSrcOver, + _ => NormalSrcOver, }, }; } diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlender{TPixel,TOperator}.cs b/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlender{TPixel,TOperator}.cs deleted file mode 100644 index 81a3f24a8..000000000 --- a/src/ImageSharp/PixelFormats/PixelBlenders/AssociatedAlphaPixelBlender{TPixel,TOperator}.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Six Labors. -// Licensed under the Six Labors Split License. - -using System.Numerics; - -namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders; - -/// -/// Provides the vector representation used to blend pixels that store associated alpha. -/// -/// The associated-alpha pixel format. -/// The Porter-Duff equation. -internal abstract class AssociatedAlphaPixelBlender : PixelBlender - where TPixel : unmanaged, IPixel - where TOperator : struct, IPixelBlenderOperator -{ - private static readonly PixelOperations Operations = PixelOperations.Instance; - - /// - public sealed override TPixel Blend(TPixel background, TPixel source, float amount) - { - // Associated RGB and alpha must remain in their stored representation throughout composition. - Vector4 result = TOperator.Invoke(background.ToAssociatedScaledVector4(), source.ToAssociatedScaledVector4(), Numerics.Clamp(amount, 0, 1F)); - - return TPixel.FromAssociatedScaledVector4(result); - } - - /// - protected override void ToBlendVector4( - Configuration configuration, - ReadOnlySpan source, - Span destination) - { - // Selecting the source representation once per row avoids a format check for every blended pixel. - PixelOperations.Instance.ToVector4(configuration, source, destination, PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply); - } - - /// - protected override Vector4 ToBlendVector4(TPixel source) => source.ToAssociatedScaledVector4(); - - /// - protected override void FromBlendVector4( - Configuration configuration, - Span source, - Span destination) - { - Operations.FromVector4Destructive(configuration, source, destination, PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply); - } -} diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs index 2ff4660b7..298c35999 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs @@ -17,6 +17,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalSrc(background, source, amount); @@ -35,6 +38,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplySrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplySrc(background, source, amount); @@ -53,6 +59,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddSrc(background, source, amount); @@ -71,6 +80,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractSrc(background, source, amount); @@ -89,6 +101,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenSrc(background, source, amount); @@ -107,6 +122,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenSrc(background, source, amount); @@ -125,6 +143,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenSrc(background, source, amount); @@ -143,6 +164,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlaySrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlaySrc(background, source, amount); @@ -161,6 +185,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightSrc : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightSrc(background, source, amount); @@ -179,6 +206,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalSrcAtop(background, source, amount); @@ -197,6 +227,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplySrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplySrcAtop(background, source, amount); @@ -215,6 +248,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddSrcAtop(background, source, amount); @@ -233,6 +269,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractSrcAtop(background, source, amount); @@ -251,6 +290,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenSrcAtop(background, source, amount); @@ -269,6 +311,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenSrcAtop(background, source, amount); @@ -287,6 +332,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenSrcAtop(background, source, amount); @@ -305,6 +353,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlaySrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlaySrcAtop(background, source, amount); @@ -323,6 +374,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightSrcAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightSrcAtop(background, source, amount); @@ -341,6 +395,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalSrcOver(background, source, amount); @@ -359,6 +416,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplySrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplySrcOver(background, source, amount); @@ -377,6 +437,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddSrcOver(background, source, amount); @@ -395,6 +458,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractSrcOver(background, source, amount); @@ -413,6 +479,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenSrcOver(background, source, amount); @@ -431,6 +500,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenSrcOver(background, source, amount); @@ -449,6 +521,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenSrcOver(background, source, amount); @@ -467,6 +542,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlaySrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlaySrcOver(background, source, amount); @@ -485,6 +563,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightSrcOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightSrcOver(background, source, amount); @@ -503,6 +584,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalSrcIn(background, source, amount); @@ -521,6 +605,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplySrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplySrcIn(background, source, amount); @@ -539,6 +626,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddSrcIn(background, source, amount); @@ -557,6 +647,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractSrcIn(background, source, amount); @@ -575,6 +668,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenSrcIn(background, source, amount); @@ -593,6 +689,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenSrcIn(background, source, amount); @@ -611,6 +710,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenSrcIn(background, source, amount); @@ -629,6 +731,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlaySrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlaySrcIn(background, source, amount); @@ -647,6 +752,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightSrcIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightSrcIn(background, source, amount); @@ -665,6 +773,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalSrcOut(background, source, amount); @@ -683,6 +794,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplySrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplySrcOut(background, source, amount); @@ -701,6 +815,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddSrcOut(background, source, amount); @@ -719,6 +836,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractSrcOut(background, source, amount); @@ -737,6 +857,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenSrcOut(background, source, amount); @@ -755,6 +878,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenSrcOut(background, source, amount); @@ -773,6 +899,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenSrcOut(background, source, amount); @@ -791,6 +920,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlaySrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlaySrcOut(background, source, amount); @@ -809,6 +941,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightSrcOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightSrcOut(background, source, amount); @@ -827,6 +962,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalDest(background, source, amount); @@ -845,6 +983,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplyDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplyDest(background, source, amount); @@ -863,6 +1004,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddDest(background, source, amount); @@ -881,6 +1025,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractDest(background, source, amount); @@ -899,6 +1046,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenDest(background, source, amount); @@ -917,6 +1067,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenDest(background, source, amount); @@ -935,6 +1088,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenDest(background, source, amount); @@ -953,6 +1109,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlayDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlayDest(background, source, amount); @@ -971,6 +1130,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightDest : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightDest(background, source, amount); @@ -989,6 +1151,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalDestAtop(background, source, amount); @@ -1007,6 +1172,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplyDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplyDestAtop(background, source, amount); @@ -1025,6 +1193,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddDestAtop(background, source, amount); @@ -1043,6 +1214,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractDestAtop(background, source, amount); @@ -1061,6 +1235,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenDestAtop(background, source, amount); @@ -1079,6 +1256,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenDestAtop(background, source, amount); @@ -1097,6 +1277,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenDestAtop(background, source, amount); @@ -1115,6 +1298,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlayDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlayDestAtop(background, source, amount); @@ -1133,6 +1319,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightDestAtop : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightDestAtop(background, source, amount); @@ -1151,6 +1340,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalDestOver(background, source, amount); @@ -1169,6 +1361,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplyDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplyDestOver(background, source, amount); @@ -1187,6 +1382,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddDestOver(background, source, amount); @@ -1205,6 +1403,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractDestOver(background, source, amount); @@ -1223,6 +1424,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenDestOver(background, source, amount); @@ -1241,6 +1445,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenDestOver(background, source, amount); @@ -1259,6 +1466,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenDestOver(background, source, amount); @@ -1277,6 +1487,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlayDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlayDestOver(background, source, amount); @@ -1295,6 +1508,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightDestOver : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightDestOver(background, source, amount); @@ -1313,6 +1529,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalDestIn(background, source, amount); @@ -1331,6 +1550,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplyDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplyDestIn(background, source, amount); @@ -1349,6 +1571,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddDestIn(background, source, amount); @@ -1367,6 +1592,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractDestIn(background, source, amount); @@ -1385,6 +1613,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenDestIn(background, source, amount); @@ -1403,6 +1634,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenDestIn(background, source, amount); @@ -1421,6 +1655,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenDestIn(background, source, amount); @@ -1439,6 +1676,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlayDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlayDestIn(background, source, amount); @@ -1457,6 +1697,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightDestIn : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightDestIn(background, source, amount); @@ -1475,6 +1718,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalDestOut(background, source, amount); @@ -1493,6 +1739,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplyDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplyDestOut(background, source, amount); @@ -1511,6 +1760,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddDestOut(background, source, amount); @@ -1529,6 +1781,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractDestOut(background, source, amount); @@ -1547,6 +1802,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenDestOut(background, source, amount); @@ -1565,6 +1823,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenDestOut(background, source, amount); @@ -1583,6 +1844,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenDestOut(background, source, amount); @@ -1601,6 +1865,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlayDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlayDestOut(background, source, amount); @@ -1619,6 +1886,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightDestOut : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightDestOut(background, source, amount); @@ -1637,6 +1907,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalClear(background, source, amount); @@ -1655,6 +1928,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplyClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplyClear(background, source, amount); @@ -1673,6 +1949,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddClear(background, source, amount); @@ -1691,6 +1970,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractClear(background, source, amount); @@ -1709,6 +1991,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenClear(background, source, amount); @@ -1727,6 +2012,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenClear(background, source, amount); @@ -1745,6 +2033,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenClear(background, source, amount); @@ -1763,6 +2054,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlayClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlayClear(background, source, amount); @@ -1781,6 +2075,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightClear : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightClear(background, source, amount); @@ -1799,6 +2096,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct NormalXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.NormalXor(background, source, amount); @@ -1817,6 +2117,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct MultiplyXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.MultiplyXor(background, source, amount); @@ -1835,6 +2138,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct AddXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.AddXor(background, source, amount); @@ -1853,6 +2159,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct SubtractXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.SubtractXor(background, source, amount); @@ -1871,6 +2180,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct ScreenXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.ScreenXor(background, source, amount); @@ -1889,6 +2201,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct DarkenXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.DarkenXor(background, source, amount); @@ -1907,6 +2222,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct LightenXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.LightenXor(background, source, amount); @@ -1925,6 +2243,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct OverlayXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.OverlayXor(background, source, amount); @@ -1943,6 +2264,9 @@ internal static class DefaultPixelBlenderOperators /// public readonly struct HardLightXor : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.HardLightXor(background, source, amount); @@ -1966,1299 +2290,543 @@ internal static class DefaultPixelBlenders where TPixel : unmanaged, IPixel { /// - /// Blends pixels with the "NormalSrc" composition equation. + /// Gets the shared blender for the "NormalSrc" composition equation. /// - public sealed class NormalSrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrc Instance { get; } = new(); - } + public static PixelBlender NormalSrc => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrc" composition equation. + /// Gets the shared blender for the "MultiplySrc" composition equation. /// - public sealed class MultiplySrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrc Instance { get; } = new(); - } + public static PixelBlender MultiplySrc => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrc" composition equation. + /// Gets the shared blender for the "AddSrc" composition equation. /// - public sealed class AddSrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrc Instance { get; } = new(); - } + public static PixelBlender AddSrc => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrc" composition equation. + /// Gets the shared blender for the "SubtractSrc" composition equation. /// - public sealed class SubtractSrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrc Instance { get; } = new(); - } + public static PixelBlender SubtractSrc => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrc" composition equation. + /// Gets the shared blender for the "ScreenSrc" composition equation. /// - public sealed class ScreenSrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrc Instance { get; } = new(); - } + public static PixelBlender ScreenSrc => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrc" composition equation. + /// Gets the shared blender for the "DarkenSrc" composition equation. /// - public sealed class DarkenSrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrc Instance { get; } = new(); - } + public static PixelBlender DarkenSrc => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrc" composition equation. + /// Gets the shared blender for the "LightenSrc" composition equation. /// - public sealed class LightenSrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrc Instance { get; } = new(); - } + public static PixelBlender LightenSrc => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrc" composition equation. + /// Gets the shared blender for the "OverlaySrc" composition equation. /// - public sealed class OverlaySrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrc Instance { get; } = new(); - } + public static PixelBlender OverlaySrc => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrc" composition equation. + /// Gets the shared blender for the "HardLightSrc" composition equation. /// - public sealed class HardLightSrc : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrc Instance { get; } = new(); - } + public static PixelBlender HardLightSrc => PixelBlender.Instance; /// - /// Blends pixels with the "NormalSrcAtop" composition equation. + /// Gets the shared blender for the "NormalSrcAtop" composition equation. /// - public sealed class NormalSrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrcAtop Instance { get; } = new(); - } + public static PixelBlender NormalSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrcAtop" composition equation. + /// Gets the shared blender for the "MultiplySrcAtop" composition equation. /// - public sealed class MultiplySrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrcAtop Instance { get; } = new(); - } + public static PixelBlender MultiplySrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrcAtop" composition equation. + /// Gets the shared blender for the "AddSrcAtop" composition equation. /// - public sealed class AddSrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrcAtop Instance { get; } = new(); - } + public static PixelBlender AddSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrcAtop" composition equation. + /// Gets the shared blender for the "SubtractSrcAtop" composition equation. /// - public sealed class SubtractSrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrcAtop Instance { get; } = new(); - } + public static PixelBlender SubtractSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrcAtop" composition equation. + /// Gets the shared blender for the "ScreenSrcAtop" composition equation. /// - public sealed class ScreenSrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrcAtop Instance { get; } = new(); - } + public static PixelBlender ScreenSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrcAtop" composition equation. + /// Gets the shared blender for the "DarkenSrcAtop" composition equation. /// - public sealed class DarkenSrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrcAtop Instance { get; } = new(); - } + public static PixelBlender DarkenSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrcAtop" composition equation. + /// Gets the shared blender for the "LightenSrcAtop" composition equation. /// - public sealed class LightenSrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrcAtop Instance { get; } = new(); - } + public static PixelBlender LightenSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrcAtop" composition equation. + /// Gets the shared blender for the "OverlaySrcAtop" composition equation. /// - public sealed class OverlaySrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrcAtop Instance { get; } = new(); - } + public static PixelBlender OverlaySrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrcAtop" composition equation. + /// Gets the shared blender for the "HardLightSrcAtop" composition equation. /// - public sealed class HardLightSrcAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrcAtop Instance { get; } = new(); - } + public static PixelBlender HardLightSrcAtop => PixelBlender.Instance; /// - /// Blends pixels with the "NormalSrcOver" composition equation. + /// Gets the shared blender for the "NormalSrcOver" composition equation. /// - public sealed class NormalSrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrcOver Instance { get; } = new(); - } + public static PixelBlender NormalSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrcOver" composition equation. + /// Gets the shared blender for the "MultiplySrcOver" composition equation. /// - public sealed class MultiplySrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrcOver Instance { get; } = new(); - } + public static PixelBlender MultiplySrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrcOver" composition equation. + /// Gets the shared blender for the "AddSrcOver" composition equation. /// - public sealed class AddSrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrcOver Instance { get; } = new(); - } + public static PixelBlender AddSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrcOver" composition equation. + /// Gets the shared blender for the "SubtractSrcOver" composition equation. /// - public sealed class SubtractSrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrcOver Instance { get; } = new(); - } + public static PixelBlender SubtractSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrcOver" composition equation. + /// Gets the shared blender for the "ScreenSrcOver" composition equation. /// - public sealed class ScreenSrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrcOver Instance { get; } = new(); - } + public static PixelBlender ScreenSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrcOver" composition equation. + /// Gets the shared blender for the "DarkenSrcOver" composition equation. /// - public sealed class DarkenSrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrcOver Instance { get; } = new(); - } + public static PixelBlender DarkenSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrcOver" composition equation. + /// Gets the shared blender for the "LightenSrcOver" composition equation. /// - public sealed class LightenSrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrcOver Instance { get; } = new(); - } + public static PixelBlender LightenSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrcOver" composition equation. + /// Gets the shared blender for the "OverlaySrcOver" composition equation. /// - public sealed class OverlaySrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrcOver Instance { get; } = new(); - } + public static PixelBlender OverlaySrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrcOver" composition equation. + /// Gets the shared blender for the "HardLightSrcOver" composition equation. /// - public sealed class HardLightSrcOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrcOver Instance { get; } = new(); - } + public static PixelBlender HardLightSrcOver => PixelBlender.Instance; /// - /// Blends pixels with the "NormalSrcIn" composition equation. + /// Gets the shared blender for the "NormalSrcIn" composition equation. /// - public sealed class NormalSrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrcIn Instance { get; } = new(); - } + public static PixelBlender NormalSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrcIn" composition equation. + /// Gets the shared blender for the "MultiplySrcIn" composition equation. /// - public sealed class MultiplySrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrcIn Instance { get; } = new(); - } + public static PixelBlender MultiplySrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrcIn" composition equation. + /// Gets the shared blender for the "AddSrcIn" composition equation. /// - public sealed class AddSrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrcIn Instance { get; } = new(); - } + public static PixelBlender AddSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrcIn" composition equation. + /// Gets the shared blender for the "SubtractSrcIn" composition equation. /// - public sealed class SubtractSrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrcIn Instance { get; } = new(); - } + public static PixelBlender SubtractSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrcIn" composition equation. + /// Gets the shared blender for the "ScreenSrcIn" composition equation. /// - public sealed class ScreenSrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrcIn Instance { get; } = new(); - } + public static PixelBlender ScreenSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrcIn" composition equation. + /// Gets the shared blender for the "DarkenSrcIn" composition equation. /// - public sealed class DarkenSrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrcIn Instance { get; } = new(); - } + public static PixelBlender DarkenSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrcIn" composition equation. + /// Gets the shared blender for the "LightenSrcIn" composition equation. /// - public sealed class LightenSrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrcIn Instance { get; } = new(); - } + public static PixelBlender LightenSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrcIn" composition equation. + /// Gets the shared blender for the "OverlaySrcIn" composition equation. /// - public sealed class OverlaySrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrcIn Instance { get; } = new(); - } + public static PixelBlender OverlaySrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrcIn" composition equation. + /// Gets the shared blender for the "HardLightSrcIn" composition equation. /// - public sealed class HardLightSrcIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrcIn Instance { get; } = new(); - } + public static PixelBlender HardLightSrcIn => PixelBlender.Instance; /// - /// Blends pixels with the "NormalSrcOut" composition equation. + /// Gets the shared blender for the "NormalSrcOut" composition equation. /// - public sealed class NormalSrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalSrcOut Instance { get; } = new(); - } + public static PixelBlender NormalSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplySrcOut" composition equation. + /// Gets the shared blender for the "MultiplySrcOut" composition equation. /// - public sealed class MultiplySrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplySrcOut Instance { get; } = new(); - } + public static PixelBlender MultiplySrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "AddSrcOut" composition equation. + /// Gets the shared blender for the "AddSrcOut" composition equation. /// - public sealed class AddSrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddSrcOut Instance { get; } = new(); - } + public static PixelBlender AddSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractSrcOut" composition equation. + /// Gets the shared blender for the "SubtractSrcOut" composition equation. /// - public sealed class SubtractSrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractSrcOut Instance { get; } = new(); - } + public static PixelBlender SubtractSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenSrcOut" composition equation. + /// Gets the shared blender for the "ScreenSrcOut" composition equation. /// - public sealed class ScreenSrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenSrcOut Instance { get; } = new(); - } + public static PixelBlender ScreenSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenSrcOut" composition equation. + /// Gets the shared blender for the "DarkenSrcOut" composition equation. /// - public sealed class DarkenSrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenSrcOut Instance { get; } = new(); - } + public static PixelBlender DarkenSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "LightenSrcOut" composition equation. + /// Gets the shared blender for the "LightenSrcOut" composition equation. /// - public sealed class LightenSrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenSrcOut Instance { get; } = new(); - } + public static PixelBlender LightenSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "OverlaySrcOut" composition equation. + /// Gets the shared blender for the "OverlaySrcOut" composition equation. /// - public sealed class OverlaySrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlaySrcOut Instance { get; } = new(); - } + public static PixelBlender OverlaySrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightSrcOut" composition equation. + /// Gets the shared blender for the "HardLightSrcOut" composition equation. /// - public sealed class HardLightSrcOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightSrcOut Instance { get; } = new(); - } + public static PixelBlender HardLightSrcOut => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDest" composition equation. + /// Gets the shared blender for the "NormalDest" composition equation. /// - public sealed class NormalDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDest Instance { get; } = new(); - } + public static PixelBlender NormalDest => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDest" composition equation. + /// Gets the shared blender for the "MultiplyDest" composition equation. /// - public sealed class MultiplyDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDest Instance { get; } = new(); - } + public static PixelBlender MultiplyDest => PixelBlender.Instance; /// - /// Blends pixels with the "AddDest" composition equation. + /// Gets the shared blender for the "AddDest" composition equation. /// - public sealed class AddDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDest Instance { get; } = new(); - } + public static PixelBlender AddDest => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDest" composition equation. + /// Gets the shared blender for the "SubtractDest" composition equation. /// - public sealed class SubtractDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDest Instance { get; } = new(); - } + public static PixelBlender SubtractDest => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDest" composition equation. + /// Gets the shared blender for the "ScreenDest" composition equation. /// - public sealed class ScreenDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDest Instance { get; } = new(); - } + public static PixelBlender ScreenDest => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDest" composition equation. + /// Gets the shared blender for the "DarkenDest" composition equation. /// - public sealed class DarkenDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDest Instance { get; } = new(); - } + public static PixelBlender DarkenDest => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDest" composition equation. + /// Gets the shared blender for the "LightenDest" composition equation. /// - public sealed class LightenDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDest Instance { get; } = new(); - } + public static PixelBlender LightenDest => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDest" composition equation. + /// Gets the shared blender for the "OverlayDest" composition equation. /// - public sealed class OverlayDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDest Instance { get; } = new(); - } + public static PixelBlender OverlayDest => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDest" composition equation. + /// Gets the shared blender for the "HardLightDest" composition equation. /// - public sealed class HardLightDest : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDest Instance { get; } = new(); - } + public static PixelBlender HardLightDest => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDestAtop" composition equation. + /// Gets the shared blender for the "NormalDestAtop" composition equation. /// - public sealed class NormalDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDestAtop Instance { get; } = new(); - } + public static PixelBlender NormalDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDestAtop" composition equation. + /// Gets the shared blender for the "MultiplyDestAtop" composition equation. /// - public sealed class MultiplyDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDestAtop Instance { get; } = new(); - } + public static PixelBlender MultiplyDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "AddDestAtop" composition equation. + /// Gets the shared blender for the "AddDestAtop" composition equation. /// - public sealed class AddDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDestAtop Instance { get; } = new(); - } + public static PixelBlender AddDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDestAtop" composition equation. + /// Gets the shared blender for the "SubtractDestAtop" composition equation. /// - public sealed class SubtractDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDestAtop Instance { get; } = new(); - } + public static PixelBlender SubtractDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDestAtop" composition equation. + /// Gets the shared blender for the "ScreenDestAtop" composition equation. /// - public sealed class ScreenDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDestAtop Instance { get; } = new(); - } + public static PixelBlender ScreenDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDestAtop" composition equation. + /// Gets the shared blender for the "DarkenDestAtop" composition equation. /// - public sealed class DarkenDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDestAtop Instance { get; } = new(); - } + public static PixelBlender DarkenDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDestAtop" composition equation. + /// Gets the shared blender for the "LightenDestAtop" composition equation. /// - public sealed class LightenDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDestAtop Instance { get; } = new(); - } + public static PixelBlender LightenDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDestAtop" composition equation. + /// Gets the shared blender for the "OverlayDestAtop" composition equation. /// - public sealed class OverlayDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDestAtop Instance { get; } = new(); - } + public static PixelBlender OverlayDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDestAtop" composition equation. + /// Gets the shared blender for the "HardLightDestAtop" composition equation. /// - public sealed class HardLightDestAtop : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDestAtop Instance { get; } = new(); - } + public static PixelBlender HardLightDestAtop => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDestOver" composition equation. + /// Gets the shared blender for the "NormalDestOver" composition equation. /// - public sealed class NormalDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDestOver Instance { get; } = new(); - } + public static PixelBlender NormalDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDestOver" composition equation. + /// Gets the shared blender for the "MultiplyDestOver" composition equation. /// - public sealed class MultiplyDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDestOver Instance { get; } = new(); - } + public static PixelBlender MultiplyDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "AddDestOver" composition equation. + /// Gets the shared blender for the "AddDestOver" composition equation. /// - public sealed class AddDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDestOver Instance { get; } = new(); - } + public static PixelBlender AddDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDestOver" composition equation. + /// Gets the shared blender for the "SubtractDestOver" composition equation. /// - public sealed class SubtractDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDestOver Instance { get; } = new(); - } + public static PixelBlender SubtractDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDestOver" composition equation. + /// Gets the shared blender for the "ScreenDestOver" composition equation. /// - public sealed class ScreenDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDestOver Instance { get; } = new(); - } + public static PixelBlender ScreenDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDestOver" composition equation. + /// Gets the shared blender for the "DarkenDestOver" composition equation. /// - public sealed class DarkenDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDestOver Instance { get; } = new(); - } + public static PixelBlender DarkenDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDestOver" composition equation. + /// Gets the shared blender for the "LightenDestOver" composition equation. /// - public sealed class LightenDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDestOver Instance { get; } = new(); - } + public static PixelBlender LightenDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDestOver" composition equation. + /// Gets the shared blender for the "OverlayDestOver" composition equation. /// - public sealed class OverlayDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDestOver Instance { get; } = new(); - } + public static PixelBlender OverlayDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDestOver" composition equation. + /// Gets the shared blender for the "HardLightDestOver" composition equation. /// - public sealed class HardLightDestOver : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDestOver Instance { get; } = new(); - } + public static PixelBlender HardLightDestOver => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDestIn" composition equation. + /// Gets the shared blender for the "NormalDestIn" composition equation. /// - public sealed class NormalDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDestIn Instance { get; } = new(); - } + public static PixelBlender NormalDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDestIn" composition equation. + /// Gets the shared blender for the "MultiplyDestIn" composition equation. /// - public sealed class MultiplyDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDestIn Instance { get; } = new(); - } + public static PixelBlender MultiplyDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "AddDestIn" composition equation. + /// Gets the shared blender for the "AddDestIn" composition equation. /// - public sealed class AddDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDestIn Instance { get; } = new(); - } + public static PixelBlender AddDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDestIn" composition equation. + /// Gets the shared blender for the "SubtractDestIn" composition equation. /// - public sealed class SubtractDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDestIn Instance { get; } = new(); - } + public static PixelBlender SubtractDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDestIn" composition equation. + /// Gets the shared blender for the "ScreenDestIn" composition equation. /// - public sealed class ScreenDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDestIn Instance { get; } = new(); - } + public static PixelBlender ScreenDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDestIn" composition equation. + /// Gets the shared blender for the "DarkenDestIn" composition equation. /// - public sealed class DarkenDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDestIn Instance { get; } = new(); - } + public static PixelBlender DarkenDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDestIn" composition equation. + /// Gets the shared blender for the "LightenDestIn" composition equation. /// - public sealed class LightenDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDestIn Instance { get; } = new(); - } + public static PixelBlender LightenDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDestIn" composition equation. + /// Gets the shared blender for the "OverlayDestIn" composition equation. /// - public sealed class OverlayDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDestIn Instance { get; } = new(); - } + public static PixelBlender OverlayDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDestIn" composition equation. + /// Gets the shared blender for the "HardLightDestIn" composition equation. /// - public sealed class HardLightDestIn : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDestIn Instance { get; } = new(); - } + public static PixelBlender HardLightDestIn => PixelBlender.Instance; /// - /// Blends pixels with the "NormalDestOut" composition equation. + /// Gets the shared blender for the "NormalDestOut" composition equation. /// - public sealed class NormalDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalDestOut Instance { get; } = new(); - } + public static PixelBlender NormalDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyDestOut" composition equation. + /// Gets the shared blender for the "MultiplyDestOut" composition equation. /// - public sealed class MultiplyDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyDestOut Instance { get; } = new(); - } + public static PixelBlender MultiplyDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "AddDestOut" composition equation. + /// Gets the shared blender for the "AddDestOut" composition equation. /// - public sealed class AddDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddDestOut Instance { get; } = new(); - } + public static PixelBlender AddDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractDestOut" composition equation. + /// Gets the shared blender for the "SubtractDestOut" composition equation. /// - public sealed class SubtractDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractDestOut Instance { get; } = new(); - } + public static PixelBlender SubtractDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenDestOut" composition equation. + /// Gets the shared blender for the "ScreenDestOut" composition equation. /// - public sealed class ScreenDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenDestOut Instance { get; } = new(); - } + public static PixelBlender ScreenDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenDestOut" composition equation. + /// Gets the shared blender for the "DarkenDestOut" composition equation. /// - public sealed class DarkenDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenDestOut Instance { get; } = new(); - } + public static PixelBlender DarkenDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "LightenDestOut" composition equation. + /// Gets the shared blender for the "LightenDestOut" composition equation. /// - public sealed class LightenDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenDestOut Instance { get; } = new(); - } + public static PixelBlender LightenDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayDestOut" composition equation. + /// Gets the shared blender for the "OverlayDestOut" composition equation. /// - public sealed class OverlayDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayDestOut Instance { get; } = new(); - } + public static PixelBlender OverlayDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightDestOut" composition equation. + /// Gets the shared blender for the "HardLightDestOut" composition equation. /// - public sealed class HardLightDestOut : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightDestOut Instance { get; } = new(); - } + public static PixelBlender HardLightDestOut => PixelBlender.Instance; /// - /// Blends pixels with the "NormalClear" composition equation. + /// Gets the shared blender for the "NormalClear" composition equation. /// - public sealed class NormalClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalClear Instance { get; } = new(); - } + public static PixelBlender NormalClear => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyClear" composition equation. + /// Gets the shared blender for the "MultiplyClear" composition equation. /// - public sealed class MultiplyClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyClear Instance { get; } = new(); - } + public static PixelBlender MultiplyClear => PixelBlender.Instance; /// - /// Blends pixels with the "AddClear" composition equation. + /// Gets the shared blender for the "AddClear" composition equation. /// - public sealed class AddClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddClear Instance { get; } = new(); - } + public static PixelBlender AddClear => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractClear" composition equation. + /// Gets the shared blender for the "SubtractClear" composition equation. /// - public sealed class SubtractClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractClear Instance { get; } = new(); - } + public static PixelBlender SubtractClear => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenClear" composition equation. + /// Gets the shared blender for the "ScreenClear" composition equation. /// - public sealed class ScreenClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenClear Instance { get; } = new(); - } + public static PixelBlender ScreenClear => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenClear" composition equation. + /// Gets the shared blender for the "DarkenClear" composition equation. /// - public sealed class DarkenClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenClear Instance { get; } = new(); - } + public static PixelBlender DarkenClear => PixelBlender.Instance; /// - /// Blends pixels with the "LightenClear" composition equation. + /// Gets the shared blender for the "LightenClear" composition equation. /// - public sealed class LightenClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenClear Instance { get; } = new(); - } + public static PixelBlender LightenClear => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayClear" composition equation. + /// Gets the shared blender for the "OverlayClear" composition equation. /// - public sealed class OverlayClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayClear Instance { get; } = new(); - } + public static PixelBlender OverlayClear => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightClear" composition equation. + /// Gets the shared blender for the "HardLightClear" composition equation. /// - public sealed class HardLightClear : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightClear Instance { get; } = new(); - } + public static PixelBlender HardLightClear => PixelBlender.Instance; /// - /// Blends pixels with the "NormalXor" composition equation. + /// Gets the shared blender for the "NormalXor" composition equation. /// - public sealed class NormalXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static NormalXor Instance { get; } = new(); - } + public static PixelBlender NormalXor => PixelBlender.Instance; /// - /// Blends pixels with the "MultiplyXor" composition equation. + /// Gets the shared blender for the "MultiplyXor" composition equation. /// - public sealed class MultiplyXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static MultiplyXor Instance { get; } = new(); - } + public static PixelBlender MultiplyXor => PixelBlender.Instance; /// - /// Blends pixels with the "AddXor" composition equation. + /// Gets the shared blender for the "AddXor" composition equation. /// - public sealed class AddXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static AddXor Instance { get; } = new(); - } + public static PixelBlender AddXor => PixelBlender.Instance; /// - /// Blends pixels with the "SubtractXor" composition equation. + /// Gets the shared blender for the "SubtractXor" composition equation. /// - public sealed class SubtractXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static SubtractXor Instance { get; } = new(); - } + public static PixelBlender SubtractXor => PixelBlender.Instance; /// - /// Blends pixels with the "ScreenXor" composition equation. + /// Gets the shared blender for the "ScreenXor" composition equation. /// - public sealed class ScreenXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static ScreenXor Instance { get; } = new(); - } + public static PixelBlender ScreenXor => PixelBlender.Instance; /// - /// Blends pixels with the "DarkenXor" composition equation. + /// Gets the shared blender for the "DarkenXor" composition equation. /// - public sealed class DarkenXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static DarkenXor Instance { get; } = new(); - } + public static PixelBlender DarkenXor => PixelBlender.Instance; /// - /// Blends pixels with the "LightenXor" composition equation. + /// Gets the shared blender for the "LightenXor" composition equation. /// - public sealed class LightenXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static LightenXor Instance { get; } = new(); - } + public static PixelBlender LightenXor => PixelBlender.Instance; /// - /// Blends pixels with the "OverlayXor" composition equation. + /// Gets the shared blender for the "OverlayXor" composition equation. /// - public sealed class OverlayXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static OverlayXor Instance { get; } = new(); - } + public static PixelBlender OverlayXor => PixelBlender.Instance; /// - /// Blends pixels with the "HardLightXor" composition equation. + /// Gets the shared blender for the "HardLightXor" composition equation. /// - public sealed class HardLightXor : - DefaultPixelBlender - { - /// - /// Gets the shared blender instance. - /// - public static HardLightXor Instance { get; } = new(); - } + public static PixelBlender HardLightXor => PixelBlender.Instance; } diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt index ae0e0700d..e9bdbaf3c 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt @@ -61,6 +61,9 @@ foreach (var composer in composers) /// public readonly struct <#= blenderComposer #> : IPixelBlenderOperator { + /// + public static bool IsAssociatedAlpha => false; + /// public static Vector4 Invoke(Vector4 background, Vector4 source, float amount) => PorterDuffFunctions.<#= blenderComposer #>(background, source, amount); @@ -95,16 +98,9 @@ foreach (var composer in composers) var blenderComposer = $"{blender}{composer}"; #> /// - /// Blends pixels with the "<#= blenderComposer #>" composition equation. + /// Gets the shared blender for the "<#= blenderComposer #>" composition equation. /// - public sealed class <#= blenderComposer #> : - DefaultPixelBlender> - { - /// - /// Gets the shared blender instance. - /// - public static <#= blenderComposer #> Instance { get; } = new(); - } + public static PixelBlender <#= blenderComposer #> => PixelBlender>.Instance; <# } diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/IPixelBlenderOperator.cs b/src/ImageSharp/PixelFormats/PixelBlenders/IPixelBlenderOperator.cs index 10b588666..4b06e9523 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/IPixelBlenderOperator.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/IPixelBlenderOperator.cs @@ -11,6 +11,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders; /// internal interface IPixelBlenderOperator { + /// + /// Gets a value indicating whether pixel conversion uses associated-alpha vectors. + /// + public static abstract bool IsAssociatedAlpha { get; } + /// /// Blends one pixel represented by four RGBA lanes. /// diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/PixelBlender{TPixel,TOperator}.cs b/src/ImageSharp/PixelFormats/PixelBlenders/PixelBlender{TPixel,TOperator}.cs index 17282e388..ee8c6905f 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/PixelBlender{TPixel,TOperator}.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/PixelBlender{TPixel,TOperator}.cs @@ -13,10 +13,75 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders; /// /// The destination pixel format. /// The Porter-Duff equation. -internal abstract class PixelBlender : PixelBlender +internal sealed class PixelBlender : PixelBlender where TPixel : unmanaged, IPixel where TOperator : struct, IPixelBlenderOperator { + /// + /// Initializes a new instance of the class. + /// + private PixelBlender() + { + } + + /// + /// Gets the shared blender instance for this exact pixel and equation combination. + /// + // Keeping the singleton on the already-required closed blender type preserves per-mode lazy initialization + // without introducing another NativeAOT holder type or eagerly allocating every blender for a pixel format. + public static PixelBlender Instance { get; } = new PixelBlender(); + + /// + public override TPixel Blend(TPixel background, TPixel source, float amount) + { + // The operator type uniquely determines the alpha representation. NativeAOT therefore needs only the + // pixel/operator closure, while the JIT can remove this static choice from the generated hot path. + Vector4 backgroundVector = TOperator.IsAssociatedAlpha + ? background.ToAssociatedScaledVector4() + : background.ToUnassociatedScaledVector4(); + Vector4 sourceVector = TOperator.IsAssociatedAlpha + ? source.ToAssociatedScaledVector4() + : source.ToUnassociatedScaledVector4(); + + Vector4 result = TOperator.Invoke(backgroundVector, sourceVector, Numerics.Clamp(amount, 0, 1F)); + + return TOperator.IsAssociatedAlpha + ? TPixel.FromAssociatedScaledVector4(result) + : TPixel.FromUnassociatedScaledVector4(result); + } + + /// + protected sealed override void ToBlendVector4( + Configuration configuration, + ReadOnlySpan source, + Span destination) + { + PixelConversionModifiers modifiers = TOperator.IsAssociatedAlpha + ? PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply + : PixelConversionModifiers.Scale | PixelConversionModifiers.UnPremultiply; + + PixelOperations.Instance.ToVector4(configuration, source, destination, modifiers); + } + + /// + protected sealed override Vector4 ToBlendVector4(TPixel source) + => TOperator.IsAssociatedAlpha + ? source.ToAssociatedScaledVector4() + : source.ToUnassociatedScaledVector4(); + + /// + protected sealed override void FromBlendVector4( + Configuration configuration, + Span source, + Span destination) + { + PixelConversionModifiers modifiers = TOperator.IsAssociatedAlpha + ? PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply + : PixelConversionModifiers.Scale | PixelConversionModifiers.UnPremultiply; + + PixelOperations.Instance.FromVector4Destructive(configuration, source, destination, modifiers); + } + /// protected sealed override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { @@ -519,22 +584,3 @@ internal abstract class PixelBlender : PixelBlender return Vector512.Min(Vector512.Max(Vector512.Zero, result), Vector512.Create(1F)); } } - -/// -/// Applies a statically selected Porter-Duff equation to straight-alpha pixels. -/// -/// The straight-alpha pixel format. -/// The Porter-Duff equation. -internal abstract class DefaultPixelBlender : PixelBlender - where TPixel : unmanaged, IPixel - where TOperator : struct, IPixelBlenderOperator -{ - /// - public sealed override TPixel Blend(TPixel background, TPixel source, float amount) - { - // The operator consumes the same unassociated, scaled representation used by the bulk conversion path. - Vector4 result = TOperator.Invoke(background.ToUnassociatedScaledVector4(), source.ToUnassociatedScaledVector4(), Numerics.Clamp(amount, 0, 1F)); - - return TPixel.FromUnassociatedScaledVector4(result); - } -} diff --git a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.PixelBenders.cs b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.PixelBenders.cs index bf1391990..fe7de51c9 100644 --- a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.PixelBenders.cs +++ b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.PixelBenders.cs @@ -34,182 +34,182 @@ public partial class PixelOperations case PixelAlphaCompositionMode.Clear: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyClear.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddClear.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractClear.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenClear.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenClear.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenClear.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayClear.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightClear.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyClear; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddClear; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractClear; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenClear; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenClear; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenClear; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayClear; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightClear; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalClear.Instance; + default: return DefaultPixelBlenders.NormalClear; } case PixelAlphaCompositionMode.Xor: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyXor.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddXor.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractXor.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenXor.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenXor.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenXor.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayXor.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightXor.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyXor; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddXor; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractXor; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenXor; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenXor; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenXor; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayXor; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightXor; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalXor.Instance; + default: return DefaultPixelBlenders.NormalXor; } case PixelAlphaCompositionMode.Src: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrc.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrc.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrc.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrc.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrc.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrc.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrc.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrc.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrc; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrc; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrc; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrc; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrc; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrc; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrc; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrc; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalSrc.Instance; + default: return DefaultPixelBlenders.NormalSrc; } case PixelAlphaCompositionMode.SrcAtop: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrcAtop.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrcAtop.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrcAtop.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrcAtop.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrcAtop.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrcAtop.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrcAtop.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrcAtop.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrcAtop; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrcAtop; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrcAtop; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrcAtop; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrcAtop; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrcAtop; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrcAtop; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrcAtop; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalSrcAtop.Instance; + default: return DefaultPixelBlenders.NormalSrcAtop; } case PixelAlphaCompositionMode.SrcIn: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrcIn.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrcIn.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrcIn.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrcIn.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrcIn.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrcIn.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrcIn.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrcIn.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrcIn; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrcIn; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrcIn; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrcIn; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrcIn; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrcIn; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrcIn; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrcIn; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalSrcIn.Instance; + default: return DefaultPixelBlenders.NormalSrcIn; } case PixelAlphaCompositionMode.SrcOut: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrcOut.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrcOut.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrcOut.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrcOut.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrcOut.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrcOut.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrcOut.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrcOut.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrcOut; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrcOut; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrcOut; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrcOut; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrcOut; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrcOut; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrcOut; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrcOut; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalSrcOut.Instance; + default: return DefaultPixelBlenders.NormalSrcOut; } case PixelAlphaCompositionMode.Dest: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDest.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDest.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDest.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDest.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDest.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDest.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDest.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDest.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDest; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDest; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDest; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDest; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDest; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDest; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDest; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDest; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalDest.Instance; + default: return DefaultPixelBlenders.NormalDest; } case PixelAlphaCompositionMode.DestAtop: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDestAtop.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDestAtop.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDestAtop.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDestAtop.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDestAtop.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDestAtop.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDestAtop.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDestAtop.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDestAtop; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDestAtop; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDestAtop; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDestAtop; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDestAtop; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDestAtop; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDestAtop; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDestAtop; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalDestAtop.Instance; + default: return DefaultPixelBlenders.NormalDestAtop; } case PixelAlphaCompositionMode.DestIn: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDestIn.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDestIn.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDestIn.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDestIn.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDestIn.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDestIn.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDestIn.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDestIn.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDestIn; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDestIn; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDestIn; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDestIn; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDestIn; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDestIn; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDestIn; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDestIn; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalDestIn.Instance; + default: return DefaultPixelBlenders.NormalDestIn; } case PixelAlphaCompositionMode.DestOut: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDestOut.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDestOut.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDestOut.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDestOut.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDestOut.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDestOut.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDestOut.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDestOut.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDestOut; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDestOut; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDestOut; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDestOut; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDestOut; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDestOut; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDestOut; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDestOut; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalDestOut.Instance; + default: return DefaultPixelBlenders.NormalDestOut; } case PixelAlphaCompositionMode.DestOver: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDestOver.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDestOver.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDestOver.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDestOver.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDestOver.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDestOver.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDestOver.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDestOver.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplyDestOver; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddDestOver; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractDestOver; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenDestOver; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenDestOver; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenDestOver; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlayDestOver; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightDestOver; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalDestOver.Instance; + default: return DefaultPixelBlenders.NormalDestOver; } case PixelAlphaCompositionMode.SrcOver: default: switch (colorMode) { - case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrcOver.Instance; - case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrcOver.Instance; - case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrcOver.Instance; - case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrcOver.Instance; - case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrcOver.Instance; - case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrcOver.Instance; - case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrcOver.Instance; - case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrcOver.Instance; + case PixelColorBlendingMode.Multiply: return DefaultPixelBlenders.MultiplySrcOver; + case PixelColorBlendingMode.Add: return DefaultPixelBlenders.AddSrcOver; + case PixelColorBlendingMode.Subtract: return DefaultPixelBlenders.SubtractSrcOver; + case PixelColorBlendingMode.Screen: return DefaultPixelBlenders.ScreenSrcOver; + case PixelColorBlendingMode.Darken: return DefaultPixelBlenders.DarkenSrcOver; + case PixelColorBlendingMode.Lighten: return DefaultPixelBlenders.LightenSrcOver; + case PixelColorBlendingMode.Overlay: return DefaultPixelBlenders.OverlaySrcOver; + case PixelColorBlendingMode.HardLight: return DefaultPixelBlenders.HardLightSrcOver; case PixelColorBlendingMode.Normal: - default: return DefaultPixelBlenders.NormalSrcOver.Instance; + default: return DefaultPixelBlenders.NormalSrcOver; } } } diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelBlenderTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelBlenderTests.cs index 34606fcde..c3028b33b 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelBlenderTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelBlenderTests.cs @@ -13,24 +13,24 @@ public class PixelBlenderTests { public static TheoryData BlenderMappings = new() { - { new TestPixel(), typeof(DefaultPixelBlenders.NormalSrcOver), PixelColorBlendingMode.Normal }, - { new TestPixel(), typeof(DefaultPixelBlenders.ScreenSrcOver), PixelColorBlendingMode.Screen }, - { new TestPixel(), typeof(DefaultPixelBlenders.HardLightSrcOver), PixelColorBlendingMode.HardLight }, - { new TestPixel(), typeof(DefaultPixelBlenders.OverlaySrcOver), PixelColorBlendingMode.Overlay }, - { new TestPixel(), typeof(DefaultPixelBlenders.DarkenSrcOver), PixelColorBlendingMode.Darken }, - { new TestPixel(), typeof(DefaultPixelBlenders.LightenSrcOver), PixelColorBlendingMode.Lighten }, - { new TestPixel(), typeof(DefaultPixelBlenders.AddSrcOver), PixelColorBlendingMode.Add }, - { new TestPixel(), typeof(DefaultPixelBlenders.SubtractSrcOver), PixelColorBlendingMode.Subtract }, - { new TestPixel(), typeof(DefaultPixelBlenders.MultiplySrcOver), PixelColorBlendingMode.Multiply }, - { new TestPixel(), typeof(DefaultPixelBlenders.NormalSrcOver), PixelColorBlendingMode.Normal }, - { new TestPixel(), typeof(DefaultPixelBlenders.ScreenSrcOver), PixelColorBlendingMode.Screen }, - { new TestPixel(), typeof(DefaultPixelBlenders.HardLightSrcOver), PixelColorBlendingMode.HardLight }, - { new TestPixel(), typeof(DefaultPixelBlenders.OverlaySrcOver), PixelColorBlendingMode.Overlay }, - { new TestPixel(), typeof(DefaultPixelBlenders.DarkenSrcOver), PixelColorBlendingMode.Darken }, - { new TestPixel(), typeof(DefaultPixelBlenders.LightenSrcOver), PixelColorBlendingMode.Lighten }, - { new TestPixel(), typeof(DefaultPixelBlenders.AddSrcOver), PixelColorBlendingMode.Add }, - { new TestPixel(), typeof(DefaultPixelBlenders.SubtractSrcOver), PixelColorBlendingMode.Subtract }, - { new TestPixel(), typeof(DefaultPixelBlenders.MultiplySrcOver), PixelColorBlendingMode.Multiply }, + { new TestPixel(), DefaultPixelBlenders.NormalSrcOver.GetType(), PixelColorBlendingMode.Normal }, + { new TestPixel(), DefaultPixelBlenders.ScreenSrcOver.GetType(), PixelColorBlendingMode.Screen }, + { new TestPixel(), DefaultPixelBlenders.HardLightSrcOver.GetType(), PixelColorBlendingMode.HardLight }, + { new TestPixel(), DefaultPixelBlenders.OverlaySrcOver.GetType(), PixelColorBlendingMode.Overlay }, + { new TestPixel(), DefaultPixelBlenders.DarkenSrcOver.GetType(), PixelColorBlendingMode.Darken }, + { new TestPixel(), DefaultPixelBlenders.LightenSrcOver.GetType(), PixelColorBlendingMode.Lighten }, + { new TestPixel(), DefaultPixelBlenders.AddSrcOver.GetType(), PixelColorBlendingMode.Add }, + { new TestPixel(), DefaultPixelBlenders.SubtractSrcOver.GetType(), PixelColorBlendingMode.Subtract }, + { new TestPixel(), DefaultPixelBlenders.MultiplySrcOver.GetType(), PixelColorBlendingMode.Multiply }, + { new TestPixel(), DefaultPixelBlenders.NormalSrcOver.GetType(), PixelColorBlendingMode.Normal }, + { new TestPixel(), DefaultPixelBlenders.ScreenSrcOver.GetType(), PixelColorBlendingMode.Screen }, + { new TestPixel(), DefaultPixelBlenders.HardLightSrcOver.GetType(), PixelColorBlendingMode.HardLight }, + { new TestPixel(), DefaultPixelBlenders.OverlaySrcOver.GetType(), PixelColorBlendingMode.Overlay }, + { new TestPixel(), DefaultPixelBlenders.DarkenSrcOver.GetType(), PixelColorBlendingMode.Darken }, + { new TestPixel(), DefaultPixelBlenders.LightenSrcOver.GetType(), PixelColorBlendingMode.Lighten }, + { new TestPixel(), DefaultPixelBlenders.AddSrcOver.GetType(), PixelColorBlendingMode.Add }, + { new TestPixel(), DefaultPixelBlenders.SubtractSrcOver.GetType(), PixelColorBlendingMode.Subtract }, + { new TestPixel(), DefaultPixelBlenders.MultiplySrcOver.GetType(), PixelColorBlendingMode.Multiply }, }; public static TheoryData BlenderModeMappings @@ -42,158 +42,158 @@ public class PixelBlenderTests AddBlenderModeMappings( data, PixelAlphaCompositionMode.Clear, - typeof(DefaultPixelBlenders.NormalClear), - typeof(DefaultPixelBlenders.MultiplyClear), - typeof(DefaultPixelBlenders.AddClear), - typeof(DefaultPixelBlenders.SubtractClear), - typeof(DefaultPixelBlenders.ScreenClear), - typeof(DefaultPixelBlenders.DarkenClear), - typeof(DefaultPixelBlenders.LightenClear), - typeof(DefaultPixelBlenders.OverlayClear), - typeof(DefaultPixelBlenders.HardLightClear)); + DefaultPixelBlenders.NormalClear.GetType(), + DefaultPixelBlenders.MultiplyClear.GetType(), + DefaultPixelBlenders.AddClear.GetType(), + DefaultPixelBlenders.SubtractClear.GetType(), + DefaultPixelBlenders.ScreenClear.GetType(), + DefaultPixelBlenders.DarkenClear.GetType(), + DefaultPixelBlenders.LightenClear.GetType(), + DefaultPixelBlenders.OverlayClear.GetType(), + DefaultPixelBlenders.HardLightClear.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.Xor, - typeof(DefaultPixelBlenders.NormalXor), - typeof(DefaultPixelBlenders.MultiplyXor), - typeof(DefaultPixelBlenders.AddXor), - typeof(DefaultPixelBlenders.SubtractXor), - typeof(DefaultPixelBlenders.ScreenXor), - typeof(DefaultPixelBlenders.DarkenXor), - typeof(DefaultPixelBlenders.LightenXor), - typeof(DefaultPixelBlenders.OverlayXor), - typeof(DefaultPixelBlenders.HardLightXor)); + DefaultPixelBlenders.NormalXor.GetType(), + DefaultPixelBlenders.MultiplyXor.GetType(), + DefaultPixelBlenders.AddXor.GetType(), + DefaultPixelBlenders.SubtractXor.GetType(), + DefaultPixelBlenders.ScreenXor.GetType(), + DefaultPixelBlenders.DarkenXor.GetType(), + DefaultPixelBlenders.LightenXor.GetType(), + DefaultPixelBlenders.OverlayXor.GetType(), + DefaultPixelBlenders.HardLightXor.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.Src, - typeof(DefaultPixelBlenders.NormalSrc), - typeof(DefaultPixelBlenders.MultiplySrc), - typeof(DefaultPixelBlenders.AddSrc), - typeof(DefaultPixelBlenders.SubtractSrc), - typeof(DefaultPixelBlenders.ScreenSrc), - typeof(DefaultPixelBlenders.DarkenSrc), - typeof(DefaultPixelBlenders.LightenSrc), - typeof(DefaultPixelBlenders.OverlaySrc), - typeof(DefaultPixelBlenders.HardLightSrc)); + DefaultPixelBlenders.NormalSrc.GetType(), + DefaultPixelBlenders.MultiplySrc.GetType(), + DefaultPixelBlenders.AddSrc.GetType(), + DefaultPixelBlenders.SubtractSrc.GetType(), + DefaultPixelBlenders.ScreenSrc.GetType(), + DefaultPixelBlenders.DarkenSrc.GetType(), + DefaultPixelBlenders.LightenSrc.GetType(), + DefaultPixelBlenders.OverlaySrc.GetType(), + DefaultPixelBlenders.HardLightSrc.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.SrcAtop, - typeof(DefaultPixelBlenders.NormalSrcAtop), - typeof(DefaultPixelBlenders.MultiplySrcAtop), - typeof(DefaultPixelBlenders.AddSrcAtop), - typeof(DefaultPixelBlenders.SubtractSrcAtop), - typeof(DefaultPixelBlenders.ScreenSrcAtop), - typeof(DefaultPixelBlenders.DarkenSrcAtop), - typeof(DefaultPixelBlenders.LightenSrcAtop), - typeof(DefaultPixelBlenders.OverlaySrcAtop), - typeof(DefaultPixelBlenders.HardLightSrcAtop)); + DefaultPixelBlenders.NormalSrcAtop.GetType(), + DefaultPixelBlenders.MultiplySrcAtop.GetType(), + DefaultPixelBlenders.AddSrcAtop.GetType(), + DefaultPixelBlenders.SubtractSrcAtop.GetType(), + DefaultPixelBlenders.ScreenSrcAtop.GetType(), + DefaultPixelBlenders.DarkenSrcAtop.GetType(), + DefaultPixelBlenders.LightenSrcAtop.GetType(), + DefaultPixelBlenders.OverlaySrcAtop.GetType(), + DefaultPixelBlenders.HardLightSrcAtop.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.SrcIn, - typeof(DefaultPixelBlenders.NormalSrcIn), - typeof(DefaultPixelBlenders.MultiplySrcIn), - typeof(DefaultPixelBlenders.AddSrcIn), - typeof(DefaultPixelBlenders.SubtractSrcIn), - typeof(DefaultPixelBlenders.ScreenSrcIn), - typeof(DefaultPixelBlenders.DarkenSrcIn), - typeof(DefaultPixelBlenders.LightenSrcIn), - typeof(DefaultPixelBlenders.OverlaySrcIn), - typeof(DefaultPixelBlenders.HardLightSrcIn)); + DefaultPixelBlenders.NormalSrcIn.GetType(), + DefaultPixelBlenders.MultiplySrcIn.GetType(), + DefaultPixelBlenders.AddSrcIn.GetType(), + DefaultPixelBlenders.SubtractSrcIn.GetType(), + DefaultPixelBlenders.ScreenSrcIn.GetType(), + DefaultPixelBlenders.DarkenSrcIn.GetType(), + DefaultPixelBlenders.LightenSrcIn.GetType(), + DefaultPixelBlenders.OverlaySrcIn.GetType(), + DefaultPixelBlenders.HardLightSrcIn.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.SrcOut, - typeof(DefaultPixelBlenders.NormalSrcOut), - typeof(DefaultPixelBlenders.MultiplySrcOut), - typeof(DefaultPixelBlenders.AddSrcOut), - typeof(DefaultPixelBlenders.SubtractSrcOut), - typeof(DefaultPixelBlenders.ScreenSrcOut), - typeof(DefaultPixelBlenders.DarkenSrcOut), - typeof(DefaultPixelBlenders.LightenSrcOut), - typeof(DefaultPixelBlenders.OverlaySrcOut), - typeof(DefaultPixelBlenders.HardLightSrcOut)); + DefaultPixelBlenders.NormalSrcOut.GetType(), + DefaultPixelBlenders.MultiplySrcOut.GetType(), + DefaultPixelBlenders.AddSrcOut.GetType(), + DefaultPixelBlenders.SubtractSrcOut.GetType(), + DefaultPixelBlenders.ScreenSrcOut.GetType(), + DefaultPixelBlenders.DarkenSrcOut.GetType(), + DefaultPixelBlenders.LightenSrcOut.GetType(), + DefaultPixelBlenders.OverlaySrcOut.GetType(), + DefaultPixelBlenders.HardLightSrcOut.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.Dest, - typeof(DefaultPixelBlenders.NormalDest), - typeof(DefaultPixelBlenders.MultiplyDest), - typeof(DefaultPixelBlenders.AddDest), - typeof(DefaultPixelBlenders.SubtractDest), - typeof(DefaultPixelBlenders.ScreenDest), - typeof(DefaultPixelBlenders.DarkenDest), - typeof(DefaultPixelBlenders.LightenDest), - typeof(DefaultPixelBlenders.OverlayDest), - typeof(DefaultPixelBlenders.HardLightDest)); + DefaultPixelBlenders.NormalDest.GetType(), + DefaultPixelBlenders.MultiplyDest.GetType(), + DefaultPixelBlenders.AddDest.GetType(), + DefaultPixelBlenders.SubtractDest.GetType(), + DefaultPixelBlenders.ScreenDest.GetType(), + DefaultPixelBlenders.DarkenDest.GetType(), + DefaultPixelBlenders.LightenDest.GetType(), + DefaultPixelBlenders.OverlayDest.GetType(), + DefaultPixelBlenders.HardLightDest.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.DestAtop, - typeof(DefaultPixelBlenders.NormalDestAtop), - typeof(DefaultPixelBlenders.MultiplyDestAtop), - typeof(DefaultPixelBlenders.AddDestAtop), - typeof(DefaultPixelBlenders.SubtractDestAtop), - typeof(DefaultPixelBlenders.ScreenDestAtop), - typeof(DefaultPixelBlenders.DarkenDestAtop), - typeof(DefaultPixelBlenders.LightenDestAtop), - typeof(DefaultPixelBlenders.OverlayDestAtop), - typeof(DefaultPixelBlenders.HardLightDestAtop)); + DefaultPixelBlenders.NormalDestAtop.GetType(), + DefaultPixelBlenders.MultiplyDestAtop.GetType(), + DefaultPixelBlenders.AddDestAtop.GetType(), + DefaultPixelBlenders.SubtractDestAtop.GetType(), + DefaultPixelBlenders.ScreenDestAtop.GetType(), + DefaultPixelBlenders.DarkenDestAtop.GetType(), + DefaultPixelBlenders.LightenDestAtop.GetType(), + DefaultPixelBlenders.OverlayDestAtop.GetType(), + DefaultPixelBlenders.HardLightDestAtop.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.DestIn, - typeof(DefaultPixelBlenders.NormalDestIn), - typeof(DefaultPixelBlenders.MultiplyDestIn), - typeof(DefaultPixelBlenders.AddDestIn), - typeof(DefaultPixelBlenders.SubtractDestIn), - typeof(DefaultPixelBlenders.ScreenDestIn), - typeof(DefaultPixelBlenders.DarkenDestIn), - typeof(DefaultPixelBlenders.LightenDestIn), - typeof(DefaultPixelBlenders.OverlayDestIn), - typeof(DefaultPixelBlenders.HardLightDestIn)); + DefaultPixelBlenders.NormalDestIn.GetType(), + DefaultPixelBlenders.MultiplyDestIn.GetType(), + DefaultPixelBlenders.AddDestIn.GetType(), + DefaultPixelBlenders.SubtractDestIn.GetType(), + DefaultPixelBlenders.ScreenDestIn.GetType(), + DefaultPixelBlenders.DarkenDestIn.GetType(), + DefaultPixelBlenders.LightenDestIn.GetType(), + DefaultPixelBlenders.OverlayDestIn.GetType(), + DefaultPixelBlenders.HardLightDestIn.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.DestOut, - typeof(DefaultPixelBlenders.NormalDestOut), - typeof(DefaultPixelBlenders.MultiplyDestOut), - typeof(DefaultPixelBlenders.AddDestOut), - typeof(DefaultPixelBlenders.SubtractDestOut), - typeof(DefaultPixelBlenders.ScreenDestOut), - typeof(DefaultPixelBlenders.DarkenDestOut), - typeof(DefaultPixelBlenders.LightenDestOut), - typeof(DefaultPixelBlenders.OverlayDestOut), - typeof(DefaultPixelBlenders.HardLightDestOut)); + DefaultPixelBlenders.NormalDestOut.GetType(), + DefaultPixelBlenders.MultiplyDestOut.GetType(), + DefaultPixelBlenders.AddDestOut.GetType(), + DefaultPixelBlenders.SubtractDestOut.GetType(), + DefaultPixelBlenders.ScreenDestOut.GetType(), + DefaultPixelBlenders.DarkenDestOut.GetType(), + DefaultPixelBlenders.LightenDestOut.GetType(), + DefaultPixelBlenders.OverlayDestOut.GetType(), + DefaultPixelBlenders.HardLightDestOut.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.DestOver, - typeof(DefaultPixelBlenders.NormalDestOver), - typeof(DefaultPixelBlenders.MultiplyDestOver), - typeof(DefaultPixelBlenders.AddDestOver), - typeof(DefaultPixelBlenders.SubtractDestOver), - typeof(DefaultPixelBlenders.ScreenDestOver), - typeof(DefaultPixelBlenders.DarkenDestOver), - typeof(DefaultPixelBlenders.LightenDestOver), - typeof(DefaultPixelBlenders.OverlayDestOver), - typeof(DefaultPixelBlenders.HardLightDestOver)); + DefaultPixelBlenders.NormalDestOver.GetType(), + DefaultPixelBlenders.MultiplyDestOver.GetType(), + DefaultPixelBlenders.AddDestOver.GetType(), + DefaultPixelBlenders.SubtractDestOver.GetType(), + DefaultPixelBlenders.ScreenDestOver.GetType(), + DefaultPixelBlenders.DarkenDestOver.GetType(), + DefaultPixelBlenders.LightenDestOver.GetType(), + DefaultPixelBlenders.OverlayDestOver.GetType(), + DefaultPixelBlenders.HardLightDestOver.GetType()); AddBlenderModeMappings( data, PixelAlphaCompositionMode.SrcOver, - typeof(DefaultPixelBlenders.NormalSrcOver), - typeof(DefaultPixelBlenders.MultiplySrcOver), - typeof(DefaultPixelBlenders.AddSrcOver), - typeof(DefaultPixelBlenders.SubtractSrcOver), - typeof(DefaultPixelBlenders.ScreenSrcOver), - typeof(DefaultPixelBlenders.DarkenSrcOver), - typeof(DefaultPixelBlenders.LightenSrcOver), - typeof(DefaultPixelBlenders.OverlaySrcOver), - typeof(DefaultPixelBlenders.HardLightSrcOver)); + DefaultPixelBlenders.NormalSrcOver.GetType(), + DefaultPixelBlenders.MultiplySrcOver.GetType(), + DefaultPixelBlenders.AddSrcOver.GetType(), + DefaultPixelBlenders.SubtractSrcOver.GetType(), + DefaultPixelBlenders.ScreenSrcOver.GetType(), + DefaultPixelBlenders.DarkenSrcOver.GetType(), + DefaultPixelBlenders.LightenSrcOver.GetType(), + DefaultPixelBlenders.OverlaySrcOver.GetType(), + DefaultPixelBlenders.HardLightSrcOver.GetType()); return data; } @@ -246,7 +246,7 @@ public class PixelBlenderTests [Fact] public void Blend_WithConstantSourceAndSingleAmount() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrcOver(); + PixelBlender blender = DefaultPixelBlenders.NormalSrcOver; Rgba32[] destination = new Rgba32[2]; Rgba32[] background = [ @@ -265,7 +265,7 @@ public class PixelBlenderTests [Fact] public void Blend_WithConstantSourceSingleAmountAndWorkingBuffer() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrcOver(); + PixelBlender blender = DefaultPixelBlenders.NormalSrcOver; Rgba32[] destination = new Rgba32[2]; Rgba32[] background = [ @@ -285,7 +285,7 @@ public class PixelBlenderTests [Fact] public void Blend_WithConstantSourceAndAmountSpan() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrcOver(); + PixelBlender blender = DefaultPixelBlenders.NormalSrcOver; Rgba32[] destination = new Rgba32[2]; Rgba32[] background = [ @@ -305,7 +305,7 @@ public class PixelBlenderTests [Fact] public void Blend_WithConstantSourceAmountSpanAndWorkingBuffer() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrcOver(); + PixelBlender blender = DefaultPixelBlenders.NormalSrcOver; Rgba32[] destination = new Rgba32[2]; Rgba32[] background = [ @@ -326,7 +326,7 @@ public class PixelBlenderTests [Fact] public void Blend_WithSourceSpanAmountSpanAndWorkingBuffer() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrcOver(); + PixelBlender blender = DefaultPixelBlenders.NormalSrcOver; Rgba32[] destination = new Rgba32[2]; Rgba32[] background = [ @@ -352,7 +352,7 @@ public class PixelBlenderTests [Fact] public void BlendWithCoverage_WithConstantSourceAndSingleAmount() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrc(); + PixelBlender blender = DefaultPixelBlenders.NormalSrc; Rgba32[] destination = new Rgba32[3]; Rgba32[] background = [ @@ -374,7 +374,7 @@ public class PixelBlenderTests [Fact] public void BlendWithCoverage_WithConstantSourceSingleAmountAndWorkingBuffer() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrc(); + PixelBlender blender = DefaultPixelBlenders.NormalSrc; Rgba32[] destination = new Rgba32[3]; Rgba32[] background = [ @@ -397,7 +397,7 @@ public class PixelBlenderTests [Fact] public void BlendWithCoverage_WithSourceSpanAndSingleAmount() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrc(); + PixelBlender blender = DefaultPixelBlenders.NormalSrc; Rgba32[] destination = new Rgba32[3]; Rgba32[] background = [ @@ -425,7 +425,7 @@ public class PixelBlenderTests [Fact] public void BlendWithCoverage_WithSourceSpanSingleAmountAndWorkingBuffer() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrc(); + PixelBlender blender = DefaultPixelBlenders.NormalSrc; Rgba32[] destination = new Rgba32[3]; Rgba32[] background = [ @@ -454,7 +454,7 @@ public class PixelBlenderTests [Fact] public void BlendWithCoverage_WithConstantSourceAndAmountSpan() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrc(); + PixelBlender blender = DefaultPixelBlenders.NormalSrc; Rgba32[] destination = new Rgba32[3]; Rgba32[] background = [ @@ -477,7 +477,7 @@ public class PixelBlenderTests [Fact] public void BlendWithCoverage_WithConstantSourceAmountSpanAndWorkingBuffer() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrc(); + PixelBlender blender = DefaultPixelBlenders.NormalSrc; Rgba32[] destination = new Rgba32[3]; Rgba32[] background = [ @@ -501,7 +501,7 @@ public class PixelBlenderTests [Fact] public void BlendWithCoverage_WithSourceSpanAndAmountSpan() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrc(); + PixelBlender blender = DefaultPixelBlenders.NormalSrc; Rgba32[] destination = new Rgba32[3]; Rgba32[] background = [ @@ -530,7 +530,7 @@ public class PixelBlenderTests [Fact] public void BlendWithCoverage_WithSourceSpanAmountSpanAndWorkingBuffer() { - PixelBlender blender = new DefaultPixelBlenders.NormalSrc(); + PixelBlender blender = DefaultPixelBlenders.NormalSrc; Rgba32[] destination = new Rgba32[3]; Rgba32[] background = [ diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTestsTPixel.cs b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTestsTPixel.cs index 153a9ac48..a2d571ad3 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTestsTPixel.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTestsTPixel.cs @@ -46,7 +46,7 @@ public class PorterDuffFunctionsTestsTPixel public void NormalBlendFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.NormalSrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.NormalSrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -56,7 +56,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.NormalSrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.NormalSrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest) @@ -91,7 +91,7 @@ public class PorterDuffFunctionsTestsTPixel public void MultiplyFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.MultiplySrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.MultiplySrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -101,7 +101,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.MultiplySrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.MultiplySrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest) @@ -146,7 +146,7 @@ public class PorterDuffFunctionsTestsTPixel public void AddFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.AddSrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.AddSrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -156,7 +156,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.AddSrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.AddSrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest) @@ -191,7 +191,7 @@ public class PorterDuffFunctionsTestsTPixel public void SubtractFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.SubtractSrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.SubtractSrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -201,7 +201,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.SubtractSrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.SubtractSrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest) @@ -236,7 +236,7 @@ public class PorterDuffFunctionsTestsTPixel public void ScreenFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.ScreenSrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.ScreenSrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -246,7 +246,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.ScreenSrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.ScreenSrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest) @@ -281,7 +281,7 @@ public class PorterDuffFunctionsTestsTPixel public void DarkenFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.DarkenSrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.DarkenSrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -291,7 +291,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.DarkenSrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.DarkenSrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest) @@ -326,7 +326,7 @@ public class PorterDuffFunctionsTestsTPixel public void LightenFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.LightenSrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.LightenSrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -336,7 +336,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.LightenSrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.LightenSrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest) @@ -371,7 +371,7 @@ public class PorterDuffFunctionsTestsTPixel public void OverlayFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.OverlaySrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.OverlaySrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -381,7 +381,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.OverlaySrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.OverlaySrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest) @@ -416,7 +416,7 @@ public class PorterDuffFunctionsTestsTPixel public void HardLightFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : unmanaged, IPixel { - TPixel actual = new DefaultPixelBlenders.HardLightSrcOver().Blend(back.AsPixel(), source.AsPixel(), amount); + TPixel actual = DefaultPixelBlenders.HardLightSrcOver.Blend(back.AsPixel(), source.AsPixel(), amount); VectorAssert.Equal(expected.AsPixel(), actual, 2); } @@ -426,7 +426,7 @@ public class PorterDuffFunctionsTestsTPixel where TPixel : unmanaged, IPixel { TPixel[] dest = new TPixel[BulkBlendCount]; - new DefaultPixelBlenders.HardLightSrcOver().Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); + DefaultPixelBlenders.HardLightSrcOver.Blend(this.Configuration, dest, CreateFilledArray(back.AsPixel()), CreateFilledArray(source.AsPixel()), CreateFilledArray(amount)); TPixel expectedPixel = expected.AsPixel(); foreach (TPixel pixel in dest)