public void ToRgba32(ref Rgba32 dest) { dest.R = ImageMaths.DownScaleFrom16BitTo8Bit(this.R); dest.G = ImageMaths.DownScaleFrom16BitTo8Bit(this.G); dest.B = ImageMaths.DownScaleFrom16BitTo8Bit(this.B); dest.A = byte.MaxValue; }
public void FromLa32(La32 source) { byte rgb = ImageMaths.DownScaleFrom16BitTo8Bit(source.L); this.R = rgb; this.G = rgb; this.B = rgb; }
public void FromL16(L16 source) { byte rgb = ImageMaths.DownScaleFrom16BitTo8Bit(source.PackedValue); this.R = rgb; this.G = rgb; this.B = rgb; }
public void L16_ToRgba32(ushort input) { // Arrange ushort expected = ImageMaths.DownScaleFrom16BitTo8Bit(input); var gray = new L16(input); // Act Rgba32 actual = default; gray.ToRgba32(ref actual); // Assert Assert.Equal(expected, actual.R); Assert.Equal(expected, actual.G); Assert.Equal(expected, actual.B); Assert.Equal(byte.MaxValue, actual.A); }
public void FromRgba64(Rgba64 source) { this.R = ImageMaths.DownScaleFrom16BitTo8Bit(source.R); this.G = ImageMaths.DownScaleFrom16BitTo8Bit(source.G); this.B = ImageMaths.DownScaleFrom16BitTo8Bit(source.B); }