@h-rig/cli 0.0.6-alpha.85 → 0.0.6-alpha.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/rig.js +9 -1018
- package/dist/src/app-opentui/bootstrap.js +9 -1018
- package/dist/src/app-opentui/index.js +7 -1024
- package/dist/src/app-opentui/react/App.js +2 -969
- package/dist/src/app-opentui/react/Backdrop.js +2 -9
- package/dist/src/app-opentui/react/ChromeHost.js +0 -1039
- package/dist/src/app-opentui/react/launch.js +2 -969
- package/dist/src/app-opentui/render/constants.d.ts +0 -1
- package/dist/src/app-opentui/render/constants.js +0 -2
- package/dist/src/app-opentui/render/graphics.js +2 -9
- package/dist/src/app-opentui/runtime.js +8 -1025
- package/package.json +8 -8
- package/dist/src/app-opentui/render/image-visual-layer-worker.d.ts +0 -1
- package/dist/src/app-opentui/render/image-visual-layer-worker.js +0 -1084
- package/dist/src/app-opentui/render/image-visual-layer.d.ts +0 -109
- package/dist/src/app-opentui/render/image-visual-layer.js +0 -1068
- package/dist/src/app-opentui/terminal-capabilities.d.ts +0 -7
- package/dist/src/app-opentui/terminal-capabilities.js +0 -15
|
@@ -1,1068 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/render/image-visual-layer.ts
|
|
3
|
-
import { Worker } from "worker_threads";
|
|
4
|
-
import { deflateSync } from "zlib";
|
|
5
|
-
import { allocateImageId, deleteKittyImage } from "@earendil-works/pi-tui";
|
|
6
|
-
|
|
7
|
-
// packages/cli/src/app-opentui/terminal-capabilities.ts
|
|
8
|
-
import { getCapabilities } from "@earendil-works/pi-tui";
|
|
9
|
-
function getRigTerminalCapabilities() {
|
|
10
|
-
const imageProtocol = getCapabilities().images;
|
|
11
|
-
const supportsKittyImages = imageProtocol === "kitty";
|
|
12
|
-
return {
|
|
13
|
-
imageProtocol,
|
|
14
|
-
supportsKittyImages,
|
|
15
|
-
visualMode: supportsKittyImages ? "kitty-images" : "framebuffer-fallback"
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// packages/cli/src/app-opentui/render/ascii-fleet.ts
|
|
20
|
-
var LEAD_DRONE = [
|
|
21
|
-
" .-=-. .-=-. ",
|
|
22
|
-
" ( !!! ) ( !!! ) ",
|
|
23
|
-
" '-=-'._ _.'-=-' ",
|
|
24
|
-
" '._ _.' ",
|
|
25
|
-
" '=$$$$$$$=.' ",
|
|
26
|
-
" =$$$$$$$$$$$= ",
|
|
27
|
-
" $$$@@@@@@@@@@$$$ ",
|
|
28
|
-
" $$$@@ @@$$$ ",
|
|
29
|
-
" $$@ ? @$$$ ",
|
|
30
|
-
" $$$@ '-' @$$$ ",
|
|
31
|
-
" $$$@@ @@$$$ ",
|
|
32
|
-
" $$$@@@@@@@@@@$$$ ",
|
|
33
|
-
" =$$$$$$$$$$$= ",
|
|
34
|
-
" '=$$$$$$$=.' ",
|
|
35
|
-
" _.' '._ ",
|
|
36
|
-
" .-=-.' '.-=-. ",
|
|
37
|
-
" ( !!! ) ( !!! ) ",
|
|
38
|
-
" '-=-' '-=-' "
|
|
39
|
-
];
|
|
40
|
-
var MINI_DRONE = [
|
|
41
|
-
"(!!!) (!!!)",
|
|
42
|
-
" \\%==%/ ",
|
|
43
|
-
" %%?%% ",
|
|
44
|
-
" /%==%\\ ",
|
|
45
|
-
"(!!!) (!!!)"
|
|
46
|
-
];
|
|
47
|
-
var ROTORS = ["---", "\\\\\\", "|||", "///"];
|
|
48
|
-
var FLEET_GRID_WIDTH = 52;
|
|
49
|
-
var FLEET_GRID_HEIGHT = 27;
|
|
50
|
-
var FLEET = [
|
|
51
|
-
{ art: MINI_DRONE, x: 0, y: 2, amp: 1, speed: 0.05, phase: 0, dx: 1, driftSpeed: 0.02 },
|
|
52
|
-
{ art: MINI_DRONE, x: 39, y: 2, amp: 1, speed: 0.044, phase: 2.1, dx: 1, driftSpeed: 0.017 },
|
|
53
|
-
{ art: MINI_DRONE, x: 1, y: 20, amp: 1, speed: 0.048, phase: 4.2, dx: 1, driftSpeed: 0.023 },
|
|
54
|
-
{ art: MINI_DRONE, x: 38, y: 20, amp: 1, speed: 0.041, phase: 1.3, dx: 1, driftSpeed: 0.015 },
|
|
55
|
-
{ art: LEAD_DRONE, x: 10, y: 5, amp: 2, speed: 0.04, phase: 0, dx: 0, driftSpeed: 0.011 }
|
|
56
|
-
];
|
|
57
|
-
function fleetRows(tick, options = {}) {
|
|
58
|
-
const animate = options.animate ?? true;
|
|
59
|
-
const t = animate ? tick : 0;
|
|
60
|
-
const blade = ROTORS[Math.floor(t / 4) % ROTORS.length];
|
|
61
|
-
const pulse = Math.sin(t * 0.07);
|
|
62
|
-
const eye = pulse > 0.45 ? "@" : pulse > -0.1 ? "o" : ".";
|
|
63
|
-
const grid = Array.from({ length: FLEET_GRID_HEIGHT }, () => Array.from({ length: FLEET_GRID_WIDTH }, () => " "));
|
|
64
|
-
for (const drone of FLEET) {
|
|
65
|
-
const yOffset = drone.y + Math.round(drone.amp * Math.sin(t * drone.speed + drone.phase));
|
|
66
|
-
const xOffset = drone.x + Math.round(drone.dx * Math.sin(t * drone.driftSpeed + drone.phase));
|
|
67
|
-
for (let row = 0;row < drone.art.length; row += 1) {
|
|
68
|
-
const source = drone.art[row];
|
|
69
|
-
const targetY = yOffset + row;
|
|
70
|
-
if (targetY < 0 || targetY >= FLEET_GRID_HEIGHT)
|
|
71
|
-
continue;
|
|
72
|
-
for (let col = 0;col < source.length; col += 1) {
|
|
73
|
-
let char = source[col];
|
|
74
|
-
if (char === " ")
|
|
75
|
-
continue;
|
|
76
|
-
const targetX = xOffset + col;
|
|
77
|
-
if (targetX < 0 || targetX >= FLEET_GRID_WIDTH)
|
|
78
|
-
continue;
|
|
79
|
-
if (source.slice(col, col + 3) === "!!!") {
|
|
80
|
-
for (let rotorIndex = 0;rotorIndex < 3; rotorIndex += 1) {
|
|
81
|
-
if (targetX + rotorIndex < FLEET_GRID_WIDTH)
|
|
82
|
-
grid[targetY][targetX + rotorIndex] = blade[rotorIndex];
|
|
83
|
-
}
|
|
84
|
-
col += 2;
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
if (char === "?")
|
|
88
|
-
char = eye;
|
|
89
|
-
grid[targetY][targetX] = char;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return grid.map((row) => row.join("").replace(/\s+$/, ""));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// packages/cli/src/app-opentui/render/panel-layout.ts
|
|
97
|
-
function panelPixelPlacement(layout, panel, size, minPixels = 8) {
|
|
98
|
-
const cellW = size.width / layout.width;
|
|
99
|
-
const cellH = size.height / layout.height;
|
|
100
|
-
const leftCells = layout.centerLeft + (panel.left ?? 0);
|
|
101
|
-
const topCells = layout.centerTop + panel.top;
|
|
102
|
-
const widthCells = panel.width ?? layout.centerWidth;
|
|
103
|
-
const heightCells = panel.height;
|
|
104
|
-
const left = Math.round(leftCells * cellW);
|
|
105
|
-
const top = Math.round(topCells * cellH);
|
|
106
|
-
const width = Math.round(widthCells * cellW);
|
|
107
|
-
const height = Math.round(heightCells * cellH);
|
|
108
|
-
return width > minPixels && height > minPixels ? { left, top, width, height, leftCells, topCells, widthCells, heightCells } : null;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// packages/cli/src/app-opentui/render/constants.ts
|
|
112
|
-
var GLOW_FALLOFF_EXP_IMAGE = 2.4;
|
|
113
|
-
|
|
114
|
-
// packages/cli/src/app-opentui/render/image-visual-layer.ts
|
|
115
|
-
var PANEL_MASK_RADIUS_MIN = 14;
|
|
116
|
-
var PANEL_MASK_RADIUS_MAX = 34;
|
|
117
|
-
var PANEL_MASK_RADIUS_FACTOR = 0.035;
|
|
118
|
-
var PANEL_BLUR_RADIUS_MIN = 8;
|
|
119
|
-
var PANEL_BLUR_RADIUS_MAX = 28;
|
|
120
|
-
var PANEL_BLUR_RADIUS_FACTOR = 0.018;
|
|
121
|
-
var BG = [7, 8, 9, 255];
|
|
122
|
-
var PANEL = [16, 17, 21, 184];
|
|
123
|
-
var PANEL_HEADER = [16, 17, 21, 190];
|
|
124
|
-
var PANEL_LINE = [255, 255, 255, 24];
|
|
125
|
-
var LIME = [204, 255, 77, 255];
|
|
126
|
-
var LIME_DIM = [169, 214, 63, 255];
|
|
127
|
-
var CYAN = [86, 216, 255, 255];
|
|
128
|
-
var MAGENTA = [255, 121, 176, 255];
|
|
129
|
-
var INK_DIM = [108, 110, 121, 255];
|
|
130
|
-
var PNG_SIGNATURE = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
131
|
-
var CRC_TABLE = makeCrcTable();
|
|
132
|
-
var MAX_IMAGE_BYTES = 48 * 1024 * 1024;
|
|
133
|
-
var KITTY_CHUNK_SIZE = 4096;
|
|
134
|
-
var PANEL_BLUR_SCALE = 1;
|
|
135
|
-
var PANEL_MASK_CACHE_LIMIT = 16;
|
|
136
|
-
var ZLIB_LEVEL = 1;
|
|
137
|
-
var DEFAULT_IMAGE_RESOLUTION_SCALE = 1;
|
|
138
|
-
var LOAD_BUCKETS = 5;
|
|
139
|
-
function loadBucket(load) {
|
|
140
|
-
if (!Number.isFinite(load ?? NaN))
|
|
141
|
-
return 0;
|
|
142
|
-
return Math.max(0, Math.min(LOAD_BUCKETS, Math.round((load ?? 0) * LOAD_BUCKETS)));
|
|
143
|
-
}
|
|
144
|
-
var panelMaskCache = new Map;
|
|
145
|
-
var BG_WORD = rgbaWord(BG);
|
|
146
|
-
function imageTransport() {
|
|
147
|
-
const forced = process.env.RIG_OPENTUI_IMAGE_TRANSPORT;
|
|
148
|
-
if (forced === "rgba-zlib")
|
|
149
|
-
return "rgba-zlib";
|
|
150
|
-
return "png";
|
|
151
|
-
}
|
|
152
|
-
function imageResolutionScale() {
|
|
153
|
-
const raw = Number.parseFloat(process.env.RIG_OPENTUI_IMAGE_SCALE ?? "");
|
|
154
|
-
if (Number.isFinite(raw) && raw > 0)
|
|
155
|
-
return Math.max(0.25, Math.min(1, raw));
|
|
156
|
-
return DEFAULT_IMAGE_RESOLUTION_SCALE;
|
|
157
|
-
}
|
|
158
|
-
function rgbaWord(color) {
|
|
159
|
-
return (color[3] << 24 | color[2] << 16 | color[1] << 8 | color[0]) >>> 0;
|
|
160
|
-
}
|
|
161
|
-
function fillRgba(data, color, word = rgbaWord(color)) {
|
|
162
|
-
if (data.byteOffset % 4 === 0 && data.byteLength % 4 === 0) {
|
|
163
|
-
new Uint32Array(data.buffer, data.byteOffset, data.byteLength / 4).fill(word);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
for (let i = 0;i < data.length; i += 4) {
|
|
167
|
-
data[i] = color[0];
|
|
168
|
-
data[i + 1] = color[1];
|
|
169
|
-
data[i + 2] = color[2];
|
|
170
|
-
data[i + 3] = color[3];
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
var ASCII_GLYPHS = {
|
|
174
|
-
".": ["00000", "00000", "00000", "00000", "00000", "00100", "00100"],
|
|
175
|
-
"'": ["00100", "00100", "00000", "00000", "00000", "00000", "00000"],
|
|
176
|
-
"-": ["00000", "00000", "00000", "11111", "00000", "00000", "00000"],
|
|
177
|
-
_: ["00000", "00000", "00000", "00000", "00000", "00000", "11111"],
|
|
178
|
-
"=": ["00000", "11111", "00000", "00000", "11111", "00000", "00000"],
|
|
179
|
-
"|": ["00100", "00100", "00100", "00100", "00100", "00100", "00100"],
|
|
180
|
-
"/": ["00001", "00010", "00010", "00100", "01000", "01000", "10000"],
|
|
181
|
-
"\\": ["10000", "01000", "01000", "00100", "00010", "00010", "00001"],
|
|
182
|
-
"(": ["00010", "00100", "01000", "01000", "01000", "00100", "00010"],
|
|
183
|
-
")": ["01000", "00100", "00010", "00010", "00010", "00100", "01000"],
|
|
184
|
-
"!": ["00100", "00100", "00100", "00100", "00100", "00000", "00100"],
|
|
185
|
-
"%": ["11001", "11010", "00100", "01000", "10110", "00110", "00000"],
|
|
186
|
-
$: ["00100", "11110", "10100", "11110", "00101", "11110", "00100"],
|
|
187
|
-
"@": ["01110", "10001", "10111", "10101", "10111", "10000", "01111"],
|
|
188
|
-
o: ["00000", "01110", "10001", "10001", "10001", "01110", "00000"],
|
|
189
|
-
"*": ["00100", "10101", "01110", "11111", "01110", "10101", "00100"]
|
|
190
|
-
};
|
|
191
|
-
function sceneStaticTick(scene) {
|
|
192
|
-
let hash = 0;
|
|
193
|
-
for (let index = 0;index < scene.length; index += 1)
|
|
194
|
-
hash = hash * 33 + scene.charCodeAt(index) >>> 0;
|
|
195
|
-
return 11 + hash % 97;
|
|
196
|
-
}
|
|
197
|
-
function charColor(char, row, totalRows) {
|
|
198
|
-
if (char === "@" || char === "$" || char === "o")
|
|
199
|
-
return LIME;
|
|
200
|
-
if (char === "%" || char === "!" || char === "/" || char === "\\" || char === "|")
|
|
201
|
-
return CYAN;
|
|
202
|
-
if (char === "." || char === "'" || char === "_" || row < 3 || row > totalRows - 4)
|
|
203
|
-
return INK_DIM;
|
|
204
|
-
if (char === "-" || char === "=" || char === "(" || char === ")")
|
|
205
|
-
return LIME_DIM;
|
|
206
|
-
return MAGENTA;
|
|
207
|
-
}
|
|
208
|
-
function fillRectAlpha(data, width, height, left, top, rectWidth, rectHeight, color, alpha) {
|
|
209
|
-
const x0 = Math.max(0, Math.floor(left));
|
|
210
|
-
const y0 = Math.max(0, Math.floor(top));
|
|
211
|
-
const x1 = Math.min(width, Math.ceil(left + rectWidth));
|
|
212
|
-
const y1 = Math.min(height, Math.ceil(top + rectHeight));
|
|
213
|
-
for (let y = y0;y < y1; y += 1) {
|
|
214
|
-
for (let x = x0;x < x1; x += 1)
|
|
215
|
-
blendOver(data, (y * width + x) * 4, color, alpha);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
function drawAsciiGlyph(data, width, height, x, y, cellWidth, cellHeight, char, color, alpha) {
|
|
219
|
-
const pattern = ASCII_GLYPHS[char] ?? ASCII_GLYPHS["*"];
|
|
220
|
-
const glyphWidth = Math.max(1, cellWidth * 0.56);
|
|
221
|
-
const glyphHeight = Math.max(1, cellHeight * 0.7);
|
|
222
|
-
const originX = x + (cellWidth - glyphWidth) * 0.5;
|
|
223
|
-
const originY = y + (cellHeight - glyphHeight) * 0.5;
|
|
224
|
-
const pixelWidth = Math.max(1, glyphWidth / pattern[0].length);
|
|
225
|
-
const pixelHeight = Math.max(1, glyphHeight / pattern.length);
|
|
226
|
-
for (let row = 0;row < pattern.length; row += 1) {
|
|
227
|
-
const bits = pattern[row];
|
|
228
|
-
for (let col = 0;col < bits.length; col += 1) {
|
|
229
|
-
if (bits[col] !== "1")
|
|
230
|
-
continue;
|
|
231
|
-
fillRectAlpha(data, width, height, originX + col * pixelWidth, originY + row * pixelHeight, pixelWidth * 0.72, pixelHeight * 0.72, color, alpha);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
function drawStaticAsciiFleetBackground(data, width, height, scene, layout, load, activeRuns) {
|
|
236
|
-
const rows = fleetRows(sceneStaticTick(scene), { animate: true });
|
|
237
|
-
const cellWidth = width / Math.max(1, layout.width);
|
|
238
|
-
const cellHeight = height / Math.max(1, layout.height);
|
|
239
|
-
const sideBySide = layout.width >= FLEET_GRID_WIDTH * 1.9;
|
|
240
|
-
const leftCells = sideBySide ? Math.max(1, Math.floor(layout.width * 0.3 - FLEET_GRID_WIDTH / 2)) : Math.floor((layout.width - FLEET_GRID_WIDTH) / 2);
|
|
241
|
-
const topCells = Math.floor((layout.height - FLEET_GRID_HEIGHT) / 2);
|
|
242
|
-
const fleetLeft = leftCells * cellWidth;
|
|
243
|
-
const fleetTop = topCells * cellHeight;
|
|
244
|
-
drawGlow(data, width, height, width * 0.5, height * 0.5, Math.min(width, height) * 0.4, LIME, 0.022 + load * 0.03);
|
|
245
|
-
drawGlow(data, width, height, width * 0.18, height * 0.22, Math.min(width, height) * 0.28, CYAN, 0.018 + load * 0.012);
|
|
246
|
-
drawGlow(data, width, height, width * 0.82, height * 0.78, Math.min(width, height) * 0.22, MAGENTA, 0.012 + load * 0.008);
|
|
247
|
-
let droneTotal = 0;
|
|
248
|
-
for (const line of rows)
|
|
249
|
-
for (const char of line)
|
|
250
|
-
if (char === "@" || char === "$" || char === "%")
|
|
251
|
-
droneTotal += 1;
|
|
252
|
-
const litTarget = Math.max(0, Math.min(droneTotal, activeRuns));
|
|
253
|
-
let droneIndex = 0;
|
|
254
|
-
for (let row = 0;row < rows.length; row += 1) {
|
|
255
|
-
const line = rows[row];
|
|
256
|
-
for (let col = 0;col < line.length; col += 1) {
|
|
257
|
-
const char = line[col];
|
|
258
|
-
if (char === " ")
|
|
259
|
-
continue;
|
|
260
|
-
const x = fleetLeft + col * cellWidth;
|
|
261
|
-
const y = fleetTop + row * cellHeight;
|
|
262
|
-
const color = charColor(char, row, rows.length);
|
|
263
|
-
const isDrone = char === "@" || char === "$" || char === "%";
|
|
264
|
-
const lit = isDrone && droneIndex < litTarget;
|
|
265
|
-
drawAsciiGlyph(data, width, height, x + cellWidth * 0.07, y + cellHeight * 0.05, cellWidth, cellHeight, char, color, lit ? 0.72 : 0.46);
|
|
266
|
-
if (isDrone) {
|
|
267
|
-
droneIndex += 1;
|
|
268
|
-
drawGlow(data, width, height, x + cellWidth * 0.5, y + cellHeight * 0.5, Math.max(cellWidth, cellHeight) * 0.95, color, lit ? 0.044 : 0.014);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
function applyStaticAtmosphere(data, width, height, load) {
|
|
274
|
-
const cx = width * 0.5;
|
|
275
|
-
const cy = height * 0.42;
|
|
276
|
-
const radius = Math.max(width, height) * 0.78;
|
|
277
|
-
const minVignette = 0.1 - load * 0.02;
|
|
278
|
-
for (let y = 0;y < height; y += 1) {
|
|
279
|
-
for (let x = 0;x < width; x += 1) {
|
|
280
|
-
const distance = Math.hypot(x - cx, y - cy) / radius;
|
|
281
|
-
const alpha = Math.max(minVignette, Math.min(0.82, 0.12 + Math.pow(distance, 1.65) * 0.62));
|
|
282
|
-
blendOver(data, (y * width + x) * 4, BG, alpha);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
drawGlow(data, width, height, width * 0.82, height * 0.04, Math.min(width, height) * 0.2, LIME, 0.024 + load * 0.012);
|
|
286
|
-
drawGlow(data, width, height, width * 0.12, height * 0.18, Math.min(width, height) * 0.16, CYAN, 0.018 + load * 0.008);
|
|
287
|
-
}
|
|
288
|
-
function makeCrcTable() {
|
|
289
|
-
const table = new Uint32Array(256);
|
|
290
|
-
for (let n = 0;n < 256; n += 1) {
|
|
291
|
-
let c = n;
|
|
292
|
-
for (let k = 0;k < 8; k += 1)
|
|
293
|
-
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
294
|
-
table[n] = c >>> 0;
|
|
295
|
-
}
|
|
296
|
-
return table;
|
|
297
|
-
}
|
|
298
|
-
function crc32(bytes) {
|
|
299
|
-
let c = 4294967295;
|
|
300
|
-
for (let i = 0;i < bytes.length; i += 1)
|
|
301
|
-
c = CRC_TABLE[(c ^ bytes[i]) & 255] ^ c >>> 8;
|
|
302
|
-
return (c ^ 4294967295) >>> 0;
|
|
303
|
-
}
|
|
304
|
-
function chunk(type, data) {
|
|
305
|
-
const out = new Uint8Array(12 + data.length);
|
|
306
|
-
const view = new DataView(out.buffer);
|
|
307
|
-
view.setUint32(0, data.length);
|
|
308
|
-
out[4] = type.charCodeAt(0);
|
|
309
|
-
out[5] = type.charCodeAt(1);
|
|
310
|
-
out[6] = type.charCodeAt(2);
|
|
311
|
-
out[7] = type.charCodeAt(3);
|
|
312
|
-
out.set(data, 8);
|
|
313
|
-
view.setUint32(8 + data.length, crc32(out.subarray(4, 8 + data.length)));
|
|
314
|
-
return out;
|
|
315
|
-
}
|
|
316
|
-
function encodePng(width, height, rgba) {
|
|
317
|
-
const ihdr = new Uint8Array(13);
|
|
318
|
-
const ihdrView = new DataView(ihdr.buffer);
|
|
319
|
-
ihdrView.setUint32(0, width);
|
|
320
|
-
ihdrView.setUint32(4, height);
|
|
321
|
-
ihdr[8] = 8;
|
|
322
|
-
ihdr[9] = 6;
|
|
323
|
-
ihdr[10] = 0;
|
|
324
|
-
ihdr[11] = 0;
|
|
325
|
-
ihdr[12] = 0;
|
|
326
|
-
const stride = width * 4;
|
|
327
|
-
const raw = new Uint8Array((stride + 1) * height);
|
|
328
|
-
for (let y = 0;y < height; y += 1) {
|
|
329
|
-
const rawOffset = y * (stride + 1);
|
|
330
|
-
raw[rawOffset] = 0;
|
|
331
|
-
raw.set(rgba.subarray(y * stride, y * stride + stride), rawOffset + 1);
|
|
332
|
-
}
|
|
333
|
-
const compressed = deflateSync(raw, { level: ZLIB_LEVEL });
|
|
334
|
-
return Buffer.concat([
|
|
335
|
-
Buffer.from(PNG_SIGNATURE),
|
|
336
|
-
Buffer.from(chunk("IHDR", ihdr)),
|
|
337
|
-
Buffer.from(chunk("IDAT", compressed)),
|
|
338
|
-
Buffer.from(chunk("IEND", new Uint8Array(0)))
|
|
339
|
-
]);
|
|
340
|
-
}
|
|
341
|
-
function kittyImageSequence(base64, options) {
|
|
342
|
-
const params = [`a=T`, `f=${options.format}`, `q=2`, `C=1`, `c=${options.columns}`, `r=${options.rows}`, `i=${options.imageId}`, `z=${options.zIndex}`];
|
|
343
|
-
if (options.format === 32) {
|
|
344
|
-
params.push(`s=${options.pixelWidth ?? 1}`, `v=${options.pixelHeight ?? 1}`);
|
|
345
|
-
if (options.compressed)
|
|
346
|
-
params.push("o=z");
|
|
347
|
-
}
|
|
348
|
-
if (base64.length <= KITTY_CHUNK_SIZE)
|
|
349
|
-
return `\x1B_G${params.join(",")};${base64}\x1B\\`;
|
|
350
|
-
const chunks = [];
|
|
351
|
-
for (let offset = 0;offset < base64.length; offset += KITTY_CHUNK_SIZE) {
|
|
352
|
-
const part = base64.slice(offset, offset + KITTY_CHUNK_SIZE);
|
|
353
|
-
const last = offset + KITTY_CHUNK_SIZE >= base64.length;
|
|
354
|
-
chunks.push(`\x1B_G${offset === 0 ? `${params.join(",")},` : ""}m=${last ? 0 : 1};${part}\x1B\\`);
|
|
355
|
-
}
|
|
356
|
-
return chunks.join("");
|
|
357
|
-
}
|
|
358
|
-
function clampByte(value) {
|
|
359
|
-
return Math.max(0, Math.min(255, Math.round(value)));
|
|
360
|
-
}
|
|
361
|
-
function blendOver(data, index, color, alphaScale = 1) {
|
|
362
|
-
const alpha = color[3] / 255 * alphaScale;
|
|
363
|
-
const inv = 1 - alpha;
|
|
364
|
-
data[index] = clampByte(color[0] * alpha + data[index] * inv);
|
|
365
|
-
data[index + 1] = clampByte(color[1] * alpha + data[index + 1] * inv);
|
|
366
|
-
data[index + 2] = clampByte(color[2] * alpha + data[index + 2] * inv);
|
|
367
|
-
data[index + 3] = 255;
|
|
368
|
-
}
|
|
369
|
-
function drawDisc(data, width, height, cx, cy, radius, color, alpha = 1) {
|
|
370
|
-
const minX = Math.max(0, Math.floor(cx - radius));
|
|
371
|
-
const maxX = Math.min(width - 1, Math.ceil(cx + radius));
|
|
372
|
-
const minY = Math.max(0, Math.floor(cy - radius));
|
|
373
|
-
const maxY = Math.min(height - 1, Math.ceil(cy + radius));
|
|
374
|
-
for (let y = minY;y <= maxY; y += 1) {
|
|
375
|
-
for (let x = minX;x <= maxX; x += 1) {
|
|
376
|
-
const dx = x + 0.5 - cx;
|
|
377
|
-
const dy = y + 0.5 - cy;
|
|
378
|
-
const d = Math.sqrt(dx * dx + dy * dy);
|
|
379
|
-
if (d > radius)
|
|
380
|
-
continue;
|
|
381
|
-
const edge = Math.max(0, Math.min(1, radius - d));
|
|
382
|
-
blendOver(data, (y * width + x) * 4, color, alpha * Math.min(1, 0.35 + edge));
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
function drawGlow(data, width, height, cx, cy, radius, color, alpha = 0.18) {
|
|
387
|
-
const minX = Math.max(0, Math.floor(cx - radius));
|
|
388
|
-
const maxX = Math.min(width - 1, Math.ceil(cx + radius));
|
|
389
|
-
const minY = Math.max(0, Math.floor(cy - radius));
|
|
390
|
-
const maxY = Math.min(height - 1, Math.ceil(cy + radius));
|
|
391
|
-
for (let y = minY;y <= maxY; y += 1) {
|
|
392
|
-
for (let x = minX;x <= maxX; x += 1) {
|
|
393
|
-
const dx = x + 0.5 - cx;
|
|
394
|
-
const dy = y + 0.5 - cy;
|
|
395
|
-
const d = Math.sqrt(dx * dx + dy * dy);
|
|
396
|
-
if (d > radius)
|
|
397
|
-
continue;
|
|
398
|
-
const falloff = Math.pow(1 - d / Math.max(1, radius), GLOW_FALLOFF_EXP_IMAGE);
|
|
399
|
-
blendOver(data, (y * width + x) * 4, color, alpha * falloff);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
function drawLine(data, width, height, x0, y0, x1, y1, color, alpha = 0.5, thickness = 1.4) {
|
|
404
|
-
const dx = x1 - x0;
|
|
405
|
-
const dy = y1 - y0;
|
|
406
|
-
const steps = Math.max(1, Math.ceil(Math.hypot(dx, dy) * 1.2));
|
|
407
|
-
for (let i = 0;i <= steps; i += 1) {
|
|
408
|
-
const t = i / steps;
|
|
409
|
-
drawDisc(data, width, height, x0 + dx * t, y0 + dy * t, thickness, color, alpha);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
function roundRectAlpha(px, py, x, y, w, h, r) {
|
|
413
|
-
const rx = Math.max(x + r, Math.min(px, x + w - r));
|
|
414
|
-
const ry = Math.max(y + r, Math.min(py, y + h - r));
|
|
415
|
-
const dx = px - rx;
|
|
416
|
-
const dy = py - ry;
|
|
417
|
-
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
418
|
-
return Math.max(0, Math.min(1, r + 0.75 - dist));
|
|
419
|
-
}
|
|
420
|
-
function panelRect(layout, panel, size) {
|
|
421
|
-
return panelPixelPlacement(layout, panel, size);
|
|
422
|
-
}
|
|
423
|
-
function downsampleRegion(data, canvasW, canvasH, rect, scale) {
|
|
424
|
-
const w = Math.max(1, Math.ceil(rect.width / scale));
|
|
425
|
-
const h = Math.max(1, Math.ceil(rect.height / scale));
|
|
426
|
-
const out = new Uint8ClampedArray(w * h * 3);
|
|
427
|
-
for (let y = 0;y < h; y += 1) {
|
|
428
|
-
for (let x = 0;x < w; x += 1) {
|
|
429
|
-
let r = 0, g = 0, b = 0, count = 0;
|
|
430
|
-
const sx0 = rect.left + x * scale;
|
|
431
|
-
const sy0 = rect.top + y * scale;
|
|
432
|
-
for (let yy = 0;yy < scale; yy += 1) {
|
|
433
|
-
const sy = sy0 + yy;
|
|
434
|
-
if (sy < 0 || sy >= canvasH)
|
|
435
|
-
continue;
|
|
436
|
-
for (let xx = 0;xx < scale; xx += 1) {
|
|
437
|
-
const sx = sx0 + xx;
|
|
438
|
-
if (sx < 0 || sx >= canvasW)
|
|
439
|
-
continue;
|
|
440
|
-
const i = (sy * canvasW + sx) * 4;
|
|
441
|
-
r += data[i];
|
|
442
|
-
g += data[i + 1];
|
|
443
|
-
b += data[i + 2];
|
|
444
|
-
count += 1;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
const oi = (y * w + x) * 3;
|
|
448
|
-
out[oi] = count ? r / count : BG[0];
|
|
449
|
-
out[oi + 1] = count ? g / count : BG[1];
|
|
450
|
-
out[oi + 2] = count ? b / count : BG[2];
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
return { pixels: out, width: w, height: h };
|
|
454
|
-
}
|
|
455
|
-
function blurRgb(buffer, width, height, radius) {
|
|
456
|
-
const tmp = new Uint8ClampedArray(buffer.length);
|
|
457
|
-
const out = new Uint8ClampedArray(buffer.length);
|
|
458
|
-
const window = radius * 2 + 1;
|
|
459
|
-
for (let y = 0;y < height; y += 1) {
|
|
460
|
-
let r = 0, g = 0, b = 0;
|
|
461
|
-
for (let x = -radius;x <= radius; x += 1) {
|
|
462
|
-
const sx = Math.max(0, Math.min(width - 1, x));
|
|
463
|
-
const i = (y * width + sx) * 3;
|
|
464
|
-
r += buffer[i];
|
|
465
|
-
g += buffer[i + 1];
|
|
466
|
-
b += buffer[i + 2];
|
|
467
|
-
}
|
|
468
|
-
for (let x = 0;x < width; x += 1) {
|
|
469
|
-
const oi = (y * width + x) * 3;
|
|
470
|
-
tmp[oi] = r / window;
|
|
471
|
-
tmp[oi + 1] = g / window;
|
|
472
|
-
tmp[oi + 2] = b / window;
|
|
473
|
-
const removeX = Math.max(0, x - radius);
|
|
474
|
-
const addX = Math.min(width - 1, x + radius + 1);
|
|
475
|
-
const ri = (y * width + removeX) * 3;
|
|
476
|
-
const ai = (y * width + addX) * 3;
|
|
477
|
-
r += tmp.length ? buffer[ai] - buffer[ri] : 0;
|
|
478
|
-
g += tmp.length ? buffer[ai + 1] - buffer[ri + 1] : 0;
|
|
479
|
-
b += tmp.length ? buffer[ai + 2] - buffer[ri + 2] : 0;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
for (let x = 0;x < width; x += 1) {
|
|
483
|
-
let r = 0, g = 0, b = 0;
|
|
484
|
-
for (let y = -radius;y <= radius; y += 1) {
|
|
485
|
-
const sy = Math.max(0, Math.min(height - 1, y));
|
|
486
|
-
const i = (sy * width + x) * 3;
|
|
487
|
-
r += tmp[i];
|
|
488
|
-
g += tmp[i + 1];
|
|
489
|
-
b += tmp[i + 2];
|
|
490
|
-
}
|
|
491
|
-
for (let y = 0;y < height; y += 1) {
|
|
492
|
-
const oi = (y * width + x) * 3;
|
|
493
|
-
out[oi] = r / window;
|
|
494
|
-
out[oi + 1] = g / window;
|
|
495
|
-
out[oi + 2] = b / window;
|
|
496
|
-
const removeY = Math.max(0, y - radius);
|
|
497
|
-
const addY = Math.min(height - 1, y + radius + 1);
|
|
498
|
-
const ri = (removeY * width + x) * 3;
|
|
499
|
-
const ai = (addY * width + x) * 3;
|
|
500
|
-
r += tmp[ai] - tmp[ri];
|
|
501
|
-
g += tmp[ai + 1] - tmp[ri + 1];
|
|
502
|
-
b += tmp[ai + 2] - tmp[ri + 2];
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
return out;
|
|
506
|
-
}
|
|
507
|
-
function panelMaskKey(width, height, rect, headerPx, blurScale) {
|
|
508
|
-
return `${width}x${height}:${rect.left},${rect.top},${rect.width},${rect.height}:${Math.round(headerPx * 100) / 100}:${blurScale}`;
|
|
509
|
-
}
|
|
510
|
-
function getPanelMask(width, height, rect, headerPx, blurScale) {
|
|
511
|
-
const key = panelMaskKey(width, height, rect, headerPx, blurScale);
|
|
512
|
-
const cached = panelMaskCache.get(key);
|
|
513
|
-
if (cached)
|
|
514
|
-
return cached;
|
|
515
|
-
const radius = Math.max(PANEL_MASK_RADIUS_MIN, Math.min(PANEL_MASK_RADIUS_MAX, Math.round(Math.min(rect.width, rect.height) * PANEL_MASK_RADIUS_FACTOR)));
|
|
516
|
-
const sampledWidth = Math.max(1, Math.ceil(rect.width / blurScale));
|
|
517
|
-
const sampledHeight = Math.max(1, Math.ceil(rect.height / blurScale));
|
|
518
|
-
const x0 = Math.max(0, rect.left);
|
|
519
|
-
const y0 = Math.max(0, rect.top);
|
|
520
|
-
const x1 = Math.min(width - 1, rect.left + rect.width - 1);
|
|
521
|
-
const y1 = Math.min(height - 1, rect.top + rect.height - 1);
|
|
522
|
-
const indices = [];
|
|
523
|
-
const sampleIndices = [];
|
|
524
|
-
const panelAlpha = [];
|
|
525
|
-
const edgeAlpha = [];
|
|
526
|
-
const headerFlags = [];
|
|
527
|
-
const dividerIndices = [];
|
|
528
|
-
for (let y = y0;y <= y1; y += 1) {
|
|
529
|
-
for (let x = x0;x <= x1; x += 1) {
|
|
530
|
-
const a = roundRectAlpha(x + 0.5, y + 0.5, rect.left, rect.top, rect.width, rect.height, radius);
|
|
531
|
-
if (a <= 0)
|
|
532
|
-
continue;
|
|
533
|
-
const edge = roundRectAlpha(x + 0.5, y + 0.5, rect.left + 1.2, rect.top + 1.2, rect.width - 2.4, rect.height - 2.4, Math.max(1, radius - 1.2));
|
|
534
|
-
const sx = Math.max(0, Math.min(sampledWidth - 1, Math.floor((x - rect.left) / blurScale)));
|
|
535
|
-
const sy = Math.max(0, Math.min(sampledHeight - 1, Math.floor((y - rect.top) / blurScale)));
|
|
536
|
-
indices.push((y * width + x) * 4);
|
|
537
|
-
sampleIndices.push((sy * sampledWidth + sx) * 3);
|
|
538
|
-
panelAlpha.push(a);
|
|
539
|
-
edgeAlpha.push(edge < 0.96 ? Math.min(1, (1 - edge) * 0.7) : 0);
|
|
540
|
-
headerFlags.push(y < rect.top + headerPx ? 1 : 0);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
const dividerY = Math.round(rect.top + headerPx);
|
|
544
|
-
if (dividerY > y0 && dividerY < y1) {
|
|
545
|
-
for (let x = x0 + radius;x <= x1 - radius; x += 1) {
|
|
546
|
-
dividerIndices.push((dividerY * width + x) * 4);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
const mask = {
|
|
550
|
-
key,
|
|
551
|
-
indices: Uint32Array.from(indices),
|
|
552
|
-
sampleIndices: Uint32Array.from(sampleIndices),
|
|
553
|
-
panelAlpha: Float32Array.from(panelAlpha),
|
|
554
|
-
edgeAlpha: Float32Array.from(edgeAlpha),
|
|
555
|
-
headerFlags: Uint8Array.from(headerFlags),
|
|
556
|
-
dividerIndices: Uint32Array.from(dividerIndices)
|
|
557
|
-
};
|
|
558
|
-
panelMaskCache.set(key, mask);
|
|
559
|
-
while (panelMaskCache.size > PANEL_MASK_CACHE_LIMIT) {
|
|
560
|
-
const oldest = panelMaskCache.keys().next().value;
|
|
561
|
-
if (!oldest)
|
|
562
|
-
break;
|
|
563
|
-
panelMaskCache.delete(oldest);
|
|
564
|
-
}
|
|
565
|
-
return mask;
|
|
566
|
-
}
|
|
567
|
-
function compositePanel(data, width, height, rect, headerPx) {
|
|
568
|
-
const blurScale = PANEL_BLUR_SCALE;
|
|
569
|
-
const sampled = downsampleRegion(data, width, height, rect, blurScale);
|
|
570
|
-
const blurRadius = Math.max(PANEL_BLUR_RADIUS_MIN, Math.min(PANEL_BLUR_RADIUS_MAX, Math.round(Math.min(rect.width, rect.height) * PANEL_BLUR_RADIUS_FACTOR)));
|
|
571
|
-
const blurred = blurRgb(sampled.pixels, sampled.width, sampled.height, blurRadius);
|
|
572
|
-
const mask = getPanelMask(width, height, rect, headerPx, blurScale);
|
|
573
|
-
for (let i = 0;i < mask.indices.length; i += 1) {
|
|
574
|
-
const idx = mask.indices[i];
|
|
575
|
-
const sampleIdx = mask.sampleIndices[i];
|
|
576
|
-
data[idx] = blurred[sampleIdx];
|
|
577
|
-
data[idx + 1] = blurred[sampleIdx + 1];
|
|
578
|
-
data[idx + 2] = blurred[sampleIdx + 2];
|
|
579
|
-
data[idx + 3] = 255;
|
|
580
|
-
blendOver(data, idx, mask.headerFlags[i] ? PANEL_HEADER : PANEL, mask.panelAlpha[i]);
|
|
581
|
-
const edge = mask.edgeAlpha[i];
|
|
582
|
-
if (edge > 0)
|
|
583
|
-
blendOver(data, idx, PANEL_LINE, edge);
|
|
584
|
-
}
|
|
585
|
-
for (let i = 0;i < mask.dividerIndices.length; i += 1) {
|
|
586
|
-
blendOver(data, mask.dividerIndices[i], PANEL_LINE, 0.28);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
var RIG_GLYPH_STROKES = {
|
|
590
|
-
R: [[0, 0, 0, 1], [0, 0, 0.82, 0], [0.82, 0, 0.82, 0.5], [0, 0.5, 0.82, 0.5], [0.36, 0.5, 0.92, 1]],
|
|
591
|
-
I: [[0.5, 0, 0.5, 1], [0.18, 0, 0.82, 0], [0.18, 1, 0.82, 1]],
|
|
592
|
-
G: [[0.92, 0.08, 0.12, 0], [0.12, 0, 0.12, 1], [0.12, 1, 0.92, 1], [0.92, 0.5, 0.92, 1], [0.5, 0.5, 0.92, 0.5]]
|
|
593
|
-
};
|
|
594
|
-
function drawBigRigWordmark(data, width, height, layout, load) {
|
|
595
|
-
const sideBySide = layout.width >= FLEET_GRID_WIDTH * 1.9;
|
|
596
|
-
if (!sideBySide)
|
|
597
|
-
return;
|
|
598
|
-
const letters = "RIG";
|
|
599
|
-
const min = Math.min(width, height);
|
|
600
|
-
const glyphH = height * 0.42;
|
|
601
|
-
const glyphW = width * 0.13;
|
|
602
|
-
const gap = glyphW * 0.3;
|
|
603
|
-
const totalW = letters.length * glyphW + (letters.length - 1) * gap;
|
|
604
|
-
const centerX = width * 0.71;
|
|
605
|
-
const startX = centerX - totalW / 2;
|
|
606
|
-
const top = (height - glyphH) / 2;
|
|
607
|
-
const stroke = Math.max(2, min * 0.013);
|
|
608
|
-
drawGlow(data, width, height, centerX, top + glyphH / 2, Math.max(glyphW, glyphH) * 0.9, LIME, 0.022 + load * 0.02);
|
|
609
|
-
const strokeAlpha = 0.1 + load * 0.06;
|
|
610
|
-
letters.split("").forEach((letter, index) => {
|
|
611
|
-
const segments = RIG_GLYPH_STROKES[letter];
|
|
612
|
-
if (!segments)
|
|
613
|
-
return;
|
|
614
|
-
const ox = startX + index * (glyphW + gap);
|
|
615
|
-
for (const [x0, y0, x1, y1] of segments) {
|
|
616
|
-
drawLine(data, width, height, ox + x0 * glyphW, top + y0 * glyphH, ox + x1 * glyphW, top + y1 * glyphH, LIME_DIM, strokeAlpha, stroke);
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
function drawBackground(data, width, height, _tick, scene, layout, load, activeRuns) {
|
|
621
|
-
fillRgba(data, BG, BG_WORD);
|
|
622
|
-
drawStaticAsciiFleetBackground(data, width, height, scene, layout, load, activeRuns);
|
|
623
|
-
drawBigRigWordmark(data, width, height, layout, load);
|
|
624
|
-
applyStaticAtmosphere(data, width, height, load);
|
|
625
|
-
}
|
|
626
|
-
function imageVisualFrameKey(input) {
|
|
627
|
-
const width = Math.max(1, Math.floor(input.pixelSize.width));
|
|
628
|
-
const height = Math.max(1, Math.floor(input.pixelSize.height));
|
|
629
|
-
const layer = "layer" in input ? input.layer ?? "full" : "full";
|
|
630
|
-
const load = loadBucket(input.load);
|
|
631
|
-
return `${layer}:${width}x${height}:${input.layout.width}x${input.layout.height}:${input.scene}:${input.tick}:l${load}:${input.panels.map((panel) => `${panel.id}:${panel.top}:${panel.height}:${panel.width ?? ""}:${panel.left ?? ""}:${panel.headerHeight ?? ""}`).join("|")}`;
|
|
632
|
-
}
|
|
633
|
-
function encodeKittyFrame(width, height, data, input) {
|
|
634
|
-
if (input.transport === "png") {
|
|
635
|
-
const png = encodePng(width, height, data);
|
|
636
|
-
return kittyImageSequence(png.toString("base64"), { columns: input.layout.width, rows: input.layout.height, imageId: input.imageId, zIndex: input.zIndex, format: 100 });
|
|
637
|
-
}
|
|
638
|
-
const compressed = deflateSync(data, { level: ZLIB_LEVEL });
|
|
639
|
-
return kittyImageSequence(compressed.toString("base64"), {
|
|
640
|
-
columns: input.layout.width,
|
|
641
|
-
rows: input.layout.height,
|
|
642
|
-
imageId: input.imageId,
|
|
643
|
-
zIndex: input.zIndex,
|
|
644
|
-
format: 32,
|
|
645
|
-
pixelWidth: width,
|
|
646
|
-
pixelHeight: height,
|
|
647
|
-
compressed: true
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
function cropRgba(data, sourceWidth, rect) {
|
|
651
|
-
const out = new Uint8ClampedArray(rect.width * rect.height * 4);
|
|
652
|
-
for (let y = 0;y < rect.height; y += 1) {
|
|
653
|
-
const sourceStart = ((rect.top + y) * sourceWidth + rect.left) * 4;
|
|
654
|
-
out.set(data.subarray(sourceStart, sourceStart + rect.width * 4), y * rect.width * 4);
|
|
655
|
-
}
|
|
656
|
-
return out;
|
|
657
|
-
}
|
|
658
|
-
function encodePanelPatch(data, sourceWidth, placement, imageId, zIndex) {
|
|
659
|
-
const patch = cropRgba(data, sourceWidth, placement);
|
|
660
|
-
const png = encodePng(placement.width, placement.height, patch);
|
|
661
|
-
const sequence = kittyImageSequence(png.toString("base64"), {
|
|
662
|
-
columns: Math.max(1, Math.round(placement.widthCells)),
|
|
663
|
-
rows: Math.max(1, Math.round(placement.heightCells)),
|
|
664
|
-
imageId,
|
|
665
|
-
zIndex,
|
|
666
|
-
format: 100
|
|
667
|
-
});
|
|
668
|
-
return `\x1B[${Math.max(1, Math.round(placement.topCells) + 1)};${Math.max(1, Math.round(placement.leftCells) + 1)}H${sequence}`;
|
|
669
|
-
}
|
|
670
|
-
function renderImageVisualFrame(input) {
|
|
671
|
-
const width = Math.max(1, Math.floor(input.pixelSize.width));
|
|
672
|
-
const height = Math.max(1, Math.floor(input.pixelSize.height));
|
|
673
|
-
const byteCount = width * height * 4;
|
|
674
|
-
if (byteCount > MAX_IMAGE_BYTES)
|
|
675
|
-
return null;
|
|
676
|
-
const layer = input.layer ?? "full";
|
|
677
|
-
const data = new Uint8ClampedArray(byteCount);
|
|
678
|
-
const load = loadBucket(input.load) / LOAD_BUCKETS;
|
|
679
|
-
const activeRuns = Math.max(0, Math.floor(input.activeRuns ?? 0));
|
|
680
|
-
drawBackground(data, width, height, 0, input.scene, input.layout, load, activeRuns);
|
|
681
|
-
if (layer === "split") {
|
|
682
|
-
const sequences = [encodeKittyFrame(width, height, data, input)];
|
|
683
|
-
let panelIndex = 0;
|
|
684
|
-
for (const panel of input.panels) {
|
|
685
|
-
if (panel.chrome !== "ad-terminal")
|
|
686
|
-
continue;
|
|
687
|
-
const placement = panelPixelPlacement(input.layout, panel, { width, height });
|
|
688
|
-
if (!placement)
|
|
689
|
-
continue;
|
|
690
|
-
const cellH = height / input.layout.height;
|
|
691
|
-
const headerPx = Math.max(cellH * 3, (panel.headerHeight ?? 3) * cellH);
|
|
692
|
-
compositePanel(data, width, height, placement, headerPx);
|
|
693
|
-
const imageId = input.imageIds?.[panelIndex] ?? (input.imageId + 1000 + panelIndex >>> 0 || panelIndex + 1);
|
|
694
|
-
sequences.push(encodePanelPatch(data, width, placement, imageId, -12));
|
|
695
|
-
panelIndex += 1;
|
|
696
|
-
}
|
|
697
|
-
return { key: imageVisualFrameKey(input), sequence: sequences.join("") };
|
|
698
|
-
}
|
|
699
|
-
if (layer === "panel-chrome")
|
|
700
|
-
return { key: imageVisualFrameKey(input), sequence: "" };
|
|
701
|
-
if (layer === "background") {
|
|
702
|
-
return { key: imageVisualFrameKey(input), sequence: encodeKittyFrame(width, height, data, input) };
|
|
703
|
-
}
|
|
704
|
-
if (layer === "panel-patches") {
|
|
705
|
-
const sequences = [];
|
|
706
|
-
let panelIndex = 0;
|
|
707
|
-
for (const panel of input.panels) {
|
|
708
|
-
if (panel.chrome !== "ad-terminal")
|
|
709
|
-
continue;
|
|
710
|
-
const placement = panelPixelPlacement(input.layout, panel, { width, height });
|
|
711
|
-
if (!placement)
|
|
712
|
-
continue;
|
|
713
|
-
const cellH = height / input.layout.height;
|
|
714
|
-
const headerPx = Math.max(cellH * 3, (panel.headerHeight ?? 3) * cellH);
|
|
715
|
-
compositePanel(data, width, height, placement, headerPx);
|
|
716
|
-
const imageId = input.imageIds?.[panelIndex] ?? (input.imageId + 1000 + panelIndex >>> 0 || panelIndex + 1);
|
|
717
|
-
sequences.push(encodePanelPatch(data, width, placement, imageId, input.zIndex));
|
|
718
|
-
panelIndex += 1;
|
|
719
|
-
}
|
|
720
|
-
return { key: imageVisualFrameKey(input), sequence: sequences.join("") };
|
|
721
|
-
}
|
|
722
|
-
for (const panel of input.panels) {
|
|
723
|
-
if (panel.chrome !== "ad-terminal")
|
|
724
|
-
continue;
|
|
725
|
-
const rect = panelRect(input.layout, panel, { width, height });
|
|
726
|
-
if (!rect)
|
|
727
|
-
continue;
|
|
728
|
-
const cellH = height / input.layout.height;
|
|
729
|
-
const headerPx = Math.max(cellH * 3, (panel.headerHeight ?? 3) * cellH);
|
|
730
|
-
compositePanel(data, width, height, rect, headerPx);
|
|
731
|
-
}
|
|
732
|
-
return { key: imageVisualFrameKey(input), sequence: encodeKittyFrame(width, height, data, input) };
|
|
733
|
-
}
|
|
734
|
-
function shouldRenderImagesInline() {
|
|
735
|
-
return process.env.RIG_OPENTUI_IMAGE_WORKER === "0" || import.meta.url.includes("$bunfs");
|
|
736
|
-
}
|
|
737
|
-
function createImageWorker() {
|
|
738
|
-
if (shouldRenderImagesInline())
|
|
739
|
-
return null;
|
|
740
|
-
const isTypeScriptRuntime = import.meta.url.endsWith(".ts");
|
|
741
|
-
const workerUrl = new URL(isTypeScriptRuntime ? "./image-visual-layer-worker.ts" : "./image-visual-layer-worker.js", import.meta.url);
|
|
742
|
-
try {
|
|
743
|
-
return new Worker(workerUrl);
|
|
744
|
-
} catch {
|
|
745
|
-
if (typeof process.versions.bun === "string") {
|
|
746
|
-
try {
|
|
747
|
-
return new Worker("./src/app-opentui/render/image-visual-layer-worker.ts");
|
|
748
|
-
} catch {}
|
|
749
|
-
}
|
|
750
|
-
return null;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
var RECENT_WRITTEN_LIMIT = 24;
|
|
754
|
-
var DEFAULT_IMAGE_OUTPUT_BACKLOG_BYTES = 256 * 1024;
|
|
755
|
-
var DEFAULT_IMAGE_OUTPUT_BYTES_PER_SECOND = 850 * 1024;
|
|
756
|
-
function imageOutputBacklogBytes() {
|
|
757
|
-
const raw = Number.parseInt(process.env.RIG_OPENTUI_IMAGE_BACKLOG_BYTES ?? "", 10);
|
|
758
|
-
if (Number.isFinite(raw) && raw > 0)
|
|
759
|
-
return Math.max(64 * 1024, Math.min(2 * 1024 * 1024, raw));
|
|
760
|
-
return DEFAULT_IMAGE_OUTPUT_BACKLOG_BYTES;
|
|
761
|
-
}
|
|
762
|
-
function imageOutputBytesPerSecond() {
|
|
763
|
-
const raw = Number.parseInt(process.env.RIG_OPENTUI_IMAGE_BYTES_PER_SECOND ?? "", 10);
|
|
764
|
-
if (Number.isFinite(raw) && raw > 0)
|
|
765
|
-
return Math.max(128 * 1024, Math.min(2 * 1024 * 1024, raw));
|
|
766
|
-
return DEFAULT_IMAGE_OUTPUT_BYTES_PER_SECOND;
|
|
767
|
-
}
|
|
768
|
-
function pendingLayerKey(key) {
|
|
769
|
-
return key.split(":", 1)[0] || "full";
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
class ImageVisualLayer {
|
|
773
|
-
imageId = allocateImageId();
|
|
774
|
-
panelImageIds = Array.from({ length: 8 }, () => allocateImageId());
|
|
775
|
-
panelChromeImageIds = Array.from({ length: 8 }, () => allocateImageId());
|
|
776
|
-
stdout;
|
|
777
|
-
onFrameReady;
|
|
778
|
-
protocol;
|
|
779
|
-
transport = imageTransport();
|
|
780
|
-
maxOutputBacklogBytes = imageOutputBacklogBytes();
|
|
781
|
-
outputBytesPerSecond = imageOutputBytesPerSecond();
|
|
782
|
-
outputBudgetBytes = imageOutputBytesPerSecond();
|
|
783
|
-
lastBudgetAtMs = Date.now();
|
|
784
|
-
motionSlot = this.createSlot();
|
|
785
|
-
workersStarted = false;
|
|
786
|
-
pendingFrames = new Map;
|
|
787
|
-
recentWrittenKeys = [];
|
|
788
|
-
imagesVisible = false;
|
|
789
|
-
flushPaused = false;
|
|
790
|
-
requestId = 0;
|
|
791
|
-
lastBackgroundKey = "";
|
|
792
|
-
fatalWorkerError = null;
|
|
793
|
-
destroyed = false;
|
|
794
|
-
constructor(stdout = process.stdout, onFrameReady) {
|
|
795
|
-
this.stdout = stdout;
|
|
796
|
-
this.onFrameReady = onFrameReady;
|
|
797
|
-
this.protocol = getRigTerminalCapabilities().imageProtocol;
|
|
798
|
-
}
|
|
799
|
-
get enabled() {
|
|
800
|
-
return this.protocol === "kitty";
|
|
801
|
-
}
|
|
802
|
-
clear() {
|
|
803
|
-
if (this.enabled) {
|
|
804
|
-
if (this.imagesVisible)
|
|
805
|
-
this.stdout.write([this.imageId, ...this.panelImageIds, ...this.panelChromeImageIds].map((id) => deleteKittyImage(id)).join("") + "\x1B[?25h");
|
|
806
|
-
this.imagesVisible = false;
|
|
807
|
-
this.pendingFrames.clear();
|
|
808
|
-
this.recentWrittenKeys.length = 0;
|
|
809
|
-
this.resetSlot(this.motionSlot);
|
|
810
|
-
this.lastBackgroundKey = "";
|
|
811
|
-
this.outputBudgetBytes = this.outputBytesPerSecond;
|
|
812
|
-
this.lastBudgetAtMs = Date.now();
|
|
813
|
-
this.motionSlot.clearedThroughRequestId = this.requestId;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
destroy() {
|
|
817
|
-
if (this.destroyed)
|
|
818
|
-
return;
|
|
819
|
-
this.clear();
|
|
820
|
-
this.destroyed = true;
|
|
821
|
-
const workers = [this.motionSlot.worker];
|
|
822
|
-
this.motionSlot.worker = null;
|
|
823
|
-
for (const worker of workers)
|
|
824
|
-
if (worker)
|
|
825
|
-
worker.terminate().catch(() => {
|
|
826
|
-
return;
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
setFlushPaused(paused) {
|
|
830
|
-
this.flushPaused = paused;
|
|
831
|
-
}
|
|
832
|
-
isReady(input) {
|
|
833
|
-
if (!this.enabled || this.destroyed)
|
|
834
|
-
return true;
|
|
835
|
-
this.throwIfFatal();
|
|
836
|
-
const splitKey = imageVisualFrameKey({ ...input, tick: 0, layer: "split" });
|
|
837
|
-
return this.recentWrittenKeys.includes(splitKey) || Array.from(this.pendingFrames.values()).some((frame) => frame.key === splitKey);
|
|
838
|
-
}
|
|
839
|
-
render(input) {
|
|
840
|
-
if (!this.enabled || this.destroyed)
|
|
841
|
-
return;
|
|
842
|
-
this.throwIfFatal();
|
|
843
|
-
if (this.transport !== "png")
|
|
844
|
-
this.failWorker("renderer", new Error("OpenTUI image visuals require PNG transport for static-background rendering."));
|
|
845
|
-
this.ensureWorkersStarted();
|
|
846
|
-
const width = Math.max(1, Math.floor(input.pixelSize.width));
|
|
847
|
-
const height = Math.max(1, Math.floor(input.pixelSize.height));
|
|
848
|
-
if (width * height * 4 > MAX_IMAGE_BYTES)
|
|
849
|
-
return;
|
|
850
|
-
if (this.isOutputBackedUp())
|
|
851
|
-
return;
|
|
852
|
-
this.refillOutputBudget();
|
|
853
|
-
const splitInput = { ...input, tick: 0, layer: "split" };
|
|
854
|
-
const splitKey = imageVisualFrameKey(splitInput);
|
|
855
|
-
if (input.force || splitKey !== this.lastBackgroundKey) {
|
|
856
|
-
this.scheduleRender(this.motionSlot, splitInput, this.imageId, -30, input.force, this.panelImageIds);
|
|
857
|
-
this.lastBackgroundKey = splitKey;
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
flush() {
|
|
861
|
-
this.throwIfFatal();
|
|
862
|
-
if (this.flushPaused)
|
|
863
|
-
return false;
|
|
864
|
-
if (this.pendingFrames.size === 0)
|
|
865
|
-
return false;
|
|
866
|
-
this.refillOutputBudget();
|
|
867
|
-
if (this.isOutputBackedUp()) {
|
|
868
|
-
const retainedSplit = this.pendingFrames.get("split");
|
|
869
|
-
this.pendingFrames.clear();
|
|
870
|
-
if (retainedSplit)
|
|
871
|
-
this.pendingFrames.set("split", retainedSplit);
|
|
872
|
-
return false;
|
|
873
|
-
}
|
|
874
|
-
const framePriority = (frame) => {
|
|
875
|
-
const layer = pendingLayerKey(frame.key);
|
|
876
|
-
if (layer === "split")
|
|
877
|
-
return 1;
|
|
878
|
-
return 4;
|
|
879
|
-
};
|
|
880
|
-
const frames = Array.from(this.pendingFrames.values()).sort((a, b) => framePriority(a) - framePriority(b));
|
|
881
|
-
const prefix = "\x1B[?25l\x1B7\x1B[s\x1B[H";
|
|
882
|
-
const suffix = "\x1B[u\x1B8";
|
|
883
|
-
const selected = [];
|
|
884
|
-
const retained = new Map;
|
|
885
|
-
let sequence = "";
|
|
886
|
-
let byteLength = Buffer.byteLength(prefix + suffix);
|
|
887
|
-
for (const frame of frames) {
|
|
888
|
-
const candidate = sequence + frame.sequence;
|
|
889
|
-
const candidateBytes = Buffer.byteLength(prefix + candidate + suffix);
|
|
890
|
-
const layer = pendingLayerKey(frame.key);
|
|
891
|
-
const allowOneStaticFrame = selected.length === 0 && layer === "split";
|
|
892
|
-
if (candidateBytes <= this.outputBudgetBytes || allowOneStaticFrame) {
|
|
893
|
-
selected.push(frame);
|
|
894
|
-
sequence = candidate;
|
|
895
|
-
byteLength = candidateBytes;
|
|
896
|
-
} else if (layer === "split") {
|
|
897
|
-
retained.set(layer, frame);
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
this.pendingFrames.clear();
|
|
901
|
-
for (const [layer, frame] of retained)
|
|
902
|
-
this.pendingFrames.set(layer, frame);
|
|
903
|
-
if (!sequence || selected.length === 0)
|
|
904
|
-
return false;
|
|
905
|
-
const payload = `${prefix}${sequence}${suffix}`;
|
|
906
|
-
for (const frame of selected)
|
|
907
|
-
this.markWritten(frame.key);
|
|
908
|
-
this.outputBudgetBytes -= byteLength;
|
|
909
|
-
this.stdout.cork?.();
|
|
910
|
-
const accepted = this.stdout.write(payload);
|
|
911
|
-
this.stdout.uncork?.();
|
|
912
|
-
this.imagesVisible = true;
|
|
913
|
-
return accepted;
|
|
914
|
-
}
|
|
915
|
-
createSlot() {
|
|
916
|
-
return { worker: null, busy: false, queuedRequest: null, inFlightKey: "", queuedKey: "", clearedThroughRequestId: 0, latestRequestId: 0 };
|
|
917
|
-
}
|
|
918
|
-
resetSlot(slot) {
|
|
919
|
-
slot.busy = false;
|
|
920
|
-
slot.queuedRequest = null;
|
|
921
|
-
slot.inFlightKey = "";
|
|
922
|
-
slot.queuedKey = "";
|
|
923
|
-
}
|
|
924
|
-
markWritten(key) {
|
|
925
|
-
this.recentWrittenKeys.push(key);
|
|
926
|
-
while (this.recentWrittenKeys.length > RECENT_WRITTEN_LIMIT)
|
|
927
|
-
this.recentWrittenKeys.shift();
|
|
928
|
-
}
|
|
929
|
-
refillOutputBudget() {
|
|
930
|
-
const now = Date.now();
|
|
931
|
-
const elapsedMs = Math.max(0, now - this.lastBudgetAtMs);
|
|
932
|
-
this.lastBudgetAtMs = now;
|
|
933
|
-
this.outputBudgetBytes = Math.min(this.outputBytesPerSecond, this.outputBudgetBytes + elapsedMs / 1000 * this.outputBytesPerSecond);
|
|
934
|
-
}
|
|
935
|
-
isOutputBackedUp() {
|
|
936
|
-
return Boolean(this.stdout.writableNeedDrain) || this.stdout.writableLength > this.maxOutputBacklogBytes;
|
|
937
|
-
}
|
|
938
|
-
stageFrame(frame) {
|
|
939
|
-
this.pendingFrames.set(pendingLayerKey(frame.key), frame);
|
|
940
|
-
}
|
|
941
|
-
isKnownKey(slot, key) {
|
|
942
|
-
return this.recentWrittenKeys.includes(key) || Array.from(this.pendingFrames.values()).some((frame) => frame.key === key) || key === slot.inFlightKey || key === slot.queuedKey;
|
|
943
|
-
}
|
|
944
|
-
ensureWorkersStarted() {
|
|
945
|
-
if (this.workersStarted)
|
|
946
|
-
return;
|
|
947
|
-
this.workersStarted = true;
|
|
948
|
-
this.startWorker(this.motionSlot, "static-visuals");
|
|
949
|
-
}
|
|
950
|
-
failWorker(name, error) {
|
|
951
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
952
|
-
this.fatalWorkerError ??= new Error(`OpenTUI image worker ${name} failed: ${detail}`);
|
|
953
|
-
throw this.fatalWorkerError;
|
|
954
|
-
}
|
|
955
|
-
throwIfFatal() {
|
|
956
|
-
if (this.fatalWorkerError)
|
|
957
|
-
throw this.fatalWorkerError;
|
|
958
|
-
}
|
|
959
|
-
scheduleRender(slot, input, imageId, zIndex, force, imageIds) {
|
|
960
|
-
this.throwIfFatal();
|
|
961
|
-
const key = imageVisualFrameKey(input);
|
|
962
|
-
if (!force && this.isKnownKey(slot, key))
|
|
963
|
-
return;
|
|
964
|
-
const request = {
|
|
965
|
-
...input,
|
|
966
|
-
imageId,
|
|
967
|
-
...imageIds ? { imageIds } : {},
|
|
968
|
-
zIndex,
|
|
969
|
-
transport: this.transport,
|
|
970
|
-
requestId: ++this.requestId,
|
|
971
|
-
key
|
|
972
|
-
};
|
|
973
|
-
slot.latestRequestId = request.requestId;
|
|
974
|
-
if (!slot.worker) {
|
|
975
|
-
this.renderInline(slot, request);
|
|
976
|
-
return;
|
|
977
|
-
}
|
|
978
|
-
this.enqueueWorkerRender(slot, request);
|
|
979
|
-
}
|
|
980
|
-
startWorker(slot, name) {
|
|
981
|
-
const worker = createImageWorker();
|
|
982
|
-
if (!worker)
|
|
983
|
-
return;
|
|
984
|
-
slot.worker = worker;
|
|
985
|
-
worker.on("message", (message) => this.handleWorkerMessage(slot, message));
|
|
986
|
-
worker.once("error", (error) => {
|
|
987
|
-
if (!this.destroyed)
|
|
988
|
-
this.fatalWorkerError ??= new Error(`OpenTUI image worker ${name} failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
989
|
-
});
|
|
990
|
-
worker.once("exit", (code) => {
|
|
991
|
-
if (!this.destroyed)
|
|
992
|
-
this.fatalWorkerError ??= new Error(`OpenTUI image worker ${name} exited unexpectedly with code ${code}.`);
|
|
993
|
-
});
|
|
994
|
-
}
|
|
995
|
-
renderInline(slot, request) {
|
|
996
|
-
try {
|
|
997
|
-
const result = renderImageVisualFrame(request);
|
|
998
|
-
if (result?.sequence && !this.isKnownKey(slot, result.key) && (!this.isOutputBackedUp() || pendingLayerKey(result.key) === "split")) {
|
|
999
|
-
this.stageFrame({ key: result.key, sequence: result.sequence });
|
|
1000
|
-
this.onFrameReady?.();
|
|
1001
|
-
}
|
|
1002
|
-
} catch (error) {
|
|
1003
|
-
this.failWorker(String(request.layer ?? "visual"), error);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
enqueueWorkerRender(slot, request) {
|
|
1007
|
-
this.throwIfFatal();
|
|
1008
|
-
if (slot.busy) {
|
|
1009
|
-
slot.queuedRequest = request;
|
|
1010
|
-
slot.queuedKey = request.key;
|
|
1011
|
-
return;
|
|
1012
|
-
}
|
|
1013
|
-
this.dispatchWorkerRender(slot, request);
|
|
1014
|
-
}
|
|
1015
|
-
dispatchWorkerRender(slot, request) {
|
|
1016
|
-
this.throwIfFatal();
|
|
1017
|
-
if (!slot.worker)
|
|
1018
|
-
this.failWorker(String(request.layer ?? "visual"), new Error("worker is unavailable"));
|
|
1019
|
-
slot.busy = true;
|
|
1020
|
-
slot.inFlightKey = request.key;
|
|
1021
|
-
try {
|
|
1022
|
-
slot.worker.postMessage(request);
|
|
1023
|
-
} catch (error) {
|
|
1024
|
-
this.failWorker(String(request.layer ?? "visual"), error);
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
handleWorkerMessage(slot, message) {
|
|
1028
|
-
if (this.destroyed || !message || typeof message !== "object")
|
|
1029
|
-
return;
|
|
1030
|
-
const response = message;
|
|
1031
|
-
slot.busy = false;
|
|
1032
|
-
slot.inFlightKey = "";
|
|
1033
|
-
const isStale = response.requestId <= slot.clearedThroughRequestId || response.requestId < slot.latestRequestId;
|
|
1034
|
-
if (!isStale) {
|
|
1035
|
-
if (response.error)
|
|
1036
|
-
this.failWorker(pendingLayerKey(response.key), new Error(response.error));
|
|
1037
|
-
if (response.sequence && !this.isKnownKey(slot, response.key) && (!this.isOutputBackedUp() || pendingLayerKey(response.key) === "split")) {
|
|
1038
|
-
this.stageFrame({ key: response.key, sequence: response.sequence });
|
|
1039
|
-
this.onFrameReady?.();
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
const next = slot.queuedRequest;
|
|
1043
|
-
slot.queuedRequest = null;
|
|
1044
|
-
slot.queuedKey = "";
|
|
1045
|
-
if (next && !this.isKnownKey(slot, next.key))
|
|
1046
|
-
this.dispatchWorkerRender(slot, next);
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
function pixelSizeForRenderer(renderer) {
|
|
1050
|
-
const resolution = renderer.resolution;
|
|
1051
|
-
const base = resolution?.width && resolution?.height ? resolution : { width: renderer.width * 12, height: renderer.height * 24 };
|
|
1052
|
-
const scale = imageResolutionScale();
|
|
1053
|
-
return {
|
|
1054
|
-
width: Math.max(renderer.width, Math.floor(base.width * scale)),
|
|
1055
|
-
height: Math.max(renderer.height, Math.floor(base.height * scale))
|
|
1056
|
-
};
|
|
1057
|
-
}
|
|
1058
|
-
function forceModernImageVisuals() {
|
|
1059
|
-
return getRigTerminalCapabilities().supportsKittyImages;
|
|
1060
|
-
}
|
|
1061
|
-
export {
|
|
1062
|
-
renderImageVisualFrame,
|
|
1063
|
-
pixelSizeForRenderer,
|
|
1064
|
-
loadBucket,
|
|
1065
|
-
imageVisualFrameKey,
|
|
1066
|
-
forceModernImageVisuals,
|
|
1067
|
-
ImageVisualLayer
|
|
1068
|
-
};
|