@blazediff/cli 3.1.2 → 3.2.1
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/README.md +2 -2
- package/dist/cli.js +717 -624
- package/dist/commands/core-wasm.js +9376 -0
- package/dist/commands/core.js +370 -363
- package/dist/commands/gmsd.js +199 -199
- package/dist/commands/hitchhikers-ssim.js +192 -192
- package/dist/commands/msssim.js +205 -205
- package/dist/commands/ssim.js +228 -228
- package/dist/index.d.ts +2 -0
- package/package.json +3 -2
package/dist/commands/gmsd.js
CHANGED
|
@@ -2129,20 +2129,20 @@ __export(dist_exports, {
|
|
|
2129
2129
|
default: () => m
|
|
2130
2130
|
});
|
|
2131
2131
|
async function d(r) {
|
|
2132
|
-
return new Promise((i3,
|
|
2132
|
+
return new Promise((i3, n2) => {
|
|
2133
2133
|
try {
|
|
2134
2134
|
let t = typeof r == "string" ? (0, import_fs.readFileSync)(r) : r, e = import_pngjs.PNG.sync.read(t);
|
|
2135
2135
|
i3({ data: e.data, width: e.width, height: e.height });
|
|
2136
2136
|
} catch (t) {
|
|
2137
|
-
|
|
2137
|
+
n2(new Error(`Failed to read PNG file ${r}: ${t}`));
|
|
2138
2138
|
}
|
|
2139
2139
|
});
|
|
2140
2140
|
}
|
|
2141
2141
|
async function c(r, i3) {
|
|
2142
|
-
return new Promise((
|
|
2142
|
+
return new Promise((n2, t) => {
|
|
2143
2143
|
try {
|
|
2144
2144
|
let e = new import_pngjs.PNG({ width: r.width, height: r.height });
|
|
2145
|
-
e.data = Buffer.isBuffer(r.data) ? r.data : Buffer.from(r.data.buffer), (0, import_fs.writeFileSync)(i3, import_pngjs.PNG.sync.write(e)),
|
|
2145
|
+
e.data = Buffer.isBuffer(r.data) ? r.data : Buffer.from(r.data.buffer), (0, import_fs.writeFileSync)(i3, import_pngjs.PNG.sync.write(e)), n2();
|
|
2146
2146
|
} catch (e) {
|
|
2147
2147
|
t(new Error(`Failed to write PNG file ${i3}: ${e}`));
|
|
2148
2148
|
}
|
|
@@ -2355,7 +2355,7 @@ var require_detect_libc = __commonJS({
|
|
|
2355
2355
|
var GLIBC = "glibc";
|
|
2356
2356
|
var RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
|
|
2357
2357
|
var MUSL = "musl";
|
|
2358
|
-
var isFileMusl = (
|
|
2358
|
+
var isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
2359
2359
|
var familyFromReport = () => {
|
|
2360
2360
|
const report = getReport();
|
|
2361
2361
|
if (report.header && report.header.glibcVersionRuntime) {
|
|
@@ -6241,11 +6241,11 @@ var require_color = __commonJS({
|
|
|
6241
6241
|
const match = string.match(hsl);
|
|
6242
6242
|
if (match) {
|
|
6243
6243
|
const alpha = Number.parseFloat(match[4]);
|
|
6244
|
-
const
|
|
6244
|
+
const h4 = (Number.parseFloat(match[1]) % 360 + 360) % 360;
|
|
6245
6245
|
const s = clamp(Number.parseFloat(match[2]), 0, 100);
|
|
6246
|
-
const
|
|
6246
|
+
const l = clamp(Number.parseFloat(match[3]), 0, 100);
|
|
6247
6247
|
const a2 = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
6248
|
-
return [
|
|
6248
|
+
return [h4, s, l, a2];
|
|
6249
6249
|
}
|
|
6250
6250
|
return null;
|
|
6251
6251
|
};
|
|
@@ -6257,11 +6257,11 @@ var require_color = __commonJS({
|
|
|
6257
6257
|
const match = string.match(hwb);
|
|
6258
6258
|
if (match) {
|
|
6259
6259
|
const alpha = Number.parseFloat(match[4]);
|
|
6260
|
-
const
|
|
6261
|
-
const
|
|
6260
|
+
const h4 = (Number.parseFloat(match[1]) % 360 + 360) % 360;
|
|
6261
|
+
const w2 = clamp(Number.parseFloat(match[2]), 0, 100);
|
|
6262
6262
|
const b = clamp(Number.parseFloat(match[3]), 0, 100);
|
|
6263
6263
|
const a2 = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
6264
|
-
return [
|
|
6264
|
+
return [h4, w2, b, a2];
|
|
6265
6265
|
}
|
|
6266
6266
|
return null;
|
|
6267
6267
|
};
|
|
@@ -6353,45 +6353,45 @@ var require_color = __commonJS({
|
|
|
6353
6353
|
const min = Math.min(r, g, b);
|
|
6354
6354
|
const max = Math.max(r, g, b);
|
|
6355
6355
|
const delta = max - min;
|
|
6356
|
-
let
|
|
6356
|
+
let h4;
|
|
6357
6357
|
let s;
|
|
6358
6358
|
switch (max) {
|
|
6359
6359
|
case min: {
|
|
6360
|
-
|
|
6360
|
+
h4 = 0;
|
|
6361
6361
|
break;
|
|
6362
6362
|
}
|
|
6363
6363
|
case r: {
|
|
6364
|
-
|
|
6364
|
+
h4 = (g - b) / delta;
|
|
6365
6365
|
break;
|
|
6366
6366
|
}
|
|
6367
6367
|
case g: {
|
|
6368
|
-
|
|
6368
|
+
h4 = 2 + (b - r) / delta;
|
|
6369
6369
|
break;
|
|
6370
6370
|
}
|
|
6371
6371
|
case b: {
|
|
6372
|
-
|
|
6372
|
+
h4 = 4 + (r - g) / delta;
|
|
6373
6373
|
break;
|
|
6374
6374
|
}
|
|
6375
6375
|
}
|
|
6376
|
-
|
|
6377
|
-
if (
|
|
6378
|
-
|
|
6376
|
+
h4 = Math.min(h4 * 60, 360);
|
|
6377
|
+
if (h4 < 0) {
|
|
6378
|
+
h4 += 360;
|
|
6379
6379
|
}
|
|
6380
|
-
const
|
|
6380
|
+
const l = (min + max) / 2;
|
|
6381
6381
|
if (max === min) {
|
|
6382
6382
|
s = 0;
|
|
6383
|
-
} else if (
|
|
6383
|
+
} else if (l <= 0.5) {
|
|
6384
6384
|
s = delta / (max + min);
|
|
6385
6385
|
} else {
|
|
6386
6386
|
s = delta / (2 - max - min);
|
|
6387
6387
|
}
|
|
6388
|
-
return [
|
|
6388
|
+
return [h4, s * 100, l * 100];
|
|
6389
6389
|
};
|
|
6390
6390
|
convert.rgb.hsv = function(rgb) {
|
|
6391
6391
|
let rdif;
|
|
6392
6392
|
let gdif;
|
|
6393
6393
|
let bdif;
|
|
6394
|
-
let
|
|
6394
|
+
let h4;
|
|
6395
6395
|
let s;
|
|
6396
6396
|
const r = rgb[0] / 255;
|
|
6397
6397
|
const g = rgb[1] / 255;
|
|
@@ -6402,7 +6402,7 @@ var require_color = __commonJS({
|
|
|
6402
6402
|
return (v - c3) / 6 / diff + 1 / 2;
|
|
6403
6403
|
};
|
|
6404
6404
|
if (diff === 0) {
|
|
6405
|
-
|
|
6405
|
+
h4 = 0;
|
|
6406
6406
|
s = 0;
|
|
6407
6407
|
} else {
|
|
6408
6408
|
s = diff / v;
|
|
@@ -6411,26 +6411,26 @@ var require_color = __commonJS({
|
|
|
6411
6411
|
bdif = diffc(b);
|
|
6412
6412
|
switch (v) {
|
|
6413
6413
|
case r: {
|
|
6414
|
-
|
|
6414
|
+
h4 = bdif - gdif;
|
|
6415
6415
|
break;
|
|
6416
6416
|
}
|
|
6417
6417
|
case g: {
|
|
6418
|
-
|
|
6418
|
+
h4 = 1 / 3 + rdif - bdif;
|
|
6419
6419
|
break;
|
|
6420
6420
|
}
|
|
6421
6421
|
case b: {
|
|
6422
|
-
|
|
6422
|
+
h4 = 2 / 3 + gdif - rdif;
|
|
6423
6423
|
break;
|
|
6424
6424
|
}
|
|
6425
6425
|
}
|
|
6426
|
-
if (
|
|
6427
|
-
|
|
6428
|
-
} else if (
|
|
6429
|
-
|
|
6426
|
+
if (h4 < 0) {
|
|
6427
|
+
h4 += 1;
|
|
6428
|
+
} else if (h4 > 1) {
|
|
6429
|
+
h4 -= 1;
|
|
6430
6430
|
}
|
|
6431
6431
|
}
|
|
6432
6432
|
return [
|
|
6433
|
-
|
|
6433
|
+
h4 * 360,
|
|
6434
6434
|
s * 100,
|
|
6435
6435
|
v * 100
|
|
6436
6436
|
];
|
|
@@ -6439,10 +6439,10 @@ var require_color = __commonJS({
|
|
|
6439
6439
|
const r = rgb[0];
|
|
6440
6440
|
const g = rgb[1];
|
|
6441
6441
|
let b = rgb[2];
|
|
6442
|
-
const
|
|
6443
|
-
const
|
|
6442
|
+
const h4 = convert.rgb.hsl(rgb)[0];
|
|
6443
|
+
const w2 = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
6444
6444
|
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
6445
|
-
return [
|
|
6445
|
+
return [h4, w2 * 100, b * 100];
|
|
6446
6446
|
};
|
|
6447
6447
|
convert.rgb.oklab = function(rgb) {
|
|
6448
6448
|
const r = srgbNonlinearTransformInv(rgb[0] / 255);
|
|
@@ -6451,10 +6451,10 @@ var require_color = __commonJS({
|
|
|
6451
6451
|
const lp = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
|
|
6452
6452
|
const mp = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
6453
6453
|
const sp = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
6454
|
-
const
|
|
6454
|
+
const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
6455
6455
|
const aa = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
6456
6456
|
const bb = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
6457
|
-
return [
|
|
6457
|
+
return [l * 100, aa * 100, bb * 100];
|
|
6458
6458
|
};
|
|
6459
6459
|
convert.rgb.cmyk = function(rgb) {
|
|
6460
6460
|
const r = rgb[0] / 255;
|
|
@@ -6509,26 +6509,26 @@ var require_color = __commonJS({
|
|
|
6509
6509
|
x = x > LAB_FT ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
6510
6510
|
y = y > LAB_FT ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
6511
6511
|
z = z > LAB_FT ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
6512
|
-
const
|
|
6512
|
+
const l = 116 * y - 16;
|
|
6513
6513
|
const a2 = 500 * (x - y);
|
|
6514
6514
|
const b = 200 * (y - z);
|
|
6515
|
-
return [
|
|
6515
|
+
return [l, a2, b];
|
|
6516
6516
|
};
|
|
6517
6517
|
convert.hsl.rgb = function(hsl) {
|
|
6518
|
-
const
|
|
6518
|
+
const h4 = hsl[0] / 360;
|
|
6519
6519
|
const s = hsl[1] / 100;
|
|
6520
|
-
const
|
|
6520
|
+
const l = hsl[2] / 100;
|
|
6521
6521
|
let t3;
|
|
6522
6522
|
let value;
|
|
6523
6523
|
if (s === 0) {
|
|
6524
|
-
value =
|
|
6524
|
+
value = l * 255;
|
|
6525
6525
|
return [value, value, value];
|
|
6526
6526
|
}
|
|
6527
|
-
const t2 =
|
|
6528
|
-
const t1 = 2 *
|
|
6527
|
+
const t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
6528
|
+
const t1 = 2 * l - t2;
|
|
6529
6529
|
const rgb = [0, 0, 0];
|
|
6530
6530
|
for (let i3 = 0; i3 < 3; i3++) {
|
|
6531
|
-
t3 =
|
|
6531
|
+
t3 = h4 + 1 / 3 * -(i3 - 1);
|
|
6532
6532
|
if (t3 < 0) {
|
|
6533
6533
|
t3++;
|
|
6534
6534
|
}
|
|
@@ -6549,27 +6549,27 @@ var require_color = __commonJS({
|
|
|
6549
6549
|
return rgb;
|
|
6550
6550
|
};
|
|
6551
6551
|
convert.hsl.hsv = function(hsl) {
|
|
6552
|
-
const
|
|
6552
|
+
const h4 = hsl[0];
|
|
6553
6553
|
let s = hsl[1] / 100;
|
|
6554
|
-
let
|
|
6554
|
+
let l = hsl[2] / 100;
|
|
6555
6555
|
let smin = s;
|
|
6556
|
-
const lmin = Math.max(
|
|
6557
|
-
|
|
6558
|
-
s *=
|
|
6556
|
+
const lmin = Math.max(l, 0.01);
|
|
6557
|
+
l *= 2;
|
|
6558
|
+
s *= l <= 1 ? l : 2 - l;
|
|
6559
6559
|
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
6560
|
-
const v = (
|
|
6561
|
-
const sv =
|
|
6562
|
-
return [
|
|
6560
|
+
const v = (l + s) / 2;
|
|
6561
|
+
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
6562
|
+
return [h4, sv * 100, v * 100];
|
|
6563
6563
|
};
|
|
6564
6564
|
convert.hsv.rgb = function(hsv) {
|
|
6565
|
-
const
|
|
6565
|
+
const h4 = hsv[0] / 60;
|
|
6566
6566
|
const s = hsv[1] / 100;
|
|
6567
6567
|
let v = hsv[2] / 100;
|
|
6568
|
-
const hi = Math.floor(
|
|
6569
|
-
const
|
|
6568
|
+
const hi = Math.floor(h4) % 6;
|
|
6569
|
+
const f = h4 - Math.floor(h4);
|
|
6570
6570
|
const p2 = 255 * v * (1 - s);
|
|
6571
|
-
const q2 = 255 * v * (1 - s *
|
|
6572
|
-
const t = 255 * v * (1 - s * (1 -
|
|
6571
|
+
const q2 = 255 * v * (1 - s * f);
|
|
6572
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
6573
6573
|
v *= 255;
|
|
6574
6574
|
switch (hi) {
|
|
6575
6575
|
case 0: {
|
|
@@ -6593,37 +6593,37 @@ var require_color = __commonJS({
|
|
|
6593
6593
|
}
|
|
6594
6594
|
};
|
|
6595
6595
|
convert.hsv.hsl = function(hsv) {
|
|
6596
|
-
const
|
|
6596
|
+
const h4 = hsv[0];
|
|
6597
6597
|
const s = hsv[1] / 100;
|
|
6598
6598
|
const v = hsv[2] / 100;
|
|
6599
6599
|
const vmin = Math.max(v, 0.01);
|
|
6600
6600
|
let sl;
|
|
6601
|
-
let
|
|
6602
|
-
|
|
6601
|
+
let l;
|
|
6602
|
+
l = (2 - s) * v;
|
|
6603
6603
|
const lmin = (2 - s) * vmin;
|
|
6604
6604
|
sl = s * vmin;
|
|
6605
6605
|
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
6606
6606
|
sl = sl || 0;
|
|
6607
|
-
|
|
6608
|
-
return [
|
|
6607
|
+
l /= 2;
|
|
6608
|
+
return [h4, sl * 100, l * 100];
|
|
6609
6609
|
};
|
|
6610
6610
|
convert.hwb.rgb = function(hwb) {
|
|
6611
|
-
const
|
|
6611
|
+
const h4 = hwb[0] / 360;
|
|
6612
6612
|
let wh = hwb[1] / 100;
|
|
6613
6613
|
let bl = hwb[2] / 100;
|
|
6614
6614
|
const ratio = wh + bl;
|
|
6615
|
-
let
|
|
6615
|
+
let f;
|
|
6616
6616
|
if (ratio > 1) {
|
|
6617
6617
|
wh /= ratio;
|
|
6618
6618
|
bl /= ratio;
|
|
6619
6619
|
}
|
|
6620
|
-
const i3 = Math.floor(6 *
|
|
6620
|
+
const i3 = Math.floor(6 * h4);
|
|
6621
6621
|
const v = 1 - bl;
|
|
6622
|
-
|
|
6622
|
+
f = 6 * h4 - i3;
|
|
6623
6623
|
if ((i3 & 1) !== 0) {
|
|
6624
|
-
|
|
6624
|
+
f = 1 - f;
|
|
6625
6625
|
}
|
|
6626
|
-
const
|
|
6626
|
+
const n2 = wh + f * (v - wh);
|
|
6627
6627
|
let r;
|
|
6628
6628
|
let g;
|
|
6629
6629
|
let b;
|
|
@@ -6632,12 +6632,12 @@ var require_color = __commonJS({
|
|
|
6632
6632
|
case 6:
|
|
6633
6633
|
case 0: {
|
|
6634
6634
|
r = v;
|
|
6635
|
-
g =
|
|
6635
|
+
g = n2;
|
|
6636
6636
|
b = wh;
|
|
6637
6637
|
break;
|
|
6638
6638
|
}
|
|
6639
6639
|
case 1: {
|
|
6640
|
-
r =
|
|
6640
|
+
r = n2;
|
|
6641
6641
|
g = v;
|
|
6642
6642
|
b = wh;
|
|
6643
6643
|
break;
|
|
@@ -6645,17 +6645,17 @@ var require_color = __commonJS({
|
|
|
6645
6645
|
case 2: {
|
|
6646
6646
|
r = wh;
|
|
6647
6647
|
g = v;
|
|
6648
|
-
b =
|
|
6648
|
+
b = n2;
|
|
6649
6649
|
break;
|
|
6650
6650
|
}
|
|
6651
6651
|
case 3: {
|
|
6652
6652
|
r = wh;
|
|
6653
|
-
g =
|
|
6653
|
+
g = n2;
|
|
6654
6654
|
b = v;
|
|
6655
6655
|
break;
|
|
6656
6656
|
}
|
|
6657
6657
|
case 4: {
|
|
6658
|
-
r =
|
|
6658
|
+
r = n2;
|
|
6659
6659
|
g = wh;
|
|
6660
6660
|
b = v;
|
|
6661
6661
|
break;
|
|
@@ -6663,7 +6663,7 @@ var require_color = __commonJS({
|
|
|
6663
6663
|
case 5: {
|
|
6664
6664
|
r = v;
|
|
6665
6665
|
g = wh;
|
|
6666
|
-
b =
|
|
6666
|
+
b = n2;
|
|
6667
6667
|
break;
|
|
6668
6668
|
}
|
|
6669
6669
|
}
|
|
@@ -6704,10 +6704,10 @@ var require_color = __commonJS({
|
|
|
6704
6704
|
x = x > LAB_FT ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
6705
6705
|
y = y > LAB_FT ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
6706
6706
|
z = z > LAB_FT ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
6707
|
-
const
|
|
6707
|
+
const l = 116 * y - 16;
|
|
6708
6708
|
const a2 = 500 * (x - y);
|
|
6709
6709
|
const b = 200 * (y - z);
|
|
6710
|
-
return [
|
|
6710
|
+
return [l, a2, b];
|
|
6711
6711
|
};
|
|
6712
6712
|
convert.xyz.oklab = function(xyz) {
|
|
6713
6713
|
const x = xyz[0] / 100;
|
|
@@ -6716,10 +6716,10 @@ var require_color = __commonJS({
|
|
|
6716
6716
|
const lp = Math.cbrt(0.8189330101 * x + 0.3618667424 * y - 0.1288597137 * z);
|
|
6717
6717
|
const mp = Math.cbrt(0.0329845436 * x + 0.9293118715 * y + 0.0361456387 * z);
|
|
6718
6718
|
const sp = Math.cbrt(0.0482003018 * x + 0.2643662691 * y + 0.633851707 * z);
|
|
6719
|
-
const
|
|
6719
|
+
const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
6720
6720
|
const a2 = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
6721
6721
|
const b = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
6722
|
-
return [
|
|
6722
|
+
return [l * 100, a2 * 100, b * 100];
|
|
6723
6723
|
};
|
|
6724
6724
|
convert.oklab.oklch = function(oklab) {
|
|
6725
6725
|
return convert.lab.lch(oklab);
|
|
@@ -6728,37 +6728,37 @@ var require_color = __commonJS({
|
|
|
6728
6728
|
const ll = oklab[0] / 100;
|
|
6729
6729
|
const a2 = oklab[1] / 100;
|
|
6730
6730
|
const b = oklab[2] / 100;
|
|
6731
|
-
const
|
|
6731
|
+
const l = (0.999999998 * ll + 0.396337792 * a2 + 0.215803758 * b) ** 3;
|
|
6732
6732
|
const m3 = (1.000000008 * ll - 0.105561342 * a2 - 0.063854175 * b) ** 3;
|
|
6733
6733
|
const s = (1.000000055 * ll - 0.089484182 * a2 - 1.291485538 * b) ** 3;
|
|
6734
|
-
const x = 1.227013851 *
|
|
6735
|
-
const y = -0.040580178 *
|
|
6736
|
-
const z = -0.076381285 *
|
|
6734
|
+
const x = 1.227013851 * l - 0.55779998 * m3 + 0.281256149 * s;
|
|
6735
|
+
const y = -0.040580178 * l + 1.11225687 * m3 - 0.071676679 * s;
|
|
6736
|
+
const z = -0.076381285 * l - 0.421481978 * m3 + 1.58616322 * s;
|
|
6737
6737
|
return [x * 100, y * 100, z * 100];
|
|
6738
6738
|
};
|
|
6739
6739
|
convert.oklab.rgb = function(oklab) {
|
|
6740
6740
|
const ll = oklab[0] / 100;
|
|
6741
6741
|
const aa = oklab[1] / 100;
|
|
6742
6742
|
const bb = oklab[2] / 100;
|
|
6743
|
-
const
|
|
6743
|
+
const l = (ll + 0.3963377774 * aa + 0.2158037573 * bb) ** 3;
|
|
6744
6744
|
const m3 = (ll - 0.1055613458 * aa - 0.0638541728 * bb) ** 3;
|
|
6745
6745
|
const s = (ll - 0.0894841775 * aa - 1.291485548 * bb) ** 3;
|
|
6746
|
-
const r = srgbNonlinearTransform(4.0767416621 *
|
|
6747
|
-
const g = srgbNonlinearTransform(-1.2684380046 *
|
|
6748
|
-
const b = srgbNonlinearTransform(-0.0041960863 *
|
|
6746
|
+
const r = srgbNonlinearTransform(4.0767416621 * l - 3.3077115913 * m3 + 0.2309699292 * s);
|
|
6747
|
+
const g = srgbNonlinearTransform(-1.2684380046 * l + 2.6097574011 * m3 - 0.3413193965 * s);
|
|
6748
|
+
const b = srgbNonlinearTransform(-0.0041960863 * l - 0.7034186147 * m3 + 1.707614701 * s);
|
|
6749
6749
|
return [r * 255, g * 255, b * 255];
|
|
6750
6750
|
};
|
|
6751
6751
|
convert.oklch.oklab = function(oklch) {
|
|
6752
6752
|
return convert.lch.lab(oklch);
|
|
6753
6753
|
};
|
|
6754
6754
|
convert.lab.xyz = function(lab) {
|
|
6755
|
-
const
|
|
6755
|
+
const l = lab[0];
|
|
6756
6756
|
const a2 = lab[1];
|
|
6757
6757
|
const b = lab[2];
|
|
6758
6758
|
let x;
|
|
6759
6759
|
let y;
|
|
6760
6760
|
let z;
|
|
6761
|
-
y = (
|
|
6761
|
+
y = (l + 16) / 116;
|
|
6762
6762
|
x = a2 / 500 + y;
|
|
6763
6763
|
z = y - b / 200;
|
|
6764
6764
|
const y2 = y ** 3;
|
|
@@ -6773,26 +6773,26 @@ var require_color = __commonJS({
|
|
|
6773
6773
|
return [x, y, z];
|
|
6774
6774
|
};
|
|
6775
6775
|
convert.lab.lch = function(lab) {
|
|
6776
|
-
const
|
|
6776
|
+
const l = lab[0];
|
|
6777
6777
|
const a2 = lab[1];
|
|
6778
6778
|
const b = lab[2];
|
|
6779
|
-
let
|
|
6779
|
+
let h4;
|
|
6780
6780
|
const hr = Math.atan2(b, a2);
|
|
6781
|
-
|
|
6782
|
-
if (
|
|
6783
|
-
|
|
6781
|
+
h4 = hr * 360 / 2 / Math.PI;
|
|
6782
|
+
if (h4 < 0) {
|
|
6783
|
+
h4 += 360;
|
|
6784
6784
|
}
|
|
6785
6785
|
const c3 = Math.sqrt(a2 * a2 + b * b);
|
|
6786
|
-
return [
|
|
6786
|
+
return [l, c3, h4];
|
|
6787
6787
|
};
|
|
6788
6788
|
convert.lch.lab = function(lch) {
|
|
6789
|
-
const
|
|
6789
|
+
const l = lch[0];
|
|
6790
6790
|
const c3 = lch[1];
|
|
6791
|
-
const
|
|
6792
|
-
const hr =
|
|
6791
|
+
const h4 = lch[2];
|
|
6792
|
+
const hr = h4 / 360 * 2 * Math.PI;
|
|
6793
6793
|
const a2 = c3 * Math.cos(hr);
|
|
6794
6794
|
const b = c3 * Math.sin(hr);
|
|
6795
|
-
return [
|
|
6795
|
+
return [l, a2, b];
|
|
6796
6796
|
};
|
|
6797
6797
|
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
6798
6798
|
const [r, g, b] = args;
|
|
@@ -6899,35 +6899,35 @@ var require_color = __commonJS({
|
|
|
6899
6899
|
};
|
|
6900
6900
|
convert.hsl.hcg = function(hsl) {
|
|
6901
6901
|
const s = hsl[1] / 100;
|
|
6902
|
-
const
|
|
6903
|
-
const c3 =
|
|
6904
|
-
let
|
|
6902
|
+
const l = hsl[2] / 100;
|
|
6903
|
+
const c3 = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
6904
|
+
let f = 0;
|
|
6905
6905
|
if (c3 < 1) {
|
|
6906
|
-
|
|
6906
|
+
f = (l - 0.5 * c3) / (1 - c3);
|
|
6907
6907
|
}
|
|
6908
|
-
return [hsl[0], c3 * 100,
|
|
6908
|
+
return [hsl[0], c3 * 100, f * 100];
|
|
6909
6909
|
};
|
|
6910
6910
|
convert.hsv.hcg = function(hsv) {
|
|
6911
6911
|
const s = hsv[1] / 100;
|
|
6912
6912
|
const v = hsv[2] / 100;
|
|
6913
6913
|
const c3 = s * v;
|
|
6914
|
-
let
|
|
6914
|
+
let f = 0;
|
|
6915
6915
|
if (c3 < 1) {
|
|
6916
|
-
|
|
6916
|
+
f = (v - c3) / (1 - c3);
|
|
6917
6917
|
}
|
|
6918
|
-
return [hsv[0], c3 * 100,
|
|
6918
|
+
return [hsv[0], c3 * 100, f * 100];
|
|
6919
6919
|
};
|
|
6920
6920
|
convert.hcg.rgb = function(hcg) {
|
|
6921
|
-
const
|
|
6921
|
+
const h4 = hcg[0] / 360;
|
|
6922
6922
|
const c3 = hcg[1] / 100;
|
|
6923
6923
|
const g = hcg[2] / 100;
|
|
6924
6924
|
if (c3 === 0) {
|
|
6925
6925
|
return [g * 255, g * 255, g * 255];
|
|
6926
6926
|
}
|
|
6927
6927
|
const pure = [0, 0, 0];
|
|
6928
|
-
const hi =
|
|
6928
|
+
const hi = h4 % 1 * 6;
|
|
6929
6929
|
const v = hi % 1;
|
|
6930
|
-
const
|
|
6930
|
+
const w2 = 1 - v;
|
|
6931
6931
|
let mg = 0;
|
|
6932
6932
|
switch (Math.floor(hi)) {
|
|
6933
6933
|
case 0: {
|
|
@@ -6937,7 +6937,7 @@ var require_color = __commonJS({
|
|
|
6937
6937
|
break;
|
|
6938
6938
|
}
|
|
6939
6939
|
case 1: {
|
|
6940
|
-
pure[0] =
|
|
6940
|
+
pure[0] = w2;
|
|
6941
6941
|
pure[1] = 1;
|
|
6942
6942
|
pure[2] = 0;
|
|
6943
6943
|
break;
|
|
@@ -6950,7 +6950,7 @@ var require_color = __commonJS({
|
|
|
6950
6950
|
}
|
|
6951
6951
|
case 3: {
|
|
6952
6952
|
pure[0] = 0;
|
|
6953
|
-
pure[1] =
|
|
6953
|
+
pure[1] = w2;
|
|
6954
6954
|
pure[2] = 1;
|
|
6955
6955
|
break;
|
|
6956
6956
|
}
|
|
@@ -6963,7 +6963,7 @@ var require_color = __commonJS({
|
|
|
6963
6963
|
default: {
|
|
6964
6964
|
pure[0] = 1;
|
|
6965
6965
|
pure[1] = 0;
|
|
6966
|
-
pure[2] =
|
|
6966
|
+
pure[2] = w2;
|
|
6967
6967
|
}
|
|
6968
6968
|
}
|
|
6969
6969
|
mg = (1 - c3) * g;
|
|
@@ -6977,23 +6977,23 @@ var require_color = __commonJS({
|
|
|
6977
6977
|
const c3 = hcg[1] / 100;
|
|
6978
6978
|
const g = hcg[2] / 100;
|
|
6979
6979
|
const v = c3 + g * (1 - c3);
|
|
6980
|
-
let
|
|
6980
|
+
let f = 0;
|
|
6981
6981
|
if (v > 0) {
|
|
6982
|
-
|
|
6982
|
+
f = c3 / v;
|
|
6983
6983
|
}
|
|
6984
|
-
return [hcg[0],
|
|
6984
|
+
return [hcg[0], f * 100, v * 100];
|
|
6985
6985
|
};
|
|
6986
6986
|
convert.hcg.hsl = function(hcg) {
|
|
6987
6987
|
const c3 = hcg[1] / 100;
|
|
6988
6988
|
const g = hcg[2] / 100;
|
|
6989
|
-
const
|
|
6989
|
+
const l = g * (1 - c3) + 0.5 * c3;
|
|
6990
6990
|
let s = 0;
|
|
6991
|
-
if (
|
|
6992
|
-
s = c3 / (2 *
|
|
6993
|
-
} else if (
|
|
6994
|
-
s = c3 / (2 * (1 -
|
|
6991
|
+
if (l > 0 && l < 0.5) {
|
|
6992
|
+
s = c3 / (2 * l);
|
|
6993
|
+
} else if (l >= 0.5 && l < 1) {
|
|
6994
|
+
s = c3 / (2 * (1 - l));
|
|
6995
6995
|
}
|
|
6996
|
-
return [hcg[0], s * 100,
|
|
6996
|
+
return [hcg[0], s * 100, l * 100];
|
|
6997
6997
|
};
|
|
6998
6998
|
convert.hcg.hwb = function(hcg) {
|
|
6999
6999
|
const c3 = hcg[1] / 100;
|
|
@@ -7002,10 +7002,10 @@ var require_color = __commonJS({
|
|
|
7002
7002
|
return [hcg[0], (v - c3) * 100, (1 - v) * 100];
|
|
7003
7003
|
};
|
|
7004
7004
|
convert.hwb.hcg = function(hwb) {
|
|
7005
|
-
const
|
|
7005
|
+
const w2 = hwb[1] / 100;
|
|
7006
7006
|
const b = hwb[2] / 100;
|
|
7007
7007
|
const v = 1 - b;
|
|
7008
|
-
const c3 = v -
|
|
7008
|
+
const c3 = v - w2;
|
|
7009
7009
|
let g = 0;
|
|
7010
7010
|
if (c3 < 1) {
|
|
7011
7011
|
g = (v - c3) / (1 - c3);
|
|
@@ -7458,14 +7458,14 @@ var require_color = __commonJS({
|
|
|
7458
7458
|
const color1 = mixinColor.rgb();
|
|
7459
7459
|
const color2 = this.rgb();
|
|
7460
7460
|
const p2 = weight === void 0 ? 0.5 : weight;
|
|
7461
|
-
const
|
|
7461
|
+
const w2 = 2 * p2 - 1;
|
|
7462
7462
|
const a2 = color1.alpha() - color2.alpha();
|
|
7463
|
-
const w1 = ((
|
|
7464
|
-
const
|
|
7463
|
+
const w1 = ((w2 * a2 === -1 ? w2 : (w2 + a2) / (1 + w2 * a2)) + 1) / 2;
|
|
7464
|
+
const w22 = 1 - w1;
|
|
7465
7465
|
return Color.rgb(
|
|
7466
|
-
w1 * color1.red() +
|
|
7467
|
-
w1 * color1.green() +
|
|
7468
|
-
w1 * color1.blue() +
|
|
7466
|
+
w1 * color1.red() + w22 * color2.red(),
|
|
7467
|
+
w1 * color1.green() + w22 * color2.green(),
|
|
7468
|
+
w1 * color1.blue() + w22 * color2.blue(),
|
|
7469
7469
|
color1.alpha() * p2 + color2.alpha() * (1 - p2)
|
|
7470
7470
|
);
|
|
7471
7471
|
}
|
|
@@ -8723,8 +8723,8 @@ var require_lib = __commonJS({
|
|
|
8723
8723
|
// ../codec-sharp/dist/index.mjs
|
|
8724
8724
|
var dist_exports2 = {};
|
|
8725
8725
|
__export(dist_exports2, {
|
|
8726
|
-
codecSharp: () =>
|
|
8727
|
-
default: () =>
|
|
8726
|
+
codecSharp: () => n,
|
|
8727
|
+
default: () => h2
|
|
8728
8728
|
});
|
|
8729
8729
|
async function a(r) {
|
|
8730
8730
|
try {
|
|
@@ -8735,7 +8735,7 @@ async function a(r) {
|
|
|
8735
8735
|
throw new Error(`Failed to read image file ${r}: ${e}`);
|
|
8736
8736
|
}
|
|
8737
8737
|
}
|
|
8738
|
-
async function
|
|
8738
|
+
async function o(r, e) {
|
|
8739
8739
|
try {
|
|
8740
8740
|
let t = (0, import_sharp.default)(r.data, { raw: { width: r.width, height: r.height, channels: 4 } });
|
|
8741
8741
|
typeof e == "string" ? await t.png().toFile(e) : e.set(await t.png().toBuffer());
|
|
@@ -8743,13 +8743,13 @@ async function n(r, e) {
|
|
|
8743
8743
|
throw new Error(`Failed to write image file ${e}: ${t}`);
|
|
8744
8744
|
}
|
|
8745
8745
|
}
|
|
8746
|
-
var import_sharp,
|
|
8746
|
+
var import_sharp, n, h2;
|
|
8747
8747
|
var init_dist2 = __esm({
|
|
8748
8748
|
"../codec-sharp/dist/index.mjs"() {
|
|
8749
8749
|
"use strict";
|
|
8750
8750
|
import_sharp = __toESM(require_lib(), 1);
|
|
8751
|
-
|
|
8752
|
-
|
|
8751
|
+
n = { read: a, write: o };
|
|
8752
|
+
h2 = n;
|
|
8753
8753
|
}
|
|
8754
8754
|
});
|
|
8755
8755
|
|
|
@@ -9072,44 +9072,44 @@ var init_encode = __esm({
|
|
|
9072
9072
|
// ../codec-jsquash-png/dist/index.mjs
|
|
9073
9073
|
var dist_exports3 = {};
|
|
9074
9074
|
__export(dist_exports3, {
|
|
9075
|
-
codecJsquashPng: () =>
|
|
9075
|
+
codecJsquashPng: () => w,
|
|
9076
9076
|
default: () => p
|
|
9077
9077
|
});
|
|
9078
9078
|
function c2() {
|
|
9079
|
-
return
|
|
9080
|
-
let e = (0, import_path.dirname)(i2.resolve("@jsquash/png")),
|
|
9081
|
-
return await Promise.all([
|
|
9082
|
-
})(),
|
|
9079
|
+
return o2 || (o2 = (async () => {
|
|
9080
|
+
let e = (0, import_path.dirname)(i2.resolve("@jsquash/png")), a2 = (0, import_path.join)(e, "codec", "pkg", "squoosh_png_bg.wasm"), t = (0, import_fs2.readFileSync)(a2), n2 = await Promise.resolve().then(() => (init_decode(), decode_exports)), r = await Promise.resolve().then(() => (init_encode(), encode_exports));
|
|
9081
|
+
return await Promise.all([n2.init(t), r.init(t)]), { decode: n2.default, encode: r.default };
|
|
9082
|
+
})(), o2);
|
|
9083
9083
|
}
|
|
9084
|
-
async function
|
|
9084
|
+
async function h3(e) {
|
|
9085
9085
|
try {
|
|
9086
|
-
let { decode:
|
|
9086
|
+
let { decode: a2 } = await c2(), t = typeof e == "string" ? (0, import_fs2.readFileSync)(e) : e, n2 = new Uint8Array(t).buffer, r = await a2(n2);
|
|
9087
9087
|
return { data: r.data, width: r.width, height: r.height };
|
|
9088
|
-
} catch (
|
|
9089
|
-
throw new Error(`Failed to read PNG file ${e}: ${
|
|
9088
|
+
} catch (a2) {
|
|
9089
|
+
throw new Error(`Failed to read PNG file ${e}: ${a2}`);
|
|
9090
9090
|
}
|
|
9091
9091
|
}
|
|
9092
|
-
async function m2(e,
|
|
9092
|
+
async function m2(e, a2) {
|
|
9093
9093
|
try {
|
|
9094
|
-
let { encode:
|
|
9095
|
-
(0, import_fs2.writeFileSync)(
|
|
9096
|
-
} catch (
|
|
9097
|
-
throw new Error(`Failed to write PNG file ${
|
|
9094
|
+
let { encode: t } = await c2(), n2 = { data: new Uint8ClampedArray(e.data.buffer, e.data.byteOffset, e.data.byteLength), width: e.width, height: e.height, colorSpace: "srgb" }, r = await t(n2);
|
|
9095
|
+
(0, import_fs2.writeFileSync)(a2, Buffer.from(r));
|
|
9096
|
+
} catch (t) {
|
|
9097
|
+
throw new Error(`Failed to write PNG file ${a2}: ${t}`);
|
|
9098
9098
|
}
|
|
9099
9099
|
}
|
|
9100
|
-
var import_fs2, import_path, i2,
|
|
9100
|
+
var import_fs2, import_path, i2, o2, w, p;
|
|
9101
9101
|
var init_dist3 = __esm({
|
|
9102
9102
|
"../codec-jsquash-png/dist/index.mjs"() {
|
|
9103
9103
|
"use strict";
|
|
9104
9104
|
import_fs2 = require("fs");
|
|
9105
9105
|
import_path = require("path");
|
|
9106
|
-
i2 = ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (
|
|
9106
|
+
i2 = ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (a2, t) => (typeof require < "u" ? require : a2)[t] }) : e)(function(e) {
|
|
9107
9107
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
9108
9108
|
throw Error('Dynamic require of "' + e + '" is not supported');
|
|
9109
9109
|
});
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
p =
|
|
9110
|
+
o2 = null;
|
|
9111
|
+
w = { read: h3, write: m2 };
|
|
9112
|
+
p = w;
|
|
9113
9113
|
}
|
|
9114
9114
|
});
|
|
9115
9115
|
|
|
@@ -9121,87 +9121,87 @@ __export(gmsd_exports, {
|
|
|
9121
9121
|
module.exports = __toCommonJS(gmsd_exports);
|
|
9122
9122
|
|
|
9123
9123
|
// ../gmsd/dist/index.mjs
|
|
9124
|
-
function D(e,
|
|
9125
|
-
let { downsample: s = 0, c: c3 = 170 } =
|
|
9126
|
-
if (H(e,
|
|
9124
|
+
function D(e, n2, a2, t, r, o3 = {}) {
|
|
9125
|
+
let { downsample: s = 0, c: c3 = 170 } = o3;
|
|
9126
|
+
if (H(e, n2)) {
|
|
9127
9127
|
if (a2) for (let y = 0; y < t * r * 4; y += 4) a2[y] = 255, a2[y + 1] = 255, a2[y + 2] = 255, a2[y + 3] = 255;
|
|
9128
9128
|
return 0;
|
|
9129
9129
|
}
|
|
9130
|
-
let
|
|
9131
|
-
if (
|
|
9130
|
+
let f = e.length / (t * r) === 4, l, u, b = t, x = r;
|
|
9131
|
+
if (f) l = new Float32Array(t * r), u = new Float32Array(t * r), q(e, l, t, r), q(n2, u, t, r);
|
|
9132
9132
|
else {
|
|
9133
|
-
|
|
9134
|
-
for (let y = 0; y < t * r; y++)
|
|
9133
|
+
l = new Float32Array(t * r), u = new Float32Array(t * r);
|
|
9134
|
+
for (let y = 0; y < t * r; y++) l[y] = e[y], u[y] = n2[y];
|
|
9135
9135
|
}
|
|
9136
9136
|
if (s === 1) {
|
|
9137
|
-
let y = P(
|
|
9137
|
+
let y = P(l, t, r), k = P(u, t, r), d2 = Math.floor(t / 2), I = Math.floor(r / 2), M = new Float32Array(d2 * I), v = new Float32Array(d2 * I);
|
|
9138
9138
|
for (let i3 = 0; i3 < I; i3++) for (let p2 = 0; p2 < d2; p2++) {
|
|
9139
9139
|
let G = i3 * 2 * t + p2 * 2;
|
|
9140
|
-
M[i3 * d2 + p2] = y[G], v[i3 * d2 + p2] =
|
|
9140
|
+
M[i3 * d2 + p2] = y[G], v[i3 * d2 + p2] = k[G];
|
|
9141
9141
|
}
|
|
9142
|
-
|
|
9142
|
+
l = M, u = v, b = d2, x = I;
|
|
9143
9143
|
}
|
|
9144
|
-
let F =
|
|
9145
|
-
return a2 && O(a2, F, A, c3, b, x),
|
|
9144
|
+
let F = B(l, b, x), A = B(u, b, x), g = U(F, A, c3, b, x), S = W(g);
|
|
9145
|
+
return a2 && O(a2, F, A, c3, b, x), S;
|
|
9146
9146
|
}
|
|
9147
|
-
function H(e,
|
|
9148
|
-
if (e.length !==
|
|
9149
|
-
for (let a2 = 0; a2 < e.length; a2++) if (e[a2] !==
|
|
9147
|
+
function H(e, n2) {
|
|
9148
|
+
if (e.length !== n2.length) return false;
|
|
9149
|
+
for (let a2 = 0; a2 < e.length; a2++) if (e[a2] !== n2[a2]) return false;
|
|
9150
9150
|
return true;
|
|
9151
9151
|
}
|
|
9152
|
-
function P(e,
|
|
9153
|
-
let t = new Float32Array(
|
|
9154
|
-
for (let r = 0; r < a2; r++) for (let
|
|
9152
|
+
function P(e, n2, a2) {
|
|
9153
|
+
let t = new Float32Array(n2 * a2);
|
|
9154
|
+
for (let r = 0; r < a2; r++) for (let o3 = 0; o3 < n2; o3++) {
|
|
9155
9155
|
let s = 0;
|
|
9156
9156
|
for (let c3 = 0; c3 < 2; c3++) for (let m3 = 0; m3 < 2; m3++) {
|
|
9157
|
-
let
|
|
9158
|
-
|
|
9157
|
+
let f = r + c3, l = o3 + m3;
|
|
9158
|
+
f < a2 && l < n2 && (s += e[f * n2 + l]);
|
|
9159
9159
|
}
|
|
9160
|
-
t[r *
|
|
9160
|
+
t[r * n2 + o3] = s / 4;
|
|
9161
9161
|
}
|
|
9162
9162
|
return t;
|
|
9163
9163
|
}
|
|
9164
|
-
function O(e,
|
|
9164
|
+
function O(e, n2, a2, t, r, o3) {
|
|
9165
9165
|
e.fill(0);
|
|
9166
|
-
for (let s = 1; s <
|
|
9167
|
-
let m3 = s * r + c3,
|
|
9166
|
+
for (let s = 1; s < o3 - 1; s++) for (let c3 = 1; c3 < r - 1; c3++) {
|
|
9167
|
+
let m3 = s * r + c3, f = n2[m3], l = a2[m3], u = 2 * f * l + t, b = f * f + l * l + t, x = u / b, F = Math.floor(x * 255), A = m3 * 4;
|
|
9168
9168
|
e[A] = F, e[A + 1] = F, e[A + 2] = F, e[A + 3] = 255;
|
|
9169
9169
|
}
|
|
9170
9170
|
}
|
|
9171
|
-
function q(e,
|
|
9171
|
+
function q(e, n2, a2, t) {
|
|
9172
9172
|
let r = a2 * t;
|
|
9173
|
-
for (let
|
|
9174
|
-
let s =
|
|
9175
|
-
|
|
9173
|
+
for (let o3 = 0; o3 < r; o3++) {
|
|
9174
|
+
let s = o3 * 4, c3 = e[s], m3 = e[s + 1], f = e[s + 2];
|
|
9175
|
+
n2[o3] = 0.298936 * c3 + 0.587043 * m3 + 0.114021 * f;
|
|
9176
9176
|
}
|
|
9177
9177
|
}
|
|
9178
|
-
function
|
|
9179
|
-
let t = new Float32Array(
|
|
9180
|
-
for (let r = 1; r < a2 - 1; r++) for (let
|
|
9181
|
-
let s = r *
|
|
9178
|
+
function B(e, n2, a2) {
|
|
9179
|
+
let t = new Float32Array(n2 * a2);
|
|
9180
|
+
for (let r = 1; r < a2 - 1; r++) for (let o3 = 1; o3 < n2 - 1; o3++) {
|
|
9181
|
+
let s = r * n2 + o3, c3 = e[(r - 1) * n2 + (o3 - 1)], m3 = e[(r - 1) * n2 + o3], f = e[(r - 1) * n2 + (o3 + 1)], l = e[r * n2 + (o3 - 1)], u = e[r * n2 + (o3 + 1)], b = e[(r + 1) * n2 + (o3 - 1)], x = e[(r + 1) * n2 + o3], F = e[(r + 1) * n2 + (o3 + 1)], A = (c3 + l + b - f - u - F) / 3, g = (c3 + m3 + f - b - x - F) / 3;
|
|
9182
9182
|
t[s] = Math.sqrt(A * A + g * g);
|
|
9183
9183
|
}
|
|
9184
9184
|
return t;
|
|
9185
9185
|
}
|
|
9186
|
-
function U(e,
|
|
9187
|
-
let
|
|
9186
|
+
function U(e, n2, a2, t, r) {
|
|
9187
|
+
let o3 = [];
|
|
9188
9188
|
for (let s = 1; s < r - 1; s++) for (let c3 = 1; c3 < t - 1; c3++) {
|
|
9189
|
-
let m3 = s * t + c3,
|
|
9190
|
-
|
|
9189
|
+
let m3 = s * t + c3, f = e[m3], l = n2[m3], u = 2 * f * l + a2, b = f * f + l * l + a2;
|
|
9190
|
+
o3.push(u / b);
|
|
9191
9191
|
}
|
|
9192
|
-
return new Float32Array(
|
|
9192
|
+
return new Float32Array(o3);
|
|
9193
9193
|
}
|
|
9194
9194
|
function W(e) {
|
|
9195
|
-
let
|
|
9196
|
-
if (
|
|
9195
|
+
let n2 = e.length;
|
|
9196
|
+
if (n2 === 0) return 0;
|
|
9197
9197
|
let a2 = 0;
|
|
9198
|
-
for (let
|
|
9199
|
-
let t = a2 /
|
|
9200
|
-
for (let
|
|
9201
|
-
let s = e[
|
|
9198
|
+
for (let o3 = 0; o3 < n2; o3++) a2 += e[o3];
|
|
9199
|
+
let t = a2 / n2, r = 0;
|
|
9200
|
+
for (let o3 = 0; o3 < n2; o3++) {
|
|
9201
|
+
let s = e[o3] - t;
|
|
9202
9202
|
r += s * s;
|
|
9203
9203
|
}
|
|
9204
|
-
return r /=
|
|
9204
|
+
return r /= n2, Math.sqrt(r);
|
|
9205
9205
|
}
|
|
9206
9206
|
var C = D;
|
|
9207
9207
|
|