From a744f937adba8f61a515fddaf4752952eab5bbe2 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 16 May 2025 23:27:05 +1000 Subject: [PATCH] Update Rgb.cs --- src/ImageSharp/ColorProfiles/Rgb.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ImageSharp/ColorProfiles/Rgb.cs b/src/ImageSharp/ColorProfiles/Rgb.cs index 9b95278bc9..42e502592c 100644 --- a/src/ImageSharp/ColorProfiles/Rgb.cs +++ b/src/ImageSharp/ColorProfiles/Rgb.cs @@ -98,7 +98,7 @@ public readonly struct Rgb : IProfileConnectingSpace /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector4 ToScaledVector4() - => new(this.ToScaledVector3(), 1F); + => new(this.AsVector3Unsafe(), 1F); /// public static void ToScaledVector4(ReadOnlySpan source, Span destination) @@ -154,7 +154,7 @@ public readonly struct Rgb : IProfileConnectingSpace Rgb linear = FromScaledVector4(options.SourceRgbWorkingSpace.Expand(this.ToScaledVector4())); // Then convert to xyz - return new CieXyz(Vector3.Transform(linear.ToScaledVector3(), GetRgbToCieXyzMatrix(options.SourceRgbWorkingSpace))); + return new CieXyz(Vector3.Transform(linear.AsVector3Unsafe(), GetRgbToCieXyzMatrix(options.SourceRgbWorkingSpace))); } /// @@ -171,7 +171,7 @@ public readonly struct Rgb : IProfileConnectingSpace Rgb linear = FromScaledVector4(options.SourceRgbWorkingSpace.Expand(rgb.ToScaledVector4())); // Then convert to xyz - destination[i] = new CieXyz(Vector3.Transform(linear.ToScaledVector3(), matrix)); + destination[i] = new CieXyz(Vector3.Transform(linear.AsVector3Unsafe(), matrix)); } }