Lines Matching refs:FBU

83     FBU            = {  variable in RFB
306 FBU.rects = 0;
307 FBU.subrects = 0; // RRE and HEXTILE
308 FBU.lines = 0; // RAW
309 FBU.tiles = 0; // HEXTILE
310 FBU.imgQ = []; // TIGHT_PNG image queue
311 FBU.zlibs = []; // TIGHT zlib encoders
322 FBU.zlibs[i] = new TINF();
323 FBU.zlibs[i].init();
903 if (FBU.rects > 0) {
959 if (FBU.rects === 0) {
966 FBU.rects = ws.rQshift16();
968 FBU.bytes = 0;
976 while (FBU.rects > 0) {
980 if (ws.rQwait("FBU", FBU.bytes)) { return false; }
981 if (FBU.bytes === 0) {
986 FBU.x = (hdr[0] << 8) + hdr[1];
987 FBU.y = (hdr[2] << 8) + hdr[3];
988 FBU.width = (hdr[4] << 8) + hdr[5];
989 FBU.height = (hdr[6] << 8) + hdr[7];
990 FBU.encoding = parseInt((hdr[8] << 24) + (hdr[9] << 16) +
994 {'x': FBU.x, 'y': FBU.y,
995 'width': FBU.width, 'height': FBU.height,
996 'encoding': FBU.encoding,
997 'encodingName': encNames[FBU.encoding]});
999 if (encNames[FBU.encoding]) {
1012 FBU.encoding);
1019 ret = encHandlers[FBU.encoding]();
1025 encStats[FBU.encoding][0] += 1;
1026 encStats[FBU.encoding][1] += 1;
1027 timing.pixels += FBU.width * FBU.height;
1030 if (FBU.rects === 0 || (timing.pixels >= (fb_width * fb_height))) {
1031 if (((FBU.width === fb_width) &&
1032 (FBU.height === fb_height)) ||
1062 {'x': FBU.x, 'y': FBU.y,
1063 'width': FBU.width, 'height': FBU.height,
1064 'encoding': FBU.encoding,
1065 'encodingName': encNames[FBU.encoding]});
1079 if (FBU.lines === 0) {
1080 FBU.lines = FBU.height;
1082 FBU.bytes = FBU.width * fb_Bpp; // At least a line
1083 if (ws.rQwait("RAW", FBU.bytes)) { return false; }
1084 cur_y = FBU.y + (FBU.height - FBU.lines);
1085 cur_height = Math.min(FBU.lines,
1086 Math.floor(ws.rQlen()/(FBU.width * fb_Bpp)));
1087 display.blitImage(FBU.x, cur_y, FBU.width, cur_height,
1089 ws.rQshiftBytes(FBU.width * cur_height * fb_Bpp);
1090 FBU.lines -= cur_height;
1092 if (FBU.lines > 0) {
1093 FBU.bytes = FBU.width * fb_Bpp; // At least another line
1095 FBU.rects -= 1;
1096 FBU.bytes = 0;
1110 display.copyImage(old_x, old_y, FBU.x, FBU.y, FBU.width, FBU.height);
1111 FBU.rects -= 1;
1112 FBU.bytes = 0;
1120 if (FBU.subrects === 0) {
1122 FBU.subrects = ws.rQshift32();
1124 display.fillRect(FBU.x, FBU.y, FBU.width, FBU.height, color);
1126 while ((FBU.subrects > 0) && (ws.rQlen() >= (fb_Bpp + 8))) {
1132 display.fillRect(FBU.x + x, FBU.y + y, width, height, color);
1133 FBU.subrects -= 1;
1138 if (FBU.subrects > 0) {
1139 chunk = Math.min(rre_chunk_sz, FBU.subrects);
1140 FBU.bytes = (fb_Bpp + 8) * chunk;
1142 FBU.rects -= 1;
1143 FBU.bytes = 0;
1155 if (FBU.tiles === 0) {
1156 FBU.tiles_x = Math.ceil(FBU.width/16);
1157 FBU.tiles_y = Math.ceil(FBU.height/16);
1158 FBU.total_tiles = FBU.tiles_x * FBU.tiles_y;
1159 FBU.tiles = FBU.total_tiles;
1163 while (FBU.tiles > 0) {
1164 FBU.bytes = 1;
1165 if (ws.rQwait("HEXTILE subencoding", FBU.bytes)) { return false; }
1173 cur_tile = FBU.total_tiles - FBU.tiles;
1174 tile_x = cur_tile % FBU.tiles_x;
1175 tile_y = Math.floor(cur_tile / FBU.tiles_x);
1176 x = FBU.x + tile_x * 16;
1177 y = FBU.y + tile_y * 16;
1178 w = Math.min(16, (FBU.x + FBU.width) - x);
1179 h = Math.min(16, (FBU.y + FBU.height) - y);
1184 FBU.bytes += w * h * fb_Bpp;
1187 FBU.bytes += fb_Bpp;
1190 FBU.bytes += fb_Bpp;
1193 FBU.bytes += 1; // Since we aren't shifting it off
1194 if (ws.rQwait("hextile subrects header", FBU.bytes)) { return false; }
1195 subrects = rQ[rQi + FBU.bytes-1]; // Peek
1197 FBU.bytes += subrects * (fb_Bpp + 2);
1199 FBU.bytes += subrects * 2;
1215 if (ws.rQwait("hextile", FBU.bytes)) { return false; }
1218 FBU.subencoding = rQ[rQi];
1220 if (FBU.subencoding === 0) {
1221 if (FBU.lastsubencoding & 0x01) {
1225 display.fillRect(x, y, w, h, FBU.background);
1227 } else if (FBU.subencoding & 0x01) { // Raw
1229 rQi += FBU.bytes - 1;
1231 if (FBU.subencoding & 0x02) { // Background
1232 FBU.background = rQ.slice(rQi, rQi + fb_Bpp);
1235 if (FBU.subencoding & 0x04) { // Foreground
1236 FBU.foreground = rQ.slice(rQi, rQi + fb_Bpp);
1240 display.startTile(x, y, w, h, FBU.background);
1241 if (FBU.subencoding & 0x08) { // AnySubrects
1245 if (FBU.subencoding & 0x10) { // SubrectsColoured
1249 color = FBU.foreground;
1267 FBU.lastsubencoding = FBU.subencoding;
1268 FBU.bytes = 0;
1269 FBU.tiles -= 1;
1272 if (FBU.tiles === 0) {
1273 FBU.rects -= 1;
1307 FBU.bytes = 1; // compression-control byte
1308 if (ws.rQwait("TIGHT compression-control", FBU.bytes)) { return false; }
1322 FBU.zlibs[i].reset();
1326 var uncompressed = FBU.zlibs[streamId].uncompress(data, 0);
1340 FBU.bytes += paletteSize;
1341 if (ws.rQwait("TIGHT palette " + cmode, FBU.bytes)) { return false; }
1344 var rowSize = Math.floor((FBU.width * bpp + 7) / 8);
1346 if (rowSize * FBU.height < 12) {
1348 clength = [0, rowSize * FBU.height];
1353 FBU.bytes += clength[0] + clength[1];
1354 if (ws.rQwait("TIGHT " + cmode, FBU.bytes)) { return false; }
1372 w = Math.floor((FBU.width + 7) / 8);
1373 w1 = Math.floor(FBU.width / 8);
1374 for (y = 0; y < FBU.height; y++) {
1377 dp = (y*FBU.width + x*8 + 7-b) * 3;
1384 for (b = 7; b >= 8 - FBU.width % 8; b--) {
1385 dp = (y*FBU.width + x*8 + 7-b) * 3;
1393 for (y = 0; y < FBU.height; y++) {
1394 for (x = 0; x < FBU.width; x++) {
1395 dp = (y*FBU.width + x) * 3;
1396 sp = data[y*FBU.width + x] * 3;
1404 FBU.imgQ.push({
1407 'x': FBU.x,
1408 'y': FBU.y,
1409 'width': FBU.width,
1410 'height': FBU.height});
1416 var uncompressedSize = FBU.width * FBU.height * fb_depth;
1423 FBU.bytes = 1 + clength[0] + clength[1];
1424 if (ws.rQwait("TIGHT " + cmode, FBU.bytes)) { return false; }
1435 FBU.imgQ.push({
1438 'x': FBU.x,
1439 'y': FBU.y,
1440 'width': FBU.width,
1441 'height': FBU.height});
1467 case "fill": FBU.bytes += fb_depth; break; // TPIXEL
1468 case "jpeg": FBU.bytes += 3; break; // max clength
1469 case "png": FBU.bytes += 3; break; // max clength
1470 case "filter": FBU.bytes += 2; break; // filter id + num colors if palette
1474 if (ws.rQwait("TIGHT " + cmode, FBU.bytes)) { return false; }
1484 FBU.imgQ.push({
1487 'x': FBU.x,
1488 'y': FBU.y,
1489 'width': FBU.width,
1490 'height': FBU.height,
1496 FBU.bytes = 1 + clength[0] + clength[1]; // ctl + clength size + jpeg-data
1497 if (ws.rQwait("TIGHT " + cmode, FBU.bytes)) { return false; }
1505 FBU.imgQ.push({
1508 'x': FBU.x,
1509 'y': FBU.y});
1529 FBU.bytes = 0;
1530 FBU.rects -= 1;
1549 imgQ = FBU.imgQ;
1569 FBU.rects = 0;
1576 fb_width = FBU.width;
1577 fb_height = FBU.height;
1583 FBU.bytes = 0;
1584 FBU.rects -= 1;
1593 x = FBU.x; // hotspot-x
1594 y = FBU.y; // hotspot-y
1595 w = FBU.width;
1596 h = FBU.height;
1601 FBU.bytes = pixelslength + masklength;
1602 if (ws.rQwait("cursor encoding", FBU.bytes)) { return false; }
1610 FBU.bytes = 0;
1611 FBU.rects -= 1;