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); }
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); }
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); }
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); }
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(); } }
public RawDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer) : base(framebuffer, rfbSerializer) { }
protected PixelReader(Framebuffer framebuffer, RfbSerializer rfbSerializer) { Serializer = rfbSerializer ?? throw new ArgumentNullException(nameof(rfbSerializer)); Framebuffer = framebuffer ?? throw new ArgumentNullException(nameof(framebuffer)); }
public CopyRectDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer) : base(framebuffer, rfbSerializer) { }
public ZlibDecoder(Framebuffer framebuffer, RfbSerializer rfbSerializer, ZlibStream zStream) : base(framebuffer, rfbSerializer, zStream) { _RawDecoder = new RawDecoder(Framebuffer, new RfbSerializer(zStream)); }