access to raw image data

This commit is contained in:
Frederik Fix
2022-09-07 13:26:10 +02:00
parent 2f1e11b54a
commit edc7520e27
3 changed files with 85 additions and 0 deletions

View File

@@ -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) {

View File

@@ -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() {