| 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 | |
| 10 | import TightDecoder from './tight.js'; |
| 11 | |
| 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 | |
| 19 | display.imageRect(x, y, width, height, "image/png", data); |
| 20 | |
| 21 | return true; |
| 22 | } |
| 23 | |
| 24 | _basicRect(ctl, x, y, width, height, sock, display, depth) { |
| 25 | throw new Error("BasicCompression received in TightPNG rect"); |
| 26 | } |
| 27 | } |