diff options
author | Frederik Fix <ich@derfred.com> | 2022-09-07 13:26:10 +0200 |
---|---|---|
committer | Frederik Fix <ich@derfred.com> | 2022-09-07 13:26:10 +0200 |
commit | edc7520e273fa1b2cbd0abac6a9fe2c1bd2680d5 (patch) | |
tree | 66bb861807d9715909205c2d4ccb89245cbaa87c /core | |
parent | 2f1e11b54aa88cb24400fe93b64cec8024c919ab (diff) | |
download | novnc-edc7520e273fa1b2cbd0abac6a9fe2c1bd2680d5.tar.gz |
access to raw image data
Diffstat (limited to 'core')
-rw-r--r-- | core/display.js | 12 | ||||
-rw-r--r-- | core/rfb.js | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/core/display.js b/core/display.js index 701eba4..bf8d5fa 100644 --- a/core/display.js +++ b/core/display.js @@ -224,6 +224,18 @@ export default class Display { this.viewportChangePos(0, 0); } + getImageData() { + return this._drawCtx.getImageData(0, 0, this.width, this.height); + } + + toDataURL(type, encoderOptions) { + return this._backbuffer.toDataURL(type, encoderOptions); + } + + toBlob(callback, type, quality) { + return this._backbuffer.toBlob(callback, type, quality); + } + // Track what parts of the visible canvas that need updating _damage(x, y, w, h) { if (x < this._damageBounds.left) { diff --git a/core/rfb.js b/core/rfb.js index 4b3526f..e6647ef 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -500,6 +500,18 @@ export default class RFB extends EventTargetMixin { } } + getImageData() { + return this._display.getImageData(); + } + + toDataURL(type, encoderOptions) { + return this._display.toDataURL(type, encoderOptions); + } + + toBlob(callback, type, quality) { + return this._display.toBlob(callback, type, quality); + } + // ===== PRIVATE METHODS ===== _connect() { |