MCPcopy Create free account
hub / github.com/TigerVNC/tigervnc / readRect

Method readRect

java/com/tigervnc/rfb/TightDecoder.java:61–153  ·  view source on GitHub ↗
(Rect r, InStream is,
                       ServerParams server, OutStream os)

Source from the content-addressed store, hash-verified

59 }
60
61 public void readRect(Rect r, InStream is,
62 ServerParams server, OutStream os)
63 {
64 int comp_ctl;
65
66 comp_ctl = is.readU8();
67 os.writeU8(comp_ctl);
68
69 comp_ctl >>= 4;
70
71 // "Fill" compression type.
72 if (comp_ctl == tightFill) {
73 if (server.pf().is888())
74 os.copyBytes(is, 3);
75 else
76 os.copyBytes(is, server.pf().bpp/8);
77 return;
78 }
79
80 // "JPEG" compression type.
81 if (comp_ctl == tightJpeg) {
82 int len;
83
84 len = readCompact(is);
85 os.writeOpaque32(len);
86 os.copyBytes(is, len);
87 return;
88 }
89
90 // Quit on unsupported compression type.
91 if (comp_ctl > tightMaxSubencoding)
92 throw new Exception("TightDecoder: bad subencoding value received");
93
94 // "Basic" compression type.
95
96 int palSize = 0;
97
98 if (r.width() > TIGHT_MAX_WIDTH)
99 throw new Exception("TightDecoder: too large rectangle ("+r.width()+" pixels)");
100
101 // Possible palette
102 if ((comp_ctl & tightExplicitFilter) != 0) {
103 int filterId;
104
105 filterId = is.readU8() & 0xff;
106 os.writeU8(filterId);
107
108 switch (filterId) {
109 case tightFilterPalette:
110 palSize = is.readU8() + 1;
111 os.writeU32(palSize - 1);
112
113 if (server.pf().is888())
114 os.copyBytes(is, palSize * 3);
115 else
116 os.copyBytes(is, palSize * server.pf().bpp/8);
117 break;
118 case tightFilterGradient:

Callers

nothing calls this directly

Calls 10

readCompactMethod · 0.95
pfMethod · 0.80
readU8Method · 0.45
writeU8Method · 0.45
is888Method · 0.45
copyBytesMethod · 0.45
writeOpaque32Method · 0.45
widthMethod · 0.45
writeU32Method · 0.45
heightMethod · 0.45

Tested by

no test coverage detected