UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

64 lines (63 loc) 2.07 kB
import { __exports as rre } from "../../../../../_virtual/rre.mjs"; (function(exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var RREDecoder = /* @__PURE__ */ function() { function RREDecoder2() { _classCallCheck(this, RREDecoder2); this._subrects = 0; } _createClass(RREDecoder2, [{ key: "decodeRect", value: function decodeRect(x, y, width, height, sock, display, depth) { if (this._subrects === 0) { if (sock.rQwait("RRE", 4 + 4)) { return false; } this._subrects = sock.rQshift32(); var color = sock.rQshiftBytes(4); display.fillRect(x, y, width, height, color); } while (this._subrects > 0) { if (sock.rQwait("RRE", 4 + 8)) { return false; } var _color = sock.rQshiftBytes(4); var sx = sock.rQshift16(); var sy = sock.rQshift16(); var swidth = sock.rQshift16(); var sheight = sock.rQshift16(); display.fillRect(x + sx, y + sy, swidth, sheight, _color); this._subrects--; } return true; } }]); return RREDecoder2; }(); exports["default"] = RREDecoder; })(rre);