MCPcopy Create free account
hub / github.com/apache/cloudstack / _basicRect

Method _basicRect

systemvm/agent/noVNC/core/decoders/tight.js:100–141  ·  view source on GitHub ↗
(ctl, x, y, width, height, sock, display, depth)

Source from the content-addressed store, hash-verified

98 }
99
100 _basicRect(ctl, x, y, width, height, sock, display, depth) {
101 if (this._filter === null) {
102 if (ctl & 0x4) {
103 if (sock.rQwait("TIGHT", 1)) {
104 return false;
105 }
106
107 this._filter = sock.rQshift8();
108 } else {
109 // Implicit CopyFilter
110 this._filter = 0;
111 }
112 }
113
114 let streamId = ctl & 0x3;
115
116 let ret;
117
118 switch (this._filter) {
119 case 0: // CopyFilter
120 ret = this._copyFilter(streamId, x, y, width, height,
121 sock, display, depth);
122 break;
123 case 1: // PaletteFilter
124 ret = this._paletteFilter(streamId, x, y, width, height,
125 sock, display, depth);
126 break;
127 case 2: // GradientFilter
128 ret = this._gradientFilter(streamId, x, y, width, height,
129 sock, display, depth);
130 break;
131 default:
132 throw new Error("Illegal tight filter received (ctl: " +
133 this._filter + ")");
134 }
135
136 if (ret) {
137 this._filter = null;
138 }
139
140 return ret;
141 }
142
143 _copyFilter(streamId, x, y, width, height, sock, display, depth) {
144 const uncompressedSize = width * height * 3;

Callers 1

decodeRectMethod · 0.95

Calls 5

_copyFilterMethod · 0.95
_paletteFilterMethod · 0.95
_gradientFilterMethod · 0.95
rQwaitMethod · 0.80
rQshift8Method · 0.80

Tested by

no test coverage detected