tightpng.js 768 B

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