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

Method _paletteRect

systemvm/agent/noVNC/core/decoders/tight.js:272–285  ·  view source on GitHub ↗
(x, y, width, height, data, palette, display)

Source from the content-addressed store, hash-verified

270 }
271
272 _paletteRect(x, y, width, height, data, palette, display) {
273 // Convert indexed (palette based) image data to RGB
274 const dest = this._getScratchBuffer(width * height * 4);
275 const total = width * height * 4;
276 for (let i = 0, j = 0; i < total; i += 4, j++) {
277 const sp = data[j] * 3;
278 dest[i] = palette[sp];
279 dest[i + 1] = palette[sp + 1];
280 dest[i + 2] = palette[sp + 2];
281 dest[i + 3] = 255;
282 }
283
284 display.blitImage(x, y, width, height, dest, 0, false);
285 }
286
287 _gradientFilter(streamId, x, y, width, height, sock, display, depth) {
288 // assume the TPIXEL is 3 bytes long

Callers 1

_paletteFilterMethod · 0.95

Calls 2

_getScratchBufferMethod · 0.95
blitImageMethod · 0.80

Tested by

no test coverage detected