public void ToScaledVector4_IsRgba32Compatible(byte luminance) { var original = new La16(luminance, luminance); Rgba32 rgba = default; original.ToRgba32(ref rgba); Vector4 la16Vector = original.ToScaledVector4(); Vector4 rgbaVector = original.ToScaledVector4(); Assert.Equal(la16Vector, rgbaVector, new ApproximateFloatComparer(1e-5f)); }
public void Rgba32_ToLa16_IsInverseOf_La16_ToRgba32(byte luminance) { var original = new La16(luminance, luminance); Rgba32 rgba = default; original.ToRgba32(ref rgba); La16 mirror = default; mirror.FromRgba32(rgba); Assert.Equal(original, mirror); }
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); }
public void La16_ToRgba32(byte luminance) { // Arrange var gray = new La16(luminance, luminance); // Act Rgba32 actual = default; gray.ToRgba32(ref actual); // Assert Assert.Equal(luminance, actual.R); Assert.Equal(luminance, actual.G); Assert.Equal(luminance, actual.B); Assert.Equal(luminance, actual.A); }