Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
 public RawDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer) : base(framebuffer, rfbSerializer)
 {
 }
Exemplo n.º 7
0
 protected PixelReader(Framebuffer framebuffer, RfbSerializer rfbSerializer)
 {
     Serializer  = rfbSerializer ?? throw new ArgumentNullException(nameof(rfbSerializer));
     Framebuffer = framebuffer ?? throw new ArgumentNullException(nameof(framebuffer));
 }
Exemplo n.º 8
0
 public CopyRectDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer) : base(framebuffer, rfbSerializer)
 {
 }
Exemplo n.º 9
0
 public ZlibDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer, ZlibStream zStream) : base(framebuffer, rfbSerializer, zStream)
 {
     _RawDecoder = new RawDecoder(Framebuffer, new RfbSerializer(zStream));
 }