@idetik/core 0.35.1 → 0.35.2
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/index.d.ts +29 -33
- package/dist/index.js +200 -212
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +27 -27
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/renderer.d.ts +0 -4
- package/dist/types/src/core/renderer.d.ts.map +1 -1
- package/dist/types/src/idetik.d.ts +0 -2
- package/dist/types/src/idetik.d.ts.map +1 -1
- package/dist/types/src/renderers/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,76 +1,7 @@
|
|
|
1
|
-
class X {
|
|
2
|
-
static RED = new X(1, 0, 0);
|
|
3
|
-
static GREEN = new X(0, 1, 0);
|
|
4
|
-
static BLUE = new X(0, 0, 1);
|
|
5
|
-
static YELLOW = new X(1, 1, 0);
|
|
6
|
-
static MAGENTA = new X(1, 0, 1);
|
|
7
|
-
static CYAN = new X(0, 1, 1);
|
|
8
|
-
static BLACK = new X(0, 0, 0);
|
|
9
|
-
static WHITE = new X(1, 1, 1);
|
|
10
|
-
static TRANSPARENT = new X(0, 0, 0, 0);
|
|
11
|
-
// RGBA color values in the range [0, 1]
|
|
12
|
-
rgba_;
|
|
13
|
-
constructor(A, I, g, B) {
|
|
14
|
-
if (A < 0 || A > 1 || I < 0 || I > 1 || g < 0 || g > 1)
|
|
15
|
-
throw new Error("RGB values must be in the range [0, 1]");
|
|
16
|
-
if (B !== void 0 && (B < 0 || B > 1))
|
|
17
|
-
throw new Error("Alpha value must be in the range [0, 1]");
|
|
18
|
-
this.rgba_ = [A, I, g, B ?? 1];
|
|
19
|
-
}
|
|
20
|
-
get rgb() {
|
|
21
|
-
return [this.rgba_[0], this.rgba_[1], this.rgba_[2]];
|
|
22
|
-
}
|
|
23
|
-
get rgba() {
|
|
24
|
-
return this.rgba_;
|
|
25
|
-
}
|
|
26
|
-
get r() {
|
|
27
|
-
return this.rgba_[0];
|
|
28
|
-
}
|
|
29
|
-
get g() {
|
|
30
|
-
return this.rgba_[1];
|
|
31
|
-
}
|
|
32
|
-
get b() {
|
|
33
|
-
return this.rgba_[2];
|
|
34
|
-
}
|
|
35
|
-
get a() {
|
|
36
|
-
return this.rgba_[3];
|
|
37
|
-
}
|
|
38
|
-
get rgbHex() {
|
|
39
|
-
return `#${this.toHexComponent(this.r)}${this.toHexComponent(this.g)}${this.toHexComponent(this.b)}`;
|
|
40
|
-
}
|
|
41
|
-
get packed() {
|
|
42
|
-
return Math.round(this.r * 255) << 24 | Math.round(this.g * 255) << 16 | Math.round(this.b * 255) << 8 | Math.round(this.a * 255);
|
|
43
|
-
}
|
|
44
|
-
static from(A) {
|
|
45
|
-
if (A instanceof X)
|
|
46
|
-
return A;
|
|
47
|
-
if (Array.isArray(A))
|
|
48
|
-
return new X(A[0], A[1], A[2], A[3]);
|
|
49
|
-
if (typeof A == "string")
|
|
50
|
-
return X.fromRgbHex(A);
|
|
51
|
-
throw new Error("Unsupported color format");
|
|
52
|
-
}
|
|
53
|
-
static fromRgbHex(A) {
|
|
54
|
-
const I = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);
|
|
55
|
-
if (!I)
|
|
56
|
-
throw new Error("Invalid RGB hex, use form '#RRGGBB'");
|
|
57
|
-
return new X(
|
|
58
|
-
parseInt(I[1], 16) / 255,
|
|
59
|
-
parseInt(I[2], 16) / 255,
|
|
60
|
-
parseInt(I[3], 16) / 255,
|
|
61
|
-
1
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
toHexComponent(A) {
|
|
65
|
-
const I = Math.round(A * 255).toString(16).padStart(2, "0");
|
|
66
|
-
return I.length === 1 ? "0" + I : I;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
1
|
class lQ {
|
|
70
2
|
canvas_;
|
|
71
3
|
width_ = 0;
|
|
72
4
|
height_ = 0;
|
|
73
|
-
backgroundColor_ = new X(0, 0, 0, 0);
|
|
74
5
|
renderedObjects_ = 0;
|
|
75
6
|
constructor(A) {
|
|
76
7
|
this.canvas_ = A, this.updateRendererSize();
|
|
@@ -92,15 +23,9 @@ class lQ {
|
|
|
92
23
|
get height() {
|
|
93
24
|
return this.height_;
|
|
94
25
|
}
|
|
95
|
-
get backgroundColor() {
|
|
96
|
-
return this.backgroundColor_;
|
|
97
|
-
}
|
|
98
26
|
get renderedObjects() {
|
|
99
27
|
return this.renderedObjects_;
|
|
100
28
|
}
|
|
101
|
-
set backgroundColor(A) {
|
|
102
|
-
this.backgroundColor_ = X.from(A);
|
|
103
|
-
}
|
|
104
29
|
}
|
|
105
30
|
var HE = `#version 300 es
|
|
106
31
|
|
|
@@ -841,7 +766,7 @@ function LQ(C) {
|
|
|
841
766
|
class dB {
|
|
842
767
|
id = LQ();
|
|
843
768
|
}
|
|
844
|
-
var
|
|
769
|
+
var AA = 1e-6, DA = typeof Float32Array < "u" ? Float32Array : Array, _E = Math.PI / 180;
|
|
845
770
|
function XE(C) {
|
|
846
771
|
return C * _E;
|
|
847
772
|
}
|
|
@@ -865,8 +790,8 @@ function $E(C, A, I, g, B, Q, E, i, o, s, t, e, n, D, F, k) {
|
|
|
865
790
|
return S[0] = C, S[1] = A, S[2] = I, S[3] = g, S[4] = B, S[5] = Q, S[6] = E, S[7] = i, S[8] = o, S[9] = s, S[10] = t, S[11] = e, S[12] = n, S[13] = D, S[14] = F, S[15] = k, S;
|
|
866
791
|
}
|
|
867
792
|
function Mg(C, A) {
|
|
868
|
-
var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], e = A[9], n = A[10], D = A[11], F = A[12], k = A[13], S = A[14], U = A[15], f = I * i - g * E, d = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, v = B * s - Q * o,
|
|
869
|
-
return sA ? (sA = 1 / sA, C[0] = (i * KA - o * fA + s * oA) * sA, C[1] = (B * fA - g * KA - Q * oA) * sA, C[2] = (k * v - S * M + U * L) * sA, C[3] = (n * M - e * v - D * L) * sA, C[4] = (o * gA - E * KA - s * iA) * sA, C[5] = (I * KA - B * gA + Q * iA) * sA, C[6] = (S * R - F * v - U * d) * sA, C[7] = (t * v - n * R + D * d) * sA, C[8] = (E * fA - i * gA + s *
|
|
793
|
+
var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], e = A[9], n = A[10], D = A[11], F = A[12], k = A[13], S = A[14], U = A[15], f = I * i - g * E, d = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, v = B * s - Q * o, $ = t * k - e * F, iA = t * S - n * F, gA = t * U - D * F, oA = e * S - n * k, fA = e * U - D * k, KA = n * U - D * S, sA = f * KA - d * fA + R * oA + L * gA - M * iA + v * $;
|
|
794
|
+
return sA ? (sA = 1 / sA, C[0] = (i * KA - o * fA + s * oA) * sA, C[1] = (B * fA - g * KA - Q * oA) * sA, C[2] = (k * v - S * M + U * L) * sA, C[3] = (n * M - e * v - D * L) * sA, C[4] = (o * gA - E * KA - s * iA) * sA, C[5] = (I * KA - B * gA + Q * iA) * sA, C[6] = (S * R - F * v - U * d) * sA, C[7] = (t * v - n * R + D * d) * sA, C[8] = (E * fA - i * gA + s * $) * sA, C[9] = (g * gA - I * fA - Q * $) * sA, C[10] = (F * M - k * R + U * f) * sA, C[11] = (e * R - t * M - D * f) * sA, C[12] = (i * iA - E * oA - o * $) * sA, C[13] = (I * oA - g * iA + B * $) * sA, C[14] = (k * d - F * L - S * f) * sA, C[15] = (t * L - e * d + n * f) * sA, C) : null;
|
|
870
795
|
}
|
|
871
796
|
function aI(C, A, I) {
|
|
872
797
|
var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], e = A[8], n = A[9], D = A[10], F = A[11], k = A[12], S = A[13], U = A[14], f = A[15], d = I[0], R = I[1], L = I[2], M = I[3];
|
|
@@ -905,8 +830,8 @@ function Ei(C, A, I, g) {
|
|
|
905
830
|
return D = F * F + k * k + S * S, D > 0 && (D = 1 / Math.sqrt(D), F *= D, k *= D, S *= D), C[0] = F, C[1] = k, C[2] = S, C[3] = 0, C[4] = e * S - n * k, C[5] = n * F - t * S, C[6] = t * k - e * F, C[7] = 0, C[8] = t, C[9] = e, C[10] = n, C[11] = 0, C[12] = B, C[13] = Q, C[14] = E, C[15] = 1, C;
|
|
906
831
|
}
|
|
907
832
|
function ii(C, A) {
|
|
908
|
-
var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], e = C[9], n = C[10], D = C[11], F = C[12], k = C[13], S = C[14], U = C[15], f = A[0], d = A[1], R = A[2], L = A[3], M = A[4], v = A[5],
|
|
909
|
-
return Math.abs(I - f) <=
|
|
833
|
+
var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], e = C[9], n = C[10], D = C[11], F = C[12], k = C[13], S = C[14], U = C[15], f = A[0], d = A[1], R = A[2], L = A[3], M = A[4], v = A[5], $ = A[6], iA = A[7], gA = A[8], oA = A[9], fA = A[10], KA = A[11], sA = A[12], tC = A[13], eC = A[14], aC = A[15];
|
|
834
|
+
return Math.abs(I - f) <= AA * Math.max(1, Math.abs(I), Math.abs(f)) && Math.abs(g - d) <= AA * Math.max(1, Math.abs(g), Math.abs(d)) && Math.abs(B - R) <= AA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= AA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= AA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - v) <= AA * Math.max(1, Math.abs(i), Math.abs(v)) && Math.abs(o - $) <= AA * Math.max(1, Math.abs(o), Math.abs($)) && Math.abs(s - iA) <= AA * Math.max(1, Math.abs(s), Math.abs(iA)) && Math.abs(t - gA) <= AA * Math.max(1, Math.abs(t), Math.abs(gA)) && Math.abs(e - oA) <= AA * Math.max(1, Math.abs(e), Math.abs(oA)) && Math.abs(n - fA) <= AA * Math.max(1, Math.abs(n), Math.abs(fA)) && Math.abs(D - KA) <= AA * Math.max(1, Math.abs(D), Math.abs(KA)) && Math.abs(F - sA) <= AA * Math.max(1, Math.abs(F), Math.abs(sA)) && Math.abs(k - tC) <= AA * Math.max(1, Math.abs(k), Math.abs(tC)) && Math.abs(S - eC) <= AA * Math.max(1, Math.abs(S), Math.abs(eC)) && Math.abs(U - aC) <= AA * Math.max(1, Math.abs(U), Math.abs(aC));
|
|
910
835
|
}
|
|
911
836
|
function T() {
|
|
912
837
|
var C = new DA(3);
|
|
@@ -920,7 +845,7 @@ function UB(C) {
|
|
|
920
845
|
var A = C[0], I = C[1], g = C[2];
|
|
921
846
|
return Math.sqrt(A * A + I * I + g * g);
|
|
922
847
|
}
|
|
923
|
-
function
|
|
848
|
+
function X(C, A, I) {
|
|
924
849
|
var g = new DA(3);
|
|
925
850
|
return g[0] = C, g[1] = A, g[2] = I, g;
|
|
926
851
|
}
|
|
@@ -973,7 +898,7 @@ function si(C) {
|
|
|
973
898
|
}
|
|
974
899
|
function JB(C, A) {
|
|
975
900
|
var I = C[0], g = C[1], B = C[2], Q = A[0], E = A[1], i = A[2];
|
|
976
|
-
return Math.abs(I - Q) <=
|
|
901
|
+
return Math.abs(I - Q) <= AA * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(g - E) <= AA * Math.max(1, Math.abs(g), Math.abs(E)) && Math.abs(B - i) <= AA * Math.max(1, Math.abs(B), Math.abs(i));
|
|
977
902
|
}
|
|
978
903
|
var iB = lB, ti = UB;
|
|
979
904
|
(function() {
|
|
@@ -1035,7 +960,7 @@ function hi(C, A, I) {
|
|
|
1035
960
|
}
|
|
1036
961
|
function Wg(C, A, I, g) {
|
|
1037
962
|
var B = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], s = I[1], t = I[2], e = I[3], n, D, F, k, S;
|
|
1038
|
-
return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D >
|
|
963
|
+
return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D > AA ? (n = Math.acos(D), F = Math.sin(n), k = Math.sin((1 - g) * n) / F, S = Math.sin(g * n) / F) : (k = 1 - g, S = g), C[0] = k * B + S * o, C[1] = k * Q + S * s, C[2] = k * E + S * t, C[3] = k * i + S * e, C;
|
|
1039
964
|
}
|
|
1040
965
|
function YB(C, A) {
|
|
1041
966
|
var I = A[0] + A[4] + A[8], g;
|
|
@@ -1051,7 +976,7 @@ function YB(C, A) {
|
|
|
1051
976
|
}
|
|
1052
977
|
var yi = ei, ci = ai, ug = ri;
|
|
1053
978
|
(function() {
|
|
1054
|
-
var C = T(), A =
|
|
979
|
+
var C = T(), A = X(1, 0, 0), I = X(0, 1, 0);
|
|
1055
980
|
return function(g, B, Q) {
|
|
1056
981
|
var E = sg(B, Q);
|
|
1057
982
|
return E < -0.999999 ? (Bg(C, A, B), ti(C) < 1e-6 && Bg(C, I, B), MQ(C, C), Di(g, C, Math.PI), g) : E > 0.999999 ? (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 1, g) : (Bg(C, B, Q), g[0] = C[0], g[1] = C[1], g[2] = C[2], g[3] = 1 + E, ug(g, g));
|
|
@@ -1098,7 +1023,7 @@ function cC(C, A) {
|
|
|
1098
1023
|
}
|
|
1099
1024
|
function vg(C, A) {
|
|
1100
1025
|
var I = C[0], g = C[1], B = A[0], Q = A[1];
|
|
1101
|
-
return Math.abs(I - B) <=
|
|
1026
|
+
return Math.abs(I - B) <= AA * Math.max(1, Math.abs(I), Math.abs(B)) && Math.abs(g - Q) <= AA * Math.max(1, Math.abs(g), Math.abs(Q));
|
|
1102
1027
|
}
|
|
1103
1028
|
(function() {
|
|
1104
1029
|
var C = fQ();
|
|
@@ -1119,7 +1044,7 @@ class gI {
|
|
|
1119
1044
|
* the first element, and avoids biasing toward (0,0,0).
|
|
1120
1045
|
*/
|
|
1121
1046
|
constructor(A, I) {
|
|
1122
|
-
this.min = A ? xA(A) :
|
|
1047
|
+
this.min = A ? xA(A) : X(1 / 0, 1 / 0, 1 / 0), this.max = I ? xA(I) : X(-1 / 0, -1 / 0, -1 / 0);
|
|
1123
1048
|
}
|
|
1124
1049
|
clone() {
|
|
1125
1050
|
return new gI(this.min, this.max);
|
|
@@ -1136,16 +1061,16 @@ class gI {
|
|
|
1136
1061
|
}
|
|
1137
1062
|
applyTransform(A) {
|
|
1138
1063
|
const { min: I, max: g } = this, B = [
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1064
|
+
X(I[0], I[1], I[2]),
|
|
1065
|
+
X(I[0], I[1], g[2]),
|
|
1066
|
+
X(I[0], g[1], I[2]),
|
|
1067
|
+
X(I[0], g[1], g[2]),
|
|
1068
|
+
X(g[0], I[1], I[2]),
|
|
1069
|
+
X(g[0], I[1], g[2]),
|
|
1070
|
+
X(g[0], g[1], I[2]),
|
|
1071
|
+
X(g[0], g[1], g[2])
|
|
1147
1072
|
];
|
|
1148
|
-
this.min =
|
|
1073
|
+
this.min = X(1 / 0, 1 / 0, 1 / 0), this.max = X(-1 / 0, -1 / 0, -1 / 0);
|
|
1149
1074
|
const Q = T();
|
|
1150
1075
|
for (const E of B)
|
|
1151
1076
|
LB(Q, E, A), this.expandWithPoint(Q);
|
|
@@ -1906,7 +1831,7 @@ class wC extends lQ {
|
|
|
1906
1831
|
);
|
|
1907
1832
|
B.setUniform(
|
|
1908
1833
|
F,
|
|
1909
|
-
|
|
1834
|
+
X(
|
|
1910
1835
|
U[0],
|
|
1911
1836
|
U[1],
|
|
1912
1837
|
U[2]
|
|
@@ -1948,7 +1873,7 @@ class wC extends lQ {
|
|
|
1948
1873
|
this.state_.setViewport(g);
|
|
1949
1874
|
}
|
|
1950
1875
|
clear() {
|
|
1951
|
-
this.gl_.clearColor(
|
|
1876
|
+
this.gl_.clearColor(0, 0, 0, 0), this.gl_.clear(this.gl_.COLOR_BUFFER_BIT | this.gl_.DEPTH_BUFFER_BIT), this.state_.setDepthTesting(!0), this.gl_.depthFunc(this.gl_.LEQUAL);
|
|
1952
1877
|
}
|
|
1953
1878
|
}
|
|
1954
1879
|
const li = 16;
|
|
@@ -6300,10 +6225,10 @@ class BA extends Do {
|
|
|
6300
6225
|
const R = FA[U.name][0], L = FA[U.name][1], M = FA[d.name][0];
|
|
6301
6226
|
if (R !== FA[d.name][1]) return null;
|
|
6302
6227
|
const v = new Array(M * L);
|
|
6303
|
-
for (let
|
|
6228
|
+
for (let $ = 0; $ < L; $++) for (let iA = 0; iA < M; iA++) {
|
|
6304
6229
|
let gA = 0;
|
|
6305
|
-
for (let oA = 0; oA < R; oA++) gA += S[oA * L +
|
|
6306
|
-
v[
|
|
6230
|
+
for (let oA = 0; oA < R; oA++) gA += S[oA * L + $] * f[iA * R + oA];
|
|
6231
|
+
v[$ * M + iA] = gA;
|
|
6307
6232
|
}
|
|
6308
6233
|
return v;
|
|
6309
6234
|
})(t, g.typeInfo, e, B.typeInfo);
|
|
@@ -8591,12 +8516,7 @@ class Wo extends lQ {
|
|
|
8591
8516
|
resolveTarget: this.context_.getCurrentTexture().createView(),
|
|
8592
8517
|
loadOp: I,
|
|
8593
8518
|
storeOp: "store",
|
|
8594
|
-
clearValue: {
|
|
8595
|
-
r: this.backgroundColor.r,
|
|
8596
|
-
g: this.backgroundColor.g,
|
|
8597
|
-
b: this.backgroundColor.b,
|
|
8598
|
-
a: this.backgroundColor.a
|
|
8599
|
-
}
|
|
8519
|
+
clearValue: { r: 0, g: 0, b: 0, a: 0 }
|
|
8600
8520
|
}
|
|
8601
8521
|
],
|
|
8602
8522
|
depthStencilAttachment: {
|
|
@@ -8889,17 +8809,17 @@ class Xo {
|
|
|
8889
8809
|
D,
|
|
8890
8810
|
k,
|
|
8891
8811
|
(R, L) => {
|
|
8892
|
-
const M = gI.intersects(L, n), v = f && !M,
|
|
8812
|
+
const M = gI.intersects(L, n), v = f && !M, $ = this.computePriority(
|
|
8893
8813
|
d,
|
|
8894
8814
|
f,
|
|
8895
8815
|
M,
|
|
8896
8816
|
v,
|
|
8897
8817
|
!0
|
|
8898
8818
|
);
|
|
8899
|
-
|
|
8819
|
+
$ !== null && this.chunkViewStates_.set(R, {
|
|
8900
8820
|
visible: M,
|
|
8901
8821
|
prefetch: v,
|
|
8902
|
-
priority:
|
|
8822
|
+
priority: $,
|
|
8903
8823
|
orderKey: this.squareDistance2D(R, e)
|
|
8904
8824
|
});
|
|
8905
8825
|
}
|
|
@@ -9074,8 +8994,8 @@ class Xo {
|
|
|
9074
8994
|
}
|
|
9075
8995
|
getChunkAabb(A) {
|
|
9076
8996
|
return new gI(
|
|
9077
|
-
|
|
9078
|
-
|
|
8997
|
+
X(A.offset.x, A.offset.y, A.offset.z),
|
|
8998
|
+
X(
|
|
9079
8999
|
A.offset.x + A.shape.x * A.scale.x,
|
|
9080
9000
|
A.offset.y + A.shape.y * A.scale.y,
|
|
9081
9001
|
A.offset.z + A.shape.z * A.scale.z
|
|
@@ -9165,7 +9085,7 @@ class jo {
|
|
|
9165
9085
|
const L = o !== void 0 ? o.translation + R * e * o.scale : 0, M = new Array(D);
|
|
9166
9086
|
d[R] = M;
|
|
9167
9087
|
for (let v = 0; v < D; ++v) {
|
|
9168
|
-
const
|
|
9088
|
+
const $ = i.translation + v * t * i.scale, iA = new Array(n);
|
|
9169
9089
|
M[v] = iA;
|
|
9170
9090
|
for (let gA = 0; gA < n; ++gA) {
|
|
9171
9091
|
const oA = E.translation + gA * s * E.scale;
|
|
@@ -9191,7 +9111,7 @@ class jo {
|
|
|
9191
9111
|
},
|
|
9192
9112
|
offset: {
|
|
9193
9113
|
x: oA,
|
|
9194
|
-
y:
|
|
9114
|
+
y: $,
|
|
9195
9115
|
z: L
|
|
9196
9116
|
}
|
|
9197
9117
|
};
|
|
@@ -9613,7 +9533,7 @@ class is {
|
|
|
9613
9533
|
}
|
|
9614
9534
|
clientToClip(A, I = 0) {
|
|
9615
9535
|
const [g, B] = A, Q = this.element.getBoundingClientRect();
|
|
9616
|
-
return
|
|
9536
|
+
return X(
|
|
9617
9537
|
2 * (g - Q.x) / Q.width - 1,
|
|
9618
9538
|
2 * (B - Q.y) / Q.height - 1,
|
|
9619
9539
|
I
|
|
@@ -9797,7 +9717,7 @@ class tE {
|
|
|
9797
9717
|
return new tE(A, I);
|
|
9798
9718
|
}
|
|
9799
9719
|
constructor(A, I) {
|
|
9800
|
-
this.canvas = A.canvas, this.renderer_ = I ?? new wC(this.canvas)
|
|
9720
|
+
this.canvas = A.canvas, this.renderer_ = I ?? new wC(this.canvas);
|
|
9801
9721
|
const B = (A.memoryLimitMB ?? ts) * 1024 * 1024;
|
|
9802
9722
|
this.chunkManager_ = new As(
|
|
9803
9723
|
(E) => this.renderer_.uploadTexture(E),
|
|
@@ -11470,8 +11390,8 @@ function At(C, A, I, g) {
|
|
|
11470
11390
|
for (let L = 0; L < B.z; L++) {
|
|
11471
11391
|
const M = F + L * f;
|
|
11472
11392
|
for (let v = 0; v < B.y; v++) {
|
|
11473
|
-
const
|
|
11474
|
-
U.set(C.subarray(
|
|
11393
|
+
const $ = M + v * d, iA = $ + B.x;
|
|
11394
|
+
U.set(C.subarray($, iA), R), R += B.x;
|
|
11475
11395
|
}
|
|
11476
11396
|
}
|
|
11477
11397
|
return U;
|
|
@@ -18022,9 +17942,9 @@ var x;
|
|
|
18022
17942
|
(function(C) {
|
|
18023
17943
|
C.ZodString = "ZodString", C.ZodNumber = "ZodNumber", C.ZodNaN = "ZodNaN", C.ZodBigInt = "ZodBigInt", C.ZodBoolean = "ZodBoolean", C.ZodDate = "ZodDate", C.ZodSymbol = "ZodSymbol", C.ZodUndefined = "ZodUndefined", C.ZodNull = "ZodNull", C.ZodAny = "ZodAny", C.ZodUnknown = "ZodUnknown", C.ZodNever = "ZodNever", C.ZodVoid = "ZodVoid", C.ZodArray = "ZodArray", C.ZodObject = "ZodObject", C.ZodUnion = "ZodUnion", C.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", C.ZodIntersection = "ZodIntersection", C.ZodTuple = "ZodTuple", C.ZodRecord = "ZodRecord", C.ZodMap = "ZodMap", C.ZodSet = "ZodSet", C.ZodFunction = "ZodFunction", C.ZodLazy = "ZodLazy", C.ZodLiteral = "ZodLiteral", C.ZodEnum = "ZodEnum", C.ZodEffects = "ZodEffects", C.ZodNativeEnum = "ZodNativeEnum", C.ZodOptional = "ZodOptional", C.ZodNullable = "ZodNullable", C.ZodDefault = "ZodDefault", C.ZodCatch = "ZodCatch", C.ZodPromise = "ZodPromise", C.ZodBranded = "ZodBranded", C.ZodPipeline = "ZodPipeline", C.ZodReadonly = "ZodReadonly";
|
|
18024
17944
|
})(x || (x = {}));
|
|
18025
|
-
const
|
|
17945
|
+
const z = VA.create, W = GI.create, RE = cB.create, _A = wB.create;
|
|
18026
17946
|
$A.create;
|
|
18027
|
-
const
|
|
17947
|
+
const j = TA.create, q = nA.create;
|
|
18028
17948
|
lg.create;
|
|
18029
17949
|
Lg.create;
|
|
18030
17950
|
iI.create;
|
|
@@ -18034,22 +17954,22 @@ jA.create;
|
|
|
18034
17954
|
NI.create;
|
|
18035
17955
|
const Tt = q({
|
|
18036
17956
|
/**The multiscale datasets for this image*/
|
|
18037
|
-
multiscales:
|
|
17957
|
+
multiscales: j(
|
|
18038
17958
|
q({
|
|
18039
|
-
name:
|
|
18040
|
-
datasets:
|
|
17959
|
+
name: z().optional(),
|
|
17960
|
+
datasets: j(
|
|
18041
17961
|
q({
|
|
18042
|
-
path:
|
|
18043
|
-
coordinateTransformations:
|
|
17962
|
+
path: z(),
|
|
17963
|
+
coordinateTransformations: j(
|
|
18044
17964
|
_A().superRefine((C, A) => {
|
|
18045
17965
|
const I = [
|
|
18046
17966
|
q({
|
|
18047
17967
|
type: cA("scale"),
|
|
18048
|
-
scale:
|
|
17968
|
+
scale: j(W()).min(2)
|
|
18049
17969
|
}),
|
|
18050
17970
|
q({
|
|
18051
17971
|
type: cA("translation"),
|
|
18052
|
-
translation:
|
|
17972
|
+
translation: j(W()).min(2)
|
|
18053
17973
|
})
|
|
18054
17974
|
], g = I.reduce(
|
|
18055
17975
|
(B, Q) => ((E) => E.error ? [...B, E.error] : B)(
|
|
@@ -18068,15 +17988,15 @@ const Tt = q({
|
|
|
18068
17988
|
})
|
|
18069
17989
|
).min(1),
|
|
18070
17990
|
version: cA("0.4").optional(),
|
|
18071
|
-
axes:
|
|
17991
|
+
axes: j(
|
|
18072
17992
|
_A().superRefine((C, A) => {
|
|
18073
17993
|
const I = [
|
|
18074
17994
|
q({
|
|
18075
|
-
name:
|
|
17995
|
+
name: z(),
|
|
18076
17996
|
type: nI(["channel", "time", "space"])
|
|
18077
17997
|
}),
|
|
18078
17998
|
q({
|
|
18079
|
-
name:
|
|
17999
|
+
name: z(),
|
|
18080
18000
|
type: _A().refine(
|
|
18081
18001
|
(B) => !nI(["space", "time", "channel"]).safeParse(B).success,
|
|
18082
18002
|
"Invalid input: Should NOT be valid against schema"
|
|
@@ -18096,16 +18016,16 @@ const Tt = q({
|
|
|
18096
18016
|
});
|
|
18097
18017
|
})
|
|
18098
18018
|
).min(2).max(5),
|
|
18099
|
-
coordinateTransformations:
|
|
18019
|
+
coordinateTransformations: j(
|
|
18100
18020
|
_A().superRefine((C, A) => {
|
|
18101
18021
|
const I = [
|
|
18102
18022
|
q({
|
|
18103
18023
|
type: cA("scale"),
|
|
18104
|
-
scale:
|
|
18024
|
+
scale: j(W()).min(2)
|
|
18105
18025
|
}),
|
|
18106
18026
|
q({
|
|
18107
18027
|
type: cA("translation"),
|
|
18108
|
-
translation:
|
|
18028
|
+
translation: j(W()).min(2)
|
|
18109
18029
|
}),
|
|
18110
18030
|
// The JSON schema and my reading of the spec is that while
|
|
18111
18031
|
// identity is a valid transformation, it cannot be used here.
|
|
@@ -18134,7 +18054,7 @@ const Tt = q({
|
|
|
18134
18054
|
})
|
|
18135
18055
|
).min(1).describe("The multiscale datasets for this image"),
|
|
18136
18056
|
omero: q({
|
|
18137
|
-
channels:
|
|
18057
|
+
channels: j(
|
|
18138
18058
|
q({
|
|
18139
18059
|
window: q({
|
|
18140
18060
|
end: W(),
|
|
@@ -18142,9 +18062,9 @@ const Tt = q({
|
|
|
18142
18062
|
min: W(),
|
|
18143
18063
|
start: W()
|
|
18144
18064
|
}),
|
|
18145
|
-
label:
|
|
18146
|
-
family:
|
|
18147
|
-
color:
|
|
18065
|
+
label: z().optional(),
|
|
18066
|
+
family: z().optional(),
|
|
18067
|
+
color: z(),
|
|
18148
18068
|
active: RE().optional()
|
|
18149
18069
|
})
|
|
18150
18070
|
),
|
|
@@ -18157,13 +18077,13 @@ const Tt = q({
|
|
|
18157
18077
|
defaultT: W().optional(),
|
|
18158
18078
|
defaultZ: W().optional(),
|
|
18159
18079
|
color: nI(["color", "greyscale"]).optional(),
|
|
18160
|
-
projection:
|
|
18080
|
+
projection: z().optional()
|
|
18161
18081
|
}).optional()
|
|
18162
18082
|
}).optional()
|
|
18163
18083
|
}).describe("JSON from OME-NGFF .zattrs"), bt = q({
|
|
18164
18084
|
plate: q({
|
|
18165
18085
|
/**The acquisitions for this plate*/
|
|
18166
|
-
acquisitions:
|
|
18086
|
+
acquisitions: j(
|
|
18167
18087
|
q({
|
|
18168
18088
|
/**A unique identifier within the context of the plate*/
|
|
18169
18089
|
id: W().int().gte(0).describe(
|
|
@@ -18174,9 +18094,9 @@ const Tt = q({
|
|
|
18174
18094
|
"The maximum number of fields of view for the acquisition"
|
|
18175
18095
|
).optional(),
|
|
18176
18096
|
/**The name of the acquisition*/
|
|
18177
|
-
name:
|
|
18097
|
+
name: z().describe("The name of the acquisition").optional(),
|
|
18178
18098
|
/**The description of the acquisition*/
|
|
18179
|
-
description:
|
|
18099
|
+
description: z().describe("The description of the acquisition").optional(),
|
|
18180
18100
|
/**The start timestamp of the acquisition, expressed as epoch time i.e. the number seconds since the Epoch*/
|
|
18181
18101
|
starttime: W().int().gte(0).describe(
|
|
18182
18102
|
"The start timestamp of the acquisition, expressed as epoch time i.e. the number seconds since the Epoch"
|
|
@@ -18192,26 +18112,26 @@ const Tt = q({
|
|
|
18192
18112
|
/**The maximum number of fields per view across all wells*/
|
|
18193
18113
|
field_count: W().int().gt(0).describe("The maximum number of fields per view across all wells").optional(),
|
|
18194
18114
|
/**The name of the plate*/
|
|
18195
|
-
name:
|
|
18115
|
+
name: z().describe("The name of the plate").optional(),
|
|
18196
18116
|
/**The columns of the plate*/
|
|
18197
|
-
columns:
|
|
18117
|
+
columns: j(
|
|
18198
18118
|
q({
|
|
18199
18119
|
/**The column name*/
|
|
18200
|
-
name:
|
|
18120
|
+
name: z().regex(new RegExp("^[A-Za-z0-9]+$")).describe("The column name")
|
|
18201
18121
|
})
|
|
18202
18122
|
).min(1).describe("The columns of the plate"),
|
|
18203
18123
|
/**The rows of the plate*/
|
|
18204
|
-
rows:
|
|
18124
|
+
rows: j(
|
|
18205
18125
|
q({
|
|
18206
18126
|
/**The row name*/
|
|
18207
|
-
name:
|
|
18127
|
+
name: z().regex(new RegExp("^[A-Za-z0-9]+$")).describe("The row name")
|
|
18208
18128
|
})
|
|
18209
18129
|
).min(1).describe("The rows of the plate"),
|
|
18210
18130
|
/**The wells of the plate*/
|
|
18211
|
-
wells:
|
|
18131
|
+
wells: j(
|
|
18212
18132
|
q({
|
|
18213
18133
|
/**The path to the well subgroup*/
|
|
18214
|
-
path:
|
|
18134
|
+
path: z().regex(new RegExp("^[A-Za-z0-9]+/[A-Za-z0-9]+$")).describe("The path to the well subgroup"),
|
|
18215
18135
|
/**The index of the well in the rows list*/
|
|
18216
18136
|
rowIndex: W().int().gte(0).describe("The index of the well in the rows list"),
|
|
18217
18137
|
/**The index of the well in the columns list*/
|
|
@@ -18222,12 +18142,12 @@ const Tt = q({
|
|
|
18222
18142
|
}).describe("JSON from OME-NGFF .zattrs"), Wt = q({
|
|
18223
18143
|
well: q({
|
|
18224
18144
|
/**The fields of view for this well*/
|
|
18225
|
-
images:
|
|
18145
|
+
images: j(
|
|
18226
18146
|
q({
|
|
18227
18147
|
/**A unique identifier within the context of the plate*/
|
|
18228
18148
|
acquisition: W().int().describe("A unique identifier within the context of the plate").optional(),
|
|
18229
18149
|
/**The path for this field of view subgroup*/
|
|
18230
|
-
path:
|
|
18150
|
+
path: z().regex(new RegExp("^[A-Za-z0-9]+$")).describe("The path for this field of view subgroup")
|
|
18231
18151
|
})
|
|
18232
18152
|
).min(1).describe("The fields of view for this well"),
|
|
18233
18153
|
/**The version of the specification*/
|
|
@@ -18237,22 +18157,22 @@ const Tt = q({
|
|
|
18237
18157
|
/**The versioned OME-Zarr Metadata namespace*/
|
|
18238
18158
|
ome: q({
|
|
18239
18159
|
/**The multiscale datasets for this image*/
|
|
18240
|
-
multiscales:
|
|
18160
|
+
multiscales: j(
|
|
18241
18161
|
q({
|
|
18242
|
-
name:
|
|
18243
|
-
datasets:
|
|
18162
|
+
name: z().optional(),
|
|
18163
|
+
datasets: j(
|
|
18244
18164
|
q({
|
|
18245
|
-
path:
|
|
18246
|
-
coordinateTransformations:
|
|
18165
|
+
path: z(),
|
|
18166
|
+
coordinateTransformations: j(
|
|
18247
18167
|
_A().superRefine((C, A) => {
|
|
18248
18168
|
const I = [
|
|
18249
18169
|
q({
|
|
18250
18170
|
type: cA("scale"),
|
|
18251
|
-
scale:
|
|
18171
|
+
scale: j(W()).min(2)
|
|
18252
18172
|
}),
|
|
18253
18173
|
q({
|
|
18254
18174
|
type: cA("translation"),
|
|
18255
|
-
translation:
|
|
18175
|
+
translation: j(W()).min(2)
|
|
18256
18176
|
})
|
|
18257
18177
|
], g = I.reduce(
|
|
18258
18178
|
(B, Q) => ((E) => E.error ? [...B, E.error] : B)(Q.safeParse(C)),
|
|
@@ -18268,15 +18188,15 @@ const Tt = q({
|
|
|
18268
18188
|
).min(1)
|
|
18269
18189
|
})
|
|
18270
18190
|
).min(1),
|
|
18271
|
-
axes:
|
|
18191
|
+
axes: j(
|
|
18272
18192
|
_A().superRefine((C, A) => {
|
|
18273
18193
|
const I = [
|
|
18274
18194
|
q({
|
|
18275
|
-
name:
|
|
18195
|
+
name: z(),
|
|
18276
18196
|
type: nI(["channel", "time", "space"])
|
|
18277
18197
|
}),
|
|
18278
18198
|
q({
|
|
18279
|
-
name:
|
|
18199
|
+
name: z(),
|
|
18280
18200
|
type: _A().refine(
|
|
18281
18201
|
(B) => !nI(["space", "time", "channel"]).safeParse(B).success,
|
|
18282
18202
|
"Invalid input: Should NOT be valid against schema"
|
|
@@ -18296,16 +18216,16 @@ const Tt = q({
|
|
|
18296
18216
|
});
|
|
18297
18217
|
})
|
|
18298
18218
|
).min(2).max(5),
|
|
18299
|
-
coordinateTransformations:
|
|
18219
|
+
coordinateTransformations: j(
|
|
18300
18220
|
_A().superRefine((C, A) => {
|
|
18301
18221
|
const I = [
|
|
18302
18222
|
q({
|
|
18303
18223
|
type: cA("scale"),
|
|
18304
|
-
scale:
|
|
18224
|
+
scale: j(W()).min(2)
|
|
18305
18225
|
}),
|
|
18306
18226
|
q({
|
|
18307
18227
|
type: cA("translation"),
|
|
18308
|
-
translation:
|
|
18228
|
+
translation: j(W()).min(2)
|
|
18309
18229
|
}),
|
|
18310
18230
|
// The JSON schema and my reading of the spec is that while
|
|
18311
18231
|
// identity is a valid transformation, it cannot be used here.
|
|
@@ -18334,7 +18254,7 @@ const Tt = q({
|
|
|
18334
18254
|
})
|
|
18335
18255
|
).min(1).describe("The multiscale datasets for this image"),
|
|
18336
18256
|
omero: q({
|
|
18337
|
-
channels:
|
|
18257
|
+
channels: j(
|
|
18338
18258
|
q({
|
|
18339
18259
|
window: q({
|
|
18340
18260
|
end: W(),
|
|
@@ -18342,9 +18262,9 @@ const Tt = q({
|
|
|
18342
18262
|
min: W(),
|
|
18343
18263
|
start: W()
|
|
18344
18264
|
}).optional(),
|
|
18345
|
-
label:
|
|
18346
|
-
family:
|
|
18347
|
-
color:
|
|
18265
|
+
label: z().optional(),
|
|
18266
|
+
family: z().optional(),
|
|
18267
|
+
color: z().optional(),
|
|
18348
18268
|
active: RE().optional()
|
|
18349
18269
|
})
|
|
18350
18270
|
),
|
|
@@ -18357,7 +18277,7 @@ const Tt = q({
|
|
|
18357
18277
|
defaultT: W().optional(),
|
|
18358
18278
|
defaultZ: W().optional(),
|
|
18359
18279
|
color: nI(["color", "greyscale"]).optional(),
|
|
18360
|
-
projection:
|
|
18280
|
+
projection: z().optional()
|
|
18361
18281
|
}).optional()
|
|
18362
18282
|
}).optional(),
|
|
18363
18283
|
/**The version of the OME-Zarr Metadata*/
|
|
@@ -18368,7 +18288,7 @@ const Tt = q({
|
|
|
18368
18288
|
ome: q({
|
|
18369
18289
|
plate: q({
|
|
18370
18290
|
/**The acquisitions for this plate*/
|
|
18371
|
-
acquisitions:
|
|
18291
|
+
acquisitions: j(
|
|
18372
18292
|
q({
|
|
18373
18293
|
/**A unique identifier within the context of the plate*/
|
|
18374
18294
|
id: W().int().gte(0).describe(
|
|
@@ -18379,9 +18299,9 @@ const Tt = q({
|
|
|
18379
18299
|
"The maximum number of fields of view for the acquisition"
|
|
18380
18300
|
).optional(),
|
|
18381
18301
|
/**The name of the acquisition*/
|
|
18382
|
-
name:
|
|
18302
|
+
name: z().describe("The name of the acquisition").optional(),
|
|
18383
18303
|
/**The description of the acquisition*/
|
|
18384
|
-
description:
|
|
18304
|
+
description: z().describe("The description of the acquisition").optional(),
|
|
18385
18305
|
/**The start timestamp of the acquisition, expressed as epoch time i.e. the number seconds since the Epoch*/
|
|
18386
18306
|
starttime: W().int().gte(0).describe(
|
|
18387
18307
|
"The start timestamp of the acquisition, expressed as epoch time i.e. the number seconds since the Epoch"
|
|
@@ -18395,26 +18315,26 @@ const Tt = q({
|
|
|
18395
18315
|
/**The maximum number of fields per view across all wells*/
|
|
18396
18316
|
field_count: W().int().gt(0).describe("The maximum number of fields per view across all wells").optional(),
|
|
18397
18317
|
/**The name of the plate*/
|
|
18398
|
-
name:
|
|
18318
|
+
name: z().describe("The name of the plate").optional(),
|
|
18399
18319
|
/**The columns of the plate*/
|
|
18400
|
-
columns:
|
|
18320
|
+
columns: j(
|
|
18401
18321
|
q({
|
|
18402
18322
|
/**The column name*/
|
|
18403
|
-
name:
|
|
18323
|
+
name: z().regex(new RegExp("^[A-Za-z0-9]+$")).describe("The column name")
|
|
18404
18324
|
})
|
|
18405
18325
|
).min(1).describe("The columns of the plate"),
|
|
18406
18326
|
/**The rows of the plate*/
|
|
18407
|
-
rows:
|
|
18327
|
+
rows: j(
|
|
18408
18328
|
q({
|
|
18409
18329
|
/**The row name*/
|
|
18410
|
-
name:
|
|
18330
|
+
name: z().regex(new RegExp("^[A-Za-z0-9]+$")).describe("The row name")
|
|
18411
18331
|
})
|
|
18412
18332
|
).min(1).describe("The rows of the plate"),
|
|
18413
18333
|
/**The wells of the plate*/
|
|
18414
|
-
wells:
|
|
18334
|
+
wells: j(
|
|
18415
18335
|
q({
|
|
18416
18336
|
/**The path to the well subgroup*/
|
|
18417
|
-
path:
|
|
18337
|
+
path: z().regex(new RegExp("^[A-Za-z0-9]+/[A-Za-z0-9]+$")).describe("The path to the well subgroup"),
|
|
18418
18338
|
/**The index of the well in the rows list*/
|
|
18419
18339
|
rowIndex: W().int().gte(0).describe("The index of the well in the rows list"),
|
|
18420
18340
|
/**The index of the well in the columns list*/
|
|
@@ -18430,14 +18350,14 @@ const Tt = q({
|
|
|
18430
18350
|
ome: q({
|
|
18431
18351
|
well: q({
|
|
18432
18352
|
/**The fields of view for this well*/
|
|
18433
|
-
images:
|
|
18353
|
+
images: j(
|
|
18434
18354
|
q({
|
|
18435
18355
|
/**A unique identifier within the context of the plate*/
|
|
18436
18356
|
acquisition: W().int().describe(
|
|
18437
18357
|
"A unique identifier within the context of the plate"
|
|
18438
18358
|
).optional(),
|
|
18439
18359
|
/**The path for this field of view subgroup*/
|
|
18440
|
-
path:
|
|
18360
|
+
path: z().regex(new RegExp("^[A-Za-z0-9]+$")).describe("The path for this field of view subgroup")
|
|
18441
18361
|
})
|
|
18442
18362
|
).min(1).describe("The fields of view for this well")
|
|
18443
18363
|
}),
|
|
@@ -18791,13 +18711,13 @@ class Be extends kI {
|
|
|
18791
18711
|
this.indexData_ = new Uint32Array(g);
|
|
18792
18712
|
}
|
|
18793
18713
|
}
|
|
18794
|
-
const Ce =
|
|
18714
|
+
const Ce = X(0, 1, 0);
|
|
18795
18715
|
class Qe {
|
|
18796
18716
|
dirty_ = !0;
|
|
18797
18717
|
matrix_ = GA();
|
|
18798
18718
|
rotation_ = eg();
|
|
18799
18719
|
translation_ = T();
|
|
18800
|
-
scale_ =
|
|
18720
|
+
scale_ = X(1, 1, 1);
|
|
18801
18721
|
addRotation(A) {
|
|
18802
18722
|
hi(this.rotation_, this.rotation_, A), this.dirty_ = !0;
|
|
18803
18723
|
}
|
|
@@ -18823,7 +18743,7 @@ class Qe {
|
|
|
18823
18743
|
QB(this.scale_, A), this.dirty_ = !0;
|
|
18824
18744
|
}
|
|
18825
18745
|
targetTo(A) {
|
|
18826
|
-
JB(this.translation_, A) && (A = xA(A), A[2] +=
|
|
18746
|
+
JB(this.translation_, A) && (A = xA(A), A[2] += AA);
|
|
18827
18747
|
const I = Ei(GA(), this.translation_, A, Ce), g = jE(JQ(), I);
|
|
18828
18748
|
YB(this.rotation_, g), ug(this.rotation_, this.rotation_), this.dirty_ = !0;
|
|
18829
18749
|
}
|
|
@@ -18845,9 +18765,77 @@ class Qe {
|
|
|
18845
18765
|
);
|
|
18846
18766
|
}
|
|
18847
18767
|
}
|
|
18768
|
+
class IA {
|
|
18769
|
+
static RED = new IA(1, 0, 0);
|
|
18770
|
+
static GREEN = new IA(0, 1, 0);
|
|
18771
|
+
static BLUE = new IA(0, 0, 1);
|
|
18772
|
+
static YELLOW = new IA(1, 1, 0);
|
|
18773
|
+
static MAGENTA = new IA(1, 0, 1);
|
|
18774
|
+
static CYAN = new IA(0, 1, 1);
|
|
18775
|
+
static BLACK = new IA(0, 0, 0);
|
|
18776
|
+
static WHITE = new IA(1, 1, 1);
|
|
18777
|
+
static TRANSPARENT = new IA(0, 0, 0, 0);
|
|
18778
|
+
// RGBA color values in the range [0, 1]
|
|
18779
|
+
rgba_;
|
|
18780
|
+
constructor(A, I, g, B) {
|
|
18781
|
+
if (A < 0 || A > 1 || I < 0 || I > 1 || g < 0 || g > 1)
|
|
18782
|
+
throw new Error("RGB values must be in the range [0, 1]");
|
|
18783
|
+
if (B !== void 0 && (B < 0 || B > 1))
|
|
18784
|
+
throw new Error("Alpha value must be in the range [0, 1]");
|
|
18785
|
+
this.rgba_ = [A, I, g, B ?? 1];
|
|
18786
|
+
}
|
|
18787
|
+
get rgb() {
|
|
18788
|
+
return [this.rgba_[0], this.rgba_[1], this.rgba_[2]];
|
|
18789
|
+
}
|
|
18790
|
+
get rgba() {
|
|
18791
|
+
return this.rgba_;
|
|
18792
|
+
}
|
|
18793
|
+
get r() {
|
|
18794
|
+
return this.rgba_[0];
|
|
18795
|
+
}
|
|
18796
|
+
get g() {
|
|
18797
|
+
return this.rgba_[1];
|
|
18798
|
+
}
|
|
18799
|
+
get b() {
|
|
18800
|
+
return this.rgba_[2];
|
|
18801
|
+
}
|
|
18802
|
+
get a() {
|
|
18803
|
+
return this.rgba_[3];
|
|
18804
|
+
}
|
|
18805
|
+
get rgbHex() {
|
|
18806
|
+
return `#${this.toHexComponent(this.r)}${this.toHexComponent(this.g)}${this.toHexComponent(this.b)}`;
|
|
18807
|
+
}
|
|
18808
|
+
get packed() {
|
|
18809
|
+
return Math.round(this.r * 255) << 24 | Math.round(this.g * 255) << 16 | Math.round(this.b * 255) << 8 | Math.round(this.a * 255);
|
|
18810
|
+
}
|
|
18811
|
+
static from(A) {
|
|
18812
|
+
if (A instanceof IA)
|
|
18813
|
+
return A;
|
|
18814
|
+
if (Array.isArray(A))
|
|
18815
|
+
return new IA(A[0], A[1], A[2], A[3]);
|
|
18816
|
+
if (typeof A == "string")
|
|
18817
|
+
return IA.fromRgbHex(A);
|
|
18818
|
+
throw new Error("Unsupported color format");
|
|
18819
|
+
}
|
|
18820
|
+
static fromRgbHex(A) {
|
|
18821
|
+
const I = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);
|
|
18822
|
+
if (!I)
|
|
18823
|
+
throw new Error("Invalid RGB hex, use form '#RRGGBB'");
|
|
18824
|
+
return new IA(
|
|
18825
|
+
parseInt(I[1], 16) / 255,
|
|
18826
|
+
parseInt(I[2], 16) / 255,
|
|
18827
|
+
parseInt(I[3], 16) / 255,
|
|
18828
|
+
1
|
|
18829
|
+
);
|
|
18830
|
+
}
|
|
18831
|
+
toHexComponent(A) {
|
|
18832
|
+
const I = Math.round(A * 255).toString(16).padStart(2, "0");
|
|
18833
|
+
return I.length === 1 ? "0" + I : I;
|
|
18834
|
+
}
|
|
18835
|
+
}
|
|
18848
18836
|
class LI extends dB {
|
|
18849
18837
|
wireframeEnabled = !1;
|
|
18850
|
-
wireframeColor =
|
|
18838
|
+
wireframeColor = IA.WHITE;
|
|
18851
18839
|
depthTest = !0;
|
|
18852
18840
|
textures_ = [];
|
|
18853
18841
|
staleTextures_ = [];
|
|
@@ -18912,7 +18900,7 @@ class Ee extends LI {
|
|
|
18912
18900
|
color_;
|
|
18913
18901
|
width_;
|
|
18914
18902
|
constructor({ geometry: A, color: I, width: g }) {
|
|
18915
|
-
super(), this.geometry = A, this.color_ =
|
|
18903
|
+
super(), this.geometry = A, this.color_ = IA.from(I), this.width_ = g, this.programName = "projectedLine";
|
|
18916
18904
|
}
|
|
18917
18905
|
get type() {
|
|
18918
18906
|
return "ProjectedLine";
|
|
@@ -18921,7 +18909,7 @@ class Ee extends LI {
|
|
|
18921
18909
|
return this.color_;
|
|
18922
18910
|
}
|
|
18923
18911
|
set color(A) {
|
|
18924
|
-
this.color_ =
|
|
18912
|
+
this.color_ = IA.from(A);
|
|
18925
18913
|
}
|
|
18926
18914
|
get width() {
|
|
18927
18915
|
return this.width_;
|
|
@@ -18974,7 +18962,7 @@ function IB(C) {
|
|
|
18974
18962
|
}
|
|
18975
18963
|
const wQ = 32;
|
|
18976
18964
|
function OI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
18977
|
-
return A ??= !0, I = I === void 0 ?
|
|
18965
|
+
return A ??= !0, I = I === void 0 ? IA.WHITE : IA.from(I), B = B === void 0 ? 1 : vA(B, 0, 1), C !== null ? g = ie(g, C) : g === void 0 && (H.debug(
|
|
18978
18966
|
"Channel",
|
|
18979
18967
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
18980
18968
|
), g = [0, 1]), {
|
|
@@ -19086,7 +19074,7 @@ function se(C) {
|
|
|
19086
19074
|
class pA {
|
|
19087
19075
|
normal;
|
|
19088
19076
|
signedDistance;
|
|
19089
|
-
constructor(A =
|
|
19077
|
+
constructor(A = X(0, 1, 0), I = 0) {
|
|
19090
19078
|
this.normal = xA(A), this.signedDistance = I;
|
|
19091
19079
|
}
|
|
19092
19080
|
static fromPointAndNormal(A, I) {
|
|
@@ -19169,10 +19157,10 @@ class LE extends pg {
|
|
|
19169
19157
|
lastPresentationTimeStamp_;
|
|
19170
19158
|
lastPresentationTimeCoord_;
|
|
19171
19159
|
wireframeColors_ = [
|
|
19172
|
-
new
|
|
19173
|
-
new
|
|
19174
|
-
new
|
|
19175
|
-
new
|
|
19160
|
+
new IA(0.6, 0.3, 0.3),
|
|
19161
|
+
new IA(0.3, 0.6, 0.4),
|
|
19162
|
+
new IA(0.4, 0.4, 0.7),
|
|
19163
|
+
new IA(0.6, 0.5, 0.3)
|
|
19176
19164
|
];
|
|
19177
19165
|
constructor({
|
|
19178
19166
|
source: A,
|
|
@@ -19264,7 +19252,7 @@ class LE extends pg {
|
|
|
19264
19252
|
if (I.done) return null;
|
|
19265
19253
|
const g = I.value.transform, B = uQ(
|
|
19266
19254
|
T(),
|
|
19267
|
-
|
|
19255
|
+
X(0, 0, 1),
|
|
19268
19256
|
g.rotation
|
|
19269
19257
|
), Q = pA.fromPointAndNormal(g.translation, B), E = A.intersectWithPlane(Q);
|
|
19270
19258
|
if (!E) return null;
|
|
@@ -19414,12 +19402,12 @@ class te extends kI {
|
|
|
19414
19402
|
const F = E / s, k = i / t, S = E / 2, U = i / 2, f = o / 2 * e, d = s + 1, R = t + 1, L = n.length / 8;
|
|
19415
19403
|
for (let M = 0; M < R; M++) {
|
|
19416
19404
|
const v = -U + M * k;
|
|
19417
|
-
for (let
|
|
19418
|
-
const iA = -S +
|
|
19405
|
+
for (let $ = 0; $ < d; $++) {
|
|
19406
|
+
const iA = -S + $ * F, gA = { x: 0, y: 0, z: 0 };
|
|
19419
19407
|
gA[A] = iA * B, gA[I] = v * Q, gA[g] = f;
|
|
19420
19408
|
const oA = { x: 0, y: 0, z: 0 };
|
|
19421
19409
|
oA[g] = e;
|
|
19422
|
-
const fA =
|
|
19410
|
+
const fA = $ / s, KA = 1 - M / t;
|
|
19423
19411
|
n.push(
|
|
19424
19412
|
gA.x,
|
|
19425
19413
|
gA.y,
|
|
@@ -19434,13 +19422,13 @@ class te extends kI {
|
|
|
19434
19422
|
}
|
|
19435
19423
|
for (let M = 0; M < t; M++)
|
|
19436
19424
|
for (let v = 0; v < s; v++) {
|
|
19437
|
-
const
|
|
19438
|
-
D.push(
|
|
19425
|
+
const $ = L + v + d * M, iA = L + v + d * (M + 1), gA = L + (v + 1) + d * (M + 1), oA = L + (v + 1) + d * M;
|
|
19426
|
+
D.push($, iA, oA, iA, gA, oA);
|
|
19439
19427
|
}
|
|
19440
19428
|
}
|
|
19441
19429
|
}
|
|
19442
19430
|
class ee extends LI {
|
|
19443
|
-
voxelScale =
|
|
19431
|
+
voxelScale = X(1, 1, 1);
|
|
19444
19432
|
channels_;
|
|
19445
19433
|
loadedChannels_ = /* @__PURE__ */ new Set();
|
|
19446
19434
|
channelToTextureIndex_ = /* @__PURE__ */ new Map();
|
|
@@ -19803,7 +19791,7 @@ class Fe extends LI {
|
|
|
19803
19791
|
return g.dataFormat = "rgba", g;
|
|
19804
19792
|
}
|
|
19805
19793
|
makeColorLookupTableTexture(A) {
|
|
19806
|
-
A === void 0 ? A = /* @__PURE__ */ new Map([[0,
|
|
19794
|
+
A === void 0 ? A = /* @__PURE__ */ new Map([[0, IA.TRANSPARENT]]) : A.has(0) || (A = new Map([[0, IA.TRANSPARENT], ...A]));
|
|
19807
19795
|
const I = Array.from(A.keys()), g = Array.from(A.values()).map((E) => E.packed), B = A.size, Q = new Uint32Array(B * 2);
|
|
19808
19796
|
return Q.set(I, 0), Q.set(g, B), new GQ(Q, B, 2);
|
|
19809
19797
|
}
|
|
@@ -19820,12 +19808,12 @@ function Ne(C) {
|
|
|
19820
19808
|
return C = C ?? /* @__PURE__ */ new Map(), new Map(
|
|
19821
19809
|
Array.from(C.entries()).map(([A, I]) => [
|
|
19822
19810
|
A,
|
|
19823
|
-
|
|
19811
|
+
IA.from(I)
|
|
19824
19812
|
])
|
|
19825
19813
|
);
|
|
19826
19814
|
}
|
|
19827
19815
|
function Re(C) {
|
|
19828
|
-
return C = C ?? Se, C.map(
|
|
19816
|
+
return C = C ?? Se, C.map(IA.from);
|
|
19829
19817
|
}
|
|
19830
19818
|
class FQ {
|
|
19831
19819
|
lookupTable;
|
|
@@ -19942,7 +19930,7 @@ class YE extends pg {
|
|
|
19942
19930
|
if (I.done) return null;
|
|
19943
19931
|
const g = I.value.transform, B = uQ(
|
|
19944
19932
|
T(),
|
|
19945
|
-
|
|
19933
|
+
X(0, 0, 1),
|
|
19946
19934
|
g.rotation
|
|
19947
19935
|
), Q = pA.fromPointAndNormal(g.translation, B), E = A.intersectWithPlane(Q);
|
|
19948
19936
|
if (!E) return null;
|
|
@@ -20075,7 +20063,7 @@ class Pe extends LI {
|
|
|
20075
20063
|
constructor(A) {
|
|
20076
20064
|
super(), this.programName = "points";
|
|
20077
20065
|
const I = A.flatMap((B) => {
|
|
20078
|
-
const Q =
|
|
20066
|
+
const Q = IA.from(B.color);
|
|
20079
20067
|
return [
|
|
20080
20068
|
B.position[0],
|
|
20081
20069
|
B.position[1],
|
|
@@ -20149,7 +20137,7 @@ class SQ {
|
|
|
20149
20137
|
}
|
|
20150
20138
|
toVec3() {
|
|
20151
20139
|
const A = Math.cos(this.theta);
|
|
20152
|
-
return
|
|
20140
|
+
return X(
|
|
20153
20141
|
this.radius * Math.sin(this.phi) * A,
|
|
20154
20142
|
-this.radius * Math.sin(this.theta),
|
|
20155
20143
|
this.radius * Math.cos(this.phi) * A
|
|
@@ -20197,10 +20185,10 @@ class Oe {
|
|
|
20197
20185
|
}
|
|
20198
20186
|
}
|
|
20199
20187
|
onUpdate(A) {
|
|
20200
|
-
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && JB(this.panVelocity_,
|
|
20188
|
+
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && JB(this.panVelocity_, X(0, 0, 0)))
|
|
20201
20189
|
return;
|
|
20202
20190
|
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, rI(this.currCenter_, this.currCenter_, this.panVelocity_);
|
|
20203
|
-
const I = Math.PI / 2 -
|
|
20191
|
+
const I = Math.PI / 2 - AA;
|
|
20204
20192
|
this.currPos_.theta = vA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
|
|
20205
20193
|
const g = Math.pow(1 - this.dampingFactor_, A * Me);
|
|
20206
20194
|
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g, TI(this.panVelocity_, this.panVelocity_, g), this.cutoffLowVelocity();
|
|
@@ -20240,7 +20228,7 @@ class Oe {
|
|
|
20240
20228
|
this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
|
|
20241
20229
|
}
|
|
20242
20230
|
cutoffLowVelocity() {
|
|
20243
|
-
Math.abs(this.orbitVelocity_.phi) <
|
|
20231
|
+
Math.abs(this.orbitVelocity_.phi) < AA && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < AA && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < AA && (this.orbitVelocity_.radius = 0), UB(this.panVelocity_) < AA && si(this.panVelocity_);
|
|
20244
20232
|
}
|
|
20245
20233
|
}
|
|
20246
20234
|
class ue {
|
|
@@ -20304,11 +20292,11 @@ class uE extends LI {
|
|
|
20304
20292
|
}
|
|
20305
20293
|
get right() {
|
|
20306
20294
|
const A = this.transform.matrix;
|
|
20307
|
-
return
|
|
20295
|
+
return X(A[0], A[1], A[2]);
|
|
20308
20296
|
}
|
|
20309
20297
|
get up() {
|
|
20310
20298
|
const A = this.transform.matrix;
|
|
20311
|
-
return
|
|
20299
|
+
return X(A[4], A[5], A[6]);
|
|
20312
20300
|
}
|
|
20313
20301
|
getViewProjection() {
|
|
20314
20302
|
return aI(GA(), this.projectionMatrix, this.viewMatrix);
|
|
@@ -20337,7 +20325,7 @@ class uE extends LI {
|
|
|
20337
20325
|
B,
|
|
20338
20326
|
this.transform.matrix
|
|
20339
20327
|
);
|
|
20340
|
-
return
|
|
20328
|
+
return X(Q[0], Q[1], Q[2]);
|
|
20341
20329
|
}
|
|
20342
20330
|
}
|
|
20343
20331
|
const fE = 1.77, kQ = 128, dQ = 128 / fE, fe = -1e6, Ke = 1e6;
|
|
@@ -20486,7 +20474,7 @@ class Xe extends uE {
|
|
|
20486
20474
|
aspectRatio: g = qe,
|
|
20487
20475
|
near: B = 0.1,
|
|
20488
20476
|
far: Q = 1e4,
|
|
20489
|
-
position: E =
|
|
20477
|
+
position: E = X(0, 0, 0)
|
|
20490
20478
|
} = A;
|
|
20491
20479
|
if (I < og || I > CB)
|
|
20492
20480
|
throw new Error(
|
|
@@ -20613,7 +20601,7 @@ function sC(C, A = {}) {
|
|
|
20613
20601
|
}
|
|
20614
20602
|
export {
|
|
20615
20603
|
ve as AxesLayer,
|
|
20616
|
-
|
|
20604
|
+
IA as Color,
|
|
20617
20605
|
tE as Idetik,
|
|
20618
20606
|
LE as ImageLayer,
|
|
20619
20607
|
oe as ImageRenderable,
|