示例#1
0
 public Rgba64(Argb32 source)
 {
     this.R = ImageMaths.UpscaleFrom8BitTo16Bit(source.R);
     this.G = ImageMaths.UpscaleFrom8BitTo16Bit(source.G);
     this.B = ImageMaths.UpscaleFrom8BitTo16Bit(source.B);
     this.A = ImageMaths.UpscaleFrom8BitTo16Bit(source.A);
 }
示例#2
0
 public Rgba64(Bgr24 source)
 {
     this.R = ImageMaths.UpscaleFrom8BitTo16Bit(source.R);
     this.G = ImageMaths.UpscaleFrom8BitTo16Bit(source.G);
     this.B = ImageMaths.UpscaleFrom8BitTo16Bit(source.B);
     this.A = ushort.MaxValue;
 }
示例#3
0
        public void FromGray8(Gray8 source)
        {
            ushort rgb = ImageMaths.UpscaleFrom8BitTo16Bit(source.PackedValue);

            this.R = rgb;
            this.G = rgb;
            this.B = rgb;
        }
示例#4
0
文件: Rgb48.cs 项目: wilka/ImageSharp
        public void FromLa16(La16 source)
        {
            ushort rgb = ImageMaths.UpscaleFrom8BitTo16Bit(source.L);

            this.R = rgb;
            this.G = rgb;
            this.B = rgb;
        }
示例#5
0
        public void L16_FromRgba32()
        {
            // Arrange
            L16        gray      = default;
            const byte rgb       = 128;
            ushort     scaledRgb = ImageMaths.UpscaleFrom8BitTo16Bit(rgb);
            ushort     expected  = ImageMaths.Get16BitBT709Luminance(scaledRgb, scaledRgb, scaledRgb);

            // Act
            gray.FromRgba32(new Rgba32(rgb, rgb, rgb));
            ushort actual = gray.PackedValue;

            // Assert
            Assert.Equal(expected, actual);
        }
示例#6
0
 public void FromArgb32(Argb32 source)
 {
     this.R = ImageMaths.UpscaleFrom8BitTo16Bit(source.R);
     this.G = ImageMaths.UpscaleFrom8BitTo16Bit(source.G);
     this.B = ImageMaths.UpscaleFrom8BitTo16Bit(source.B);
 }
示例#7
0
 public void FromRgb24(Rgb24 source)
 {
     this.R = ImageMaths.UpscaleFrom8BitTo16Bit(source.R);
     this.G = ImageMaths.UpscaleFrom8BitTo16Bit(source.G);
     this.B = ImageMaths.UpscaleFrom8BitTo16Bit(source.B);
 }