コード例 #1
0
ファイル: ZrleDecoder.cs プロジェクト: gongmingwind/VncViewer
        public ZrleDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer, ZlibStream zStream) : base(framebuffer, rfbSerializer, zStream)
        {
            if (framebuffer == null)
            {
                throw new ArgumentNullException(nameof(framebuffer));
            }

            _DSerializer = new RfbSerializer(zStream);

            var bpp = framebuffer.PixelFormat.BitsPerPixel;

            if (bpp == 32)
            {
                throw new NotImplementedException();
            }
            else if (bpp == 16)
            {
                PixelReader = new PixelReader16(framebuffer, _DSerializer);
            }
            else if (bpp == 8)
            {
                PixelReader = new PixelReader8(framebuffer, _DSerializer);
            }

            _RawDecoder = new RawDecoder(Framebuffer, _DSerializer);
        }
コード例 #2
0
ファイル: RfbDecoder.cs プロジェクト: gongmingwind/VncViewer
        public RfbDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer)
        {
            Framebuffer = framebuffer ?? throw new ArgumentNullException(nameof(framebuffer));
            Serializer  = rfbSerializer ?? throw new ArgumentNullException(nameof(rfbSerializer));

            _ZlibStream     = new ZlibStream();
            RawDecoder      = new RawDecoder(framebuffer, rfbSerializer);
            ZlibDecoder     = new ZlibDecoder(framebuffer, rfbSerializer, _ZlibStream);
            CopyRectDecoder = new CopyRectDecoder(framebuffer, rfbSerializer);
            ZrleDecoder     = new ZrleDecoder(framebuffer, rfbSerializer, _ZlibStream);
        }
コード例 #3
0
        public override void Authenticate(RfbSerializer serializer)
        {
            if (serializer == null)
            {
                throw new ArgumentNullException(nameof(serializer));
            }

            var challenge = serializer.ReadBytes(16);
            var b         = EncryptKey(_PasswordBytes, challenge);

            serializer.WriteBytes(b);
        }
コード例 #4
0
        public void Connect(string host, int port = 5900)
        {
            SetState(VncState.Connecting);

            tcpClient.Connect(host, port);
            serializer = new RfbSerializer(tcpClient.GetStream());

            HandshakeProtocolVersion();
            GetSecurityTypes();

            SetState(VncState.Connected);
        }
コード例 #5
0
ファイル: BaseDecoder.cs プロジェクト: gongmingwind/VncViewer
        public BaseDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer)
        {
            Framebuffer = framebuffer ?? throw new ArgumentNullException(nameof(framebuffer));
            Serializer  = rfbSerializer ?? throw new ArgumentNullException(nameof(rfbSerializer));

            var bpp = framebuffer.PixelFormat.BitsPerPixel;

            if (bpp == 32)
            {
                PixelReader = new PixelReader32(framebuffer, rfbSerializer);
            }
            else if (bpp == 16)
            {
                PixelReader = new PixelReader16(framebuffer, rfbSerializer);
            }
            else if (bpp == 8)
            {
                PixelReader = new PixelReader8(framebuffer, rfbSerializer);
            }
            else
            {
                throw new NotSupportedException();
            }
        }
コード例 #6
0
 public RawDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer) : base(framebuffer, rfbSerializer)
 {
 }
コード例 #7
0
ファイル: PixelReader.cs プロジェクト: gongmingwind/VncViewer
 protected PixelReader(Framebuffer framebuffer, RfbSerializer rfbSerializer)
 {
     Serializer  = rfbSerializer ?? throw new ArgumentNullException(nameof(rfbSerializer));
     Framebuffer = framebuffer ?? throw new ArgumentNullException(nameof(framebuffer));
 }
コード例 #8
0
 public CopyRectDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer) : base(framebuffer, rfbSerializer)
 {
 }
コード例 #9
0
ファイル: ZlibDecoder.cs プロジェクト: gongmingwind/VncViewer
 public ZlibDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer, ZlibStream zStream) : base(framebuffer, rfbSerializer, zStream)
 {
     _RawDecoder = new RawDecoder(Framebuffer, new RfbSerializer(zStream));
 }