tightpng.js 687 B

123456789101112131415161718192021222324252627
  1. /*
  2. * noVNC: HTML5 VNC client
  3. * Copyright (C) 2019 The noVNC Authors
  4. * Licensed under MPL 2.0 (see LICENSE.txt)
  5. *
  6. * See README.md for usage and integration instructions.
  7. *
  8. */
  9. import TightDecoder from './tight.js';
  10. export default class TightPNGDecoder extends TightDecoder {
  11. _pngRect(x, y, width, height, sock, display, depth) {
  12. let data = this._readData(sock);
  13. if (data === null) {
  14. return false;
  15. }
  16. display.imageRect(x, y, width, height, "image/png", data);
  17. return true;
  18. }
  19. _basicRect(ctl, x, y, width, height, sock, display, depth) {
  20. throw new Error("BasicCompression received in TightPNG rect");
  21. }
  22. }