Ejemplo n.º 1
0
        public EncodedRectangle Build(QuadNode node, VncHost.Encoding encoding)
        {
            var pixels = node.NodeData;
            EncodedRectangle e;

            switch (encoding)
            {
            case VncHost.Encoding.RawEncoding:
                e = new RawRectangle(rfb, framebuffer, pixels, node.Bounds);
                break;

            case VncHost.Encoding.CopyRectEncoding:
                e = new CopyRectRectangle(rfb, framebuffer, node.Bounds);
                break;

            case VncHost.Encoding.RreEncoding:
                e = new RreRectangle(rfb, framebuffer, pixels, node.Bounds);
                break;

            case VncHost.Encoding.CoRreEncoding:
                e = new CoRreRectangle(rfb, framebuffer, pixels, node.Bounds);
                break;

            case VncHost.Encoding.HextileEncoding:
                e = new HextileRectangle(rfb, framebuffer, pixels, node.Bounds);
                break;

            case VncHost.Encoding.ZrleEncoding:
                e = new ZrleRectangle(rfb, framebuffer, pixels, node.Bounds);
                break;

            case VncHost.Encoding.ZlibEncoding:
                e = new ZlibRectangle(rfb, framebuffer, pixels, node.Bounds);
                break;

            default:
                // Sanity check
                throw new Exception("Unsupported Encoding Format received: " + encoding + ".");
            }
            return(e);
        }
Ejemplo n.º 2
0
        public EncodedRectangle Build(Rectangle2 rectangle, int[] pixels, VncHost.Encoding encoding)
        {
            EncodedRectangle e;

            switch (encoding)
            {
            case VncHost.Encoding.RawEncoding:
                e = new RawRectangle(rfb, framebuffer, pixels, rectangle);
                break;

            case VncHost.Encoding.CopyRectEncoding:
                e = new CopyRectRectangle(rfb, framebuffer, rectangle);
                break;

            case VncHost.Encoding.RreEncoding:
                e = new RreRectangle(rfb, framebuffer, pixels, rectangle);
                break;

            case VncHost.Encoding.CoRreEncoding:
                e = new CoRreRectangle(rfb, framebuffer, pixels, rectangle);
                break;

            case VncHost.Encoding.HextileEncoding:
                e = new HextileRectangle(rfb, framebuffer, pixels, rectangle);
                break;

            case VncHost.Encoding.ZrleEncoding:
                e = new ZrleRectangle(rfb, framebuffer, pixels, rectangle);
                break;

            case VncHost.Encoding.ZlibEncoding:
                e = new ZlibRectangle(rfb, framebuffer, pixels, rectangle);
                break;

            default:
                // Sanity check
                throw new Exception("Unsupported Encoding Format received: " + encoding + ".");
            }
            return(e);
        }