|
4 | 4 | using System.Numerics; |
5 | 5 | using System.Runtime.CompilerServices; |
6 | 6 | using System.Runtime.InteropServices; |
7 | | -using System.Runtime.Intrinsics; |
8 | 7 |
|
9 | 8 | namespace SixLabors.ImageSharp.ColorProfiles; |
10 | 9 |
|
@@ -36,14 +35,23 @@ public CieLchuv(float l, float c, float h) |
36 | 35 | /// <param name="vector">The vector representing the l, c, h components.</param> |
37 | 36 | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
38 | 37 | public CieLchuv(Vector3 vector) |
39 | | - : this() |
40 | 38 | { |
41 | 39 | vector = Vector3.Clamp(vector, Min, Max); |
42 | 40 | this.L = vector.X; |
43 | 41 | this.C = vector.Y; |
44 | 42 | this.H = vector.Z; |
45 | 43 | } |
46 | 44 |
|
| 45 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 46 | +#pragma warning disable SA1313 // Parameter names should begin with lower-case letter |
| 47 | + private CieLchuv(Vector3 vector, bool _) |
| 48 | +#pragma warning restore SA1313 // Parameter names should begin with lower-case letter |
| 49 | + { |
| 50 | + this.L = vector.X; |
| 51 | + this.C = vector.Y; |
| 52 | + this.H = vector.Z; |
| 53 | + } |
| 54 | + |
47 | 55 | /// <summary> |
48 | 56 | /// Gets the lightness dimension. |
49 | 57 | /// <remarks>A value ranging between 0 (black), 100 (diffuse white) or higher (specular white).</remarks> |
@@ -98,7 +106,7 @@ public static CieLchuv FromScaledVector4(Vector4 source) |
98 | 106 | Vector3 v3 = source.AsVector3(); |
99 | 107 | v3 *= new Vector3(100, 400, 360); |
100 | 108 | v3 -= new Vector3(0, 200, 0); |
101 | | - return new CieLchuv(v3); |
| 109 | + return new CieLchuv(v3, true); |
102 | 110 | } |
103 | 111 |
|
104 | 112 | /// <inheritdoc/> |
|
0 commit comments