public void La16_FromScaledVector4() { // Arrange La16 gray = default; const ushort expected = 32896; Vector4 scaled = new La16(128, 128).ToScaledVector4(); // Act gray.FromScaledVector4(scaled); ushort actual = gray.PackedValue; // Assert Assert.Equal(expected, actual); }
public void FromScaledVector4_IsRgba32Compatible(byte luminance) { var original = new La16(luminance, luminance); Rgba32 rgba = default; original.ToRgba32(ref rgba); Vector4 rgbaVector = original.ToScaledVector4(); La16 mirror = default; mirror.FromScaledVector4(rgbaVector); Assert.Equal(original, mirror); }