示例#1
0
 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;
 }
示例#2
0
 public void FromLa32(La32 source)
 {
     byte rgb = ImageMaths.DownScaleFrom16BitTo8Bit(source.L);
     this.R = rgb;
     this.G = rgb;
     this.B = rgb;
 }
示例#3
0
 public void FromL16(L16 source)
 {
     byte rgb = ImageMaths.DownScaleFrom16BitTo8Bit(source.PackedValue);
     this.R = rgb;
     this.G = rgb;
     this.B = rgb;
 }
示例#4
0
        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);
        }
示例#5
0
文件: Rgb24.cs 项目: wilka/ImageSharp
 public void FromRgba64(Rgba64 source)
 {
     this.R = ImageMaths.DownScaleFrom16BitTo8Bit(source.R);
     this.G = ImageMaths.DownScaleFrom16BitTo8Bit(source.G);
     this.B = ImageMaths.DownScaleFrom16BitTo8Bit(source.B);
 }