@antv/l7-renderer 2.9.36 → 2.9.37-alpha.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/package.json +5 -5
- package/es/index.d.ts +0 -5
- package/es/index.js +0 -5
- package/es/regl/ReglAttribute.d.ts +0 -16
- package/es/regl/ReglAttribute.js +0 -51
- package/es/regl/ReglBuffer.d.ts +0 -16
- package/es/regl/ReglBuffer.js +0 -47
- package/es/regl/ReglElements.d.ts +0 -14
- package/es/regl/ReglElements.js +0 -45
- package/es/regl/ReglFramebuffer.d.ts +0 -16
- package/es/regl/ReglFramebuffer.js +0 -59
- package/es/regl/ReglModel.d.ts +0 -49
- package/es/regl/ReglModel.js +0 -362
- package/es/regl/ReglRenderbuffer.d.ts +0 -16
- package/es/regl/ReglRenderbuffer.js +0 -45
- package/es/regl/ReglTexture2D.d.ts +0 -21
- package/es/regl/ReglTexture2D.js +0 -130
- package/es/regl/constants.d.ts +0 -43
- package/es/regl/constants.js +0 -23
- package/es/regl/index.d.ts +0 -51
- package/es/regl/index.js +0 -313
- package/lib/index.js +0 -32
- package/lib/regl/ReglAttribute.js +0 -51
- package/lib/regl/ReglBuffer.js +0 -50
- package/lib/regl/ReglElements.js +0 -49
- package/lib/regl/ReglFramebuffer.js +0 -51
- package/lib/regl/ReglModel.js +0 -269
- package/lib/regl/ReglRenderbuffer.js +0 -46
- package/lib/regl/ReglTexture2D.js +0 -103
- package/lib/regl/constants.js +0 -170
- package/lib/regl/index.js +0 -225
package/lib/regl/ReglModel.js
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/regl/ReglModel.ts
|
|
20
|
-
var ReglModel_exports = {};
|
|
21
|
-
__export(ReglModel_exports, {
|
|
22
|
-
default: () => ReglModel
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(ReglModel_exports);
|
|
25
|
-
var import_l7_core = require("@antv/l7-core");
|
|
26
|
-
var import_lodash = require("lodash");
|
|
27
|
-
var import_constants = require("./constants");
|
|
28
|
-
var ReglModel = class {
|
|
29
|
-
constructor(reGl, options) {
|
|
30
|
-
this.destroyed = false;
|
|
31
|
-
this.uniforms = {};
|
|
32
|
-
this.reGl = reGl;
|
|
33
|
-
const {
|
|
34
|
-
pick = true,
|
|
35
|
-
vs,
|
|
36
|
-
fs,
|
|
37
|
-
attributes,
|
|
38
|
-
uniforms,
|
|
39
|
-
primitive,
|
|
40
|
-
count,
|
|
41
|
-
elements,
|
|
42
|
-
depth,
|
|
43
|
-
blend,
|
|
44
|
-
stencil,
|
|
45
|
-
cull,
|
|
46
|
-
instances
|
|
47
|
-
} = options;
|
|
48
|
-
const reglUniforms = {};
|
|
49
|
-
this.options = options;
|
|
50
|
-
if (uniforms) {
|
|
51
|
-
this.uniforms = this.extractUniforms(uniforms);
|
|
52
|
-
Object.keys(uniforms).forEach((uniformName) => {
|
|
53
|
-
reglUniforms[uniformName] = reGl.prop(uniformName);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
const reglAttributes = {};
|
|
57
|
-
Object.keys(attributes).forEach((name) => {
|
|
58
|
-
reglAttributes[name] = attributes[name].get();
|
|
59
|
-
});
|
|
60
|
-
const drawParams = {
|
|
61
|
-
attributes: reglAttributes,
|
|
62
|
-
frag: fs,
|
|
63
|
-
uniforms: reglUniforms,
|
|
64
|
-
vert: vs,
|
|
65
|
-
blend: {},
|
|
66
|
-
primitive: import_constants.primitiveMap[primitive === void 0 ? import_l7_core.gl.TRIANGLES : primitive]
|
|
67
|
-
};
|
|
68
|
-
if (instances) {
|
|
69
|
-
drawParams.instances = instances;
|
|
70
|
-
}
|
|
71
|
-
if (count) {
|
|
72
|
-
drawParams.count = count;
|
|
73
|
-
} else if (elements) {
|
|
74
|
-
drawParams.elements = elements.get();
|
|
75
|
-
}
|
|
76
|
-
this.initDepthDrawParams({ depth }, drawParams);
|
|
77
|
-
this.initBlendDrawParams({ blend }, drawParams);
|
|
78
|
-
this.initStencilDrawParams({ stencil }, drawParams);
|
|
79
|
-
this.initCullDrawParams({ cull }, drawParams);
|
|
80
|
-
this.drawCommand = reGl(drawParams);
|
|
81
|
-
if (pick) {
|
|
82
|
-
const pickDrawParams = (0, import_lodash.cloneDeep)(drawParams);
|
|
83
|
-
pickDrawParams.blend = {
|
|
84
|
-
...pickDrawParams.blend,
|
|
85
|
-
enable: false
|
|
86
|
-
};
|
|
87
|
-
this.drawPickCommand = reGl(pickDrawParams);
|
|
88
|
-
}
|
|
89
|
-
this.drawParams = drawParams;
|
|
90
|
-
}
|
|
91
|
-
updateAttributesAndElements(attributes, elements) {
|
|
92
|
-
const reglAttributes = {};
|
|
93
|
-
Object.keys(attributes).forEach((name) => {
|
|
94
|
-
reglAttributes[name] = attributes[name].get();
|
|
95
|
-
});
|
|
96
|
-
this.drawParams.attributes = reglAttributes;
|
|
97
|
-
this.drawParams.elements = elements.get();
|
|
98
|
-
this.drawCommand = this.reGl(this.drawParams);
|
|
99
|
-
if (this.options.pick) {
|
|
100
|
-
const pickDrawParams = (0, import_lodash.cloneDeep)(this.drawParams);
|
|
101
|
-
pickDrawParams.blend = {
|
|
102
|
-
...pickDrawParams.blend,
|
|
103
|
-
enable: false
|
|
104
|
-
};
|
|
105
|
-
this.drawPickCommand = this.reGl(pickDrawParams);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
updateAttributes(attributes) {
|
|
109
|
-
const reglAttributes = {};
|
|
110
|
-
Object.keys(attributes).forEach((name) => {
|
|
111
|
-
reglAttributes[name] = attributes[name].get();
|
|
112
|
-
});
|
|
113
|
-
this.drawParams.attributes = reglAttributes;
|
|
114
|
-
this.drawCommand = this.reGl(this.drawParams);
|
|
115
|
-
if (this.options.pick) {
|
|
116
|
-
const pickDrawParams = (0, import_lodash.cloneDeep)(this.drawParams);
|
|
117
|
-
pickDrawParams.blend = {
|
|
118
|
-
...pickDrawParams.blend,
|
|
119
|
-
enable: false
|
|
120
|
-
};
|
|
121
|
-
this.drawPickCommand = this.reGl(pickDrawParams);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
addUniforms(uniforms) {
|
|
125
|
-
this.uniforms = {
|
|
126
|
-
...this.uniforms,
|
|
127
|
-
...this.extractUniforms(uniforms)
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
draw(options, pick) {
|
|
131
|
-
if (this.drawParams.attributes && Object.keys(this.drawParams.attributes).length === 0) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const uniforms = {
|
|
135
|
-
...this.uniforms,
|
|
136
|
-
...this.extractUniforms(options.uniforms || {})
|
|
137
|
-
};
|
|
138
|
-
const reglDrawProps = {};
|
|
139
|
-
Object.keys(uniforms).forEach((uniformName) => {
|
|
140
|
-
const type = typeof uniforms[uniformName];
|
|
141
|
-
if (type === "boolean" || type === "number" || Array.isArray(uniforms[uniformName]) || uniforms[uniformName].BYTES_PER_ELEMENT) {
|
|
142
|
-
reglDrawProps[uniformName] = uniforms[uniformName];
|
|
143
|
-
} else {
|
|
144
|
-
reglDrawProps[uniformName] = uniforms[uniformName].get();
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
if (!pick) {
|
|
148
|
-
this.drawCommand(reglDrawProps);
|
|
149
|
-
} else {
|
|
150
|
-
this.drawPickCommand && this.drawPickCommand(reglDrawProps);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
destroy() {
|
|
154
|
-
var _a, _b;
|
|
155
|
-
(_b = (_a = this.drawParams) == null ? void 0 : _a.elements) == null ? void 0 : _b.destroy();
|
|
156
|
-
if (this.options.attributes) {
|
|
157
|
-
Object.values(this.options.attributes).forEach((attr) => {
|
|
158
|
-
attr == null ? void 0 : attr.destroy();
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
this.destroyed = true;
|
|
162
|
-
}
|
|
163
|
-
initDepthDrawParams({ depth }, drawParams) {
|
|
164
|
-
if (depth) {
|
|
165
|
-
drawParams.depth = {
|
|
166
|
-
enable: depth.enable === void 0 ? true : !!depth.enable,
|
|
167
|
-
mask: depth.mask === void 0 ? true : !!depth.mask,
|
|
168
|
-
func: import_constants.depthFuncMap[depth.func || import_l7_core.gl.LESS],
|
|
169
|
-
range: depth.range || [0, 1]
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
initBlendDrawParams({ blend }, drawParams) {
|
|
174
|
-
if (blend) {
|
|
175
|
-
const { enable, func, equation, color = [0, 0, 0, 0] } = blend;
|
|
176
|
-
drawParams.blend = {
|
|
177
|
-
enable: !!enable,
|
|
178
|
-
func: {
|
|
179
|
-
srcRGB: import_constants.blendFuncMap[func && func.srcRGB || import_l7_core.gl.SRC_ALPHA],
|
|
180
|
-
srcAlpha: import_constants.blendFuncMap[func && func.srcAlpha || import_l7_core.gl.SRC_ALPHA],
|
|
181
|
-
dstRGB: import_constants.blendFuncMap[func && func.dstRGB || import_l7_core.gl.ONE_MINUS_SRC_ALPHA],
|
|
182
|
-
dstAlpha: import_constants.blendFuncMap[func && func.dstAlpha || import_l7_core.gl.ONE_MINUS_SRC_ALPHA]
|
|
183
|
-
},
|
|
184
|
-
equation: {
|
|
185
|
-
rgb: import_constants.blendEquationMap[equation && equation.rgb || import_l7_core.gl.FUNC_ADD],
|
|
186
|
-
alpha: import_constants.blendEquationMap[equation && equation.alpha || import_l7_core.gl.FUNC_ADD]
|
|
187
|
-
},
|
|
188
|
-
color
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
initStencilDrawParams({ stencil }, drawParams) {
|
|
193
|
-
if (stencil) {
|
|
194
|
-
const {
|
|
195
|
-
enable,
|
|
196
|
-
mask = -1,
|
|
197
|
-
func = {
|
|
198
|
-
cmp: import_l7_core.gl.ALWAYS,
|
|
199
|
-
ref: 0,
|
|
200
|
-
mask: -1
|
|
201
|
-
},
|
|
202
|
-
opFront = {
|
|
203
|
-
fail: import_l7_core.gl.KEEP,
|
|
204
|
-
zfail: import_l7_core.gl.KEEP,
|
|
205
|
-
zpass: import_l7_core.gl.KEEP
|
|
206
|
-
},
|
|
207
|
-
opBack = {
|
|
208
|
-
fail: import_l7_core.gl.KEEP,
|
|
209
|
-
zfail: import_l7_core.gl.KEEP,
|
|
210
|
-
zpass: import_l7_core.gl.KEEP
|
|
211
|
-
}
|
|
212
|
-
} = stencil;
|
|
213
|
-
drawParams.stencil = {
|
|
214
|
-
enable: !!enable,
|
|
215
|
-
mask,
|
|
216
|
-
func: {
|
|
217
|
-
...func,
|
|
218
|
-
cmp: import_constants.stencilFuncMap[func.cmp]
|
|
219
|
-
},
|
|
220
|
-
opFront: {
|
|
221
|
-
fail: import_constants.stencilOpMap[opFront.fail],
|
|
222
|
-
zfail: import_constants.stencilOpMap[opFront.zfail],
|
|
223
|
-
zpass: import_constants.stencilOpMap[opFront.zpass]
|
|
224
|
-
},
|
|
225
|
-
opBack: {
|
|
226
|
-
fail: import_constants.stencilOpMap[opBack.fail],
|
|
227
|
-
zfail: import_constants.stencilOpMap[opBack.zfail],
|
|
228
|
-
zpass: import_constants.stencilOpMap[opBack.zpass]
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
initCullDrawParams({ cull }, drawParams) {
|
|
234
|
-
if (cull) {
|
|
235
|
-
const { enable, face = import_l7_core.gl.BACK } = cull;
|
|
236
|
-
drawParams.cull = {
|
|
237
|
-
enable: !!enable,
|
|
238
|
-
face: import_constants.cullFaceMap[face]
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
extractUniforms(uniforms) {
|
|
243
|
-
const extractedUniforms = {};
|
|
244
|
-
Object.keys(uniforms).forEach((uniformName) => {
|
|
245
|
-
this.extractUniformsRecursively(uniformName, uniforms[uniformName], extractedUniforms, "");
|
|
246
|
-
});
|
|
247
|
-
return extractedUniforms;
|
|
248
|
-
}
|
|
249
|
-
extractUniformsRecursively(uniformName, uniformValue, uniforms, prefix) {
|
|
250
|
-
if (uniformValue === null || typeof uniformValue === "number" || typeof uniformValue === "boolean" || Array.isArray(uniformValue) && typeof uniformValue[0] === "number" || (0, import_lodash.isTypedArray)(uniformValue) || uniformValue === "" || "resize" in uniformValue) {
|
|
251
|
-
uniforms[`${prefix && prefix + "."}${uniformName}`] = uniformValue;
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
if ((0, import_lodash.isPlainObject)(uniformValue)) {
|
|
255
|
-
Object.keys(uniformValue).forEach((childName) => {
|
|
256
|
-
this.extractUniformsRecursively(childName, uniformValue[childName], uniforms, `${prefix && prefix + "."}${uniformName}`);
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
if (Array.isArray(uniformValue)) {
|
|
260
|
-
uniformValue.forEach((child, idx) => {
|
|
261
|
-
Object.keys(child).forEach((childName) => {
|
|
262
|
-
this.extractUniformsRecursively(childName, child[childName], uniforms, `${prefix && prefix + "."}${uniformName}[${idx}]`);
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
269
|
-
0 && (module.exports = {});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/regl/ReglRenderbuffer.ts
|
|
20
|
-
var ReglRenderbuffer_exports = {};
|
|
21
|
-
__export(ReglRenderbuffer_exports, {
|
|
22
|
-
default: () => ReglRenderbuffer
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(ReglRenderbuffer_exports);
|
|
25
|
-
var import_constants = require("./constants");
|
|
26
|
-
var ReglRenderbuffer = class {
|
|
27
|
-
constructor(reGl, options) {
|
|
28
|
-
const { width, height, format } = options;
|
|
29
|
-
this.renderbuffer = reGl.renderbuffer({
|
|
30
|
-
width,
|
|
31
|
-
height,
|
|
32
|
-
format: import_constants.formatMap[format]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
get() {
|
|
36
|
-
return this.renderbuffer;
|
|
37
|
-
}
|
|
38
|
-
destroy() {
|
|
39
|
-
this.renderbuffer.destroy();
|
|
40
|
-
}
|
|
41
|
-
resize({ width, height }) {
|
|
42
|
-
this.renderbuffer.resize(width, height);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/regl/ReglTexture2D.ts
|
|
20
|
-
var ReglTexture2D_exports = {};
|
|
21
|
-
__export(ReglTexture2D_exports, {
|
|
22
|
-
default: () => ReglTexture2D
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(ReglTexture2D_exports);
|
|
25
|
-
var import_l7_core = require("@antv/l7-core");
|
|
26
|
-
var import_constants = require("./constants");
|
|
27
|
-
var ReglTexture2D = class {
|
|
28
|
-
constructor(reGl, options) {
|
|
29
|
-
this.isDistroy = false;
|
|
30
|
-
const {
|
|
31
|
-
data,
|
|
32
|
-
type = import_l7_core.gl.UNSIGNED_BYTE,
|
|
33
|
-
width,
|
|
34
|
-
height,
|
|
35
|
-
flipY = false,
|
|
36
|
-
format = import_l7_core.gl.RGBA,
|
|
37
|
-
mipmap = false,
|
|
38
|
-
wrapS = import_l7_core.gl.CLAMP_TO_EDGE,
|
|
39
|
-
wrapT = import_l7_core.gl.CLAMP_TO_EDGE,
|
|
40
|
-
aniso = 0,
|
|
41
|
-
alignment = 1,
|
|
42
|
-
premultiplyAlpha = false,
|
|
43
|
-
mag = import_l7_core.gl.NEAREST,
|
|
44
|
-
min = import_l7_core.gl.NEAREST,
|
|
45
|
-
colorSpace = import_l7_core.gl.BROWSER_DEFAULT_WEBGL,
|
|
46
|
-
x = 0,
|
|
47
|
-
y = 0,
|
|
48
|
-
copy = false
|
|
49
|
-
} = options;
|
|
50
|
-
this.width = width;
|
|
51
|
-
this.height = height;
|
|
52
|
-
const textureOptions = {
|
|
53
|
-
width,
|
|
54
|
-
height,
|
|
55
|
-
type: import_constants.dataTypeMap[type],
|
|
56
|
-
format: import_constants.formatMap[format],
|
|
57
|
-
wrapS: import_constants.wrapModeMap[wrapS],
|
|
58
|
-
wrapT: import_constants.wrapModeMap[wrapT],
|
|
59
|
-
mag: import_constants.filterMap[mag],
|
|
60
|
-
min: import_constants.filterMap[min],
|
|
61
|
-
alignment,
|
|
62
|
-
flipY,
|
|
63
|
-
colorSpace: import_constants.colorSpaceMap[colorSpace],
|
|
64
|
-
premultiplyAlpha,
|
|
65
|
-
aniso,
|
|
66
|
-
x,
|
|
67
|
-
y,
|
|
68
|
-
copy
|
|
69
|
-
};
|
|
70
|
-
if (data) {
|
|
71
|
-
textureOptions.data = data;
|
|
72
|
-
}
|
|
73
|
-
if (typeof mipmap === "number") {
|
|
74
|
-
textureOptions.mipmap = import_constants.mipmapMap[mipmap];
|
|
75
|
-
} else if (typeof mipmap === "boolean") {
|
|
76
|
-
textureOptions.mipmap = mipmap;
|
|
77
|
-
}
|
|
78
|
-
this.texture = reGl.texture(textureOptions);
|
|
79
|
-
}
|
|
80
|
-
get() {
|
|
81
|
-
return this.texture;
|
|
82
|
-
}
|
|
83
|
-
update(props = {}) {
|
|
84
|
-
this.texture(props);
|
|
85
|
-
}
|
|
86
|
-
bind() {
|
|
87
|
-
this.texture._texture.bind();
|
|
88
|
-
}
|
|
89
|
-
resize({ width, height }) {
|
|
90
|
-
this.texture.resize(width, height);
|
|
91
|
-
this.width = width;
|
|
92
|
-
this.height = height;
|
|
93
|
-
}
|
|
94
|
-
destroy() {
|
|
95
|
-
var _a;
|
|
96
|
-
if (!this.isDistroy) {
|
|
97
|
-
(_a = this.texture) == null ? void 0 : _a.destroy();
|
|
98
|
-
}
|
|
99
|
-
this.isDistroy = true;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
-
0 && (module.exports = {});
|
package/lib/regl/constants.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/regl/constants.ts
|
|
20
|
-
var constants_exports = {};
|
|
21
|
-
__export(constants_exports, {
|
|
22
|
-
blendEquationMap: () => blendEquationMap,
|
|
23
|
-
blendFuncMap: () => blendFuncMap,
|
|
24
|
-
colorSpaceMap: () => colorSpaceMap,
|
|
25
|
-
cullFaceMap: () => cullFaceMap,
|
|
26
|
-
dataTypeMap: () => dataTypeMap,
|
|
27
|
-
depthFuncMap: () => depthFuncMap,
|
|
28
|
-
filterMap: () => filterMap,
|
|
29
|
-
formatMap: () => formatMap,
|
|
30
|
-
mipmapMap: () => mipmapMap,
|
|
31
|
-
primitiveMap: () => primitiveMap,
|
|
32
|
-
stencilFuncMap: () => stencilFuncMap,
|
|
33
|
-
stencilOpMap: () => stencilOpMap,
|
|
34
|
-
usageMap: () => usageMap,
|
|
35
|
-
wrapModeMap: () => wrapModeMap
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(constants_exports);
|
|
38
|
-
var import_l7_core = require("@antv/l7-core");
|
|
39
|
-
var primitiveMap = {
|
|
40
|
-
[import_l7_core.gl.POINTS]: "points",
|
|
41
|
-
[import_l7_core.gl.LINES]: "lines",
|
|
42
|
-
[import_l7_core.gl.LINE_LOOP]: "line loop",
|
|
43
|
-
[import_l7_core.gl.LINE_STRIP]: "line strip",
|
|
44
|
-
[import_l7_core.gl.TRIANGLES]: "triangles",
|
|
45
|
-
[import_l7_core.gl.TRIANGLE_FAN]: "triangle fan",
|
|
46
|
-
[import_l7_core.gl.TRIANGLE_STRIP]: "triangle strip"
|
|
47
|
-
};
|
|
48
|
-
var usageMap = {
|
|
49
|
-
[import_l7_core.gl.STATIC_DRAW]: "static",
|
|
50
|
-
[import_l7_core.gl.DYNAMIC_DRAW]: "dynamic",
|
|
51
|
-
[import_l7_core.gl.STREAM_DRAW]: "stream"
|
|
52
|
-
};
|
|
53
|
-
var dataTypeMap = {
|
|
54
|
-
[import_l7_core.gl.BYTE]: "int8",
|
|
55
|
-
[import_l7_core.gl.UNSIGNED_INT]: "int16",
|
|
56
|
-
[import_l7_core.gl.INT]: "int32",
|
|
57
|
-
[import_l7_core.gl.UNSIGNED_BYTE]: "uint8",
|
|
58
|
-
[import_l7_core.gl.UNSIGNED_SHORT]: "uint16",
|
|
59
|
-
[import_l7_core.gl.UNSIGNED_INT]: "uint32",
|
|
60
|
-
[import_l7_core.gl.FLOAT]: "float"
|
|
61
|
-
};
|
|
62
|
-
var formatMap = {
|
|
63
|
-
[import_l7_core.gl.ALPHA]: "alpha",
|
|
64
|
-
[import_l7_core.gl.LUMINANCE]: "luminance",
|
|
65
|
-
[import_l7_core.gl.LUMINANCE_ALPHA]: "luminance alpha",
|
|
66
|
-
[import_l7_core.gl.RGB]: "rgb",
|
|
67
|
-
[import_l7_core.gl.RGBA]: "rgba",
|
|
68
|
-
[import_l7_core.gl.RGBA4]: "rgba4",
|
|
69
|
-
[import_l7_core.gl.RGB5_A1]: "rgb5 a1",
|
|
70
|
-
[import_l7_core.gl.RGB565]: "rgb565",
|
|
71
|
-
[import_l7_core.gl.DEPTH_COMPONENT]: "depth",
|
|
72
|
-
[import_l7_core.gl.DEPTH_STENCIL]: "depth stencil"
|
|
73
|
-
};
|
|
74
|
-
var mipmapMap = {
|
|
75
|
-
[import_l7_core.gl.DONT_CARE]: "dont care",
|
|
76
|
-
[import_l7_core.gl.NICEST]: "nice",
|
|
77
|
-
[import_l7_core.gl.FASTEST]: "fast"
|
|
78
|
-
};
|
|
79
|
-
var filterMap = {
|
|
80
|
-
[import_l7_core.gl.NEAREST]: "nearest",
|
|
81
|
-
[import_l7_core.gl.LINEAR]: "linear",
|
|
82
|
-
[import_l7_core.gl.LINEAR_MIPMAP_LINEAR]: "mipmap",
|
|
83
|
-
[import_l7_core.gl.NEAREST_MIPMAP_LINEAR]: "nearest mipmap linear",
|
|
84
|
-
[import_l7_core.gl.LINEAR_MIPMAP_NEAREST]: "linear mipmap nearest",
|
|
85
|
-
[import_l7_core.gl.NEAREST_MIPMAP_NEAREST]: "nearest mipmap nearest"
|
|
86
|
-
};
|
|
87
|
-
var wrapModeMap = {
|
|
88
|
-
[import_l7_core.gl.REPEAT]: "repeat",
|
|
89
|
-
[import_l7_core.gl.CLAMP_TO_EDGE]: "clamp",
|
|
90
|
-
[import_l7_core.gl.MIRRORED_REPEAT]: "mirror"
|
|
91
|
-
};
|
|
92
|
-
var colorSpaceMap = {
|
|
93
|
-
[import_l7_core.gl.NONE]: "none",
|
|
94
|
-
[import_l7_core.gl.BROWSER_DEFAULT_WEBGL]: "browser"
|
|
95
|
-
};
|
|
96
|
-
var depthFuncMap = {
|
|
97
|
-
[import_l7_core.gl.NEVER]: "never",
|
|
98
|
-
[import_l7_core.gl.ALWAYS]: "always",
|
|
99
|
-
[import_l7_core.gl.LESS]: "less",
|
|
100
|
-
[import_l7_core.gl.LEQUAL]: "lequal",
|
|
101
|
-
[import_l7_core.gl.GREATER]: "greater",
|
|
102
|
-
[import_l7_core.gl.GEQUAL]: "gequal",
|
|
103
|
-
[import_l7_core.gl.EQUAL]: "equal",
|
|
104
|
-
[import_l7_core.gl.NOTEQUAL]: "notequal"
|
|
105
|
-
};
|
|
106
|
-
var blendEquationMap = {
|
|
107
|
-
[import_l7_core.gl.FUNC_ADD]: "add",
|
|
108
|
-
[import_l7_core.gl.MIN_EXT]: "min",
|
|
109
|
-
[import_l7_core.gl.MAX_EXT]: "max",
|
|
110
|
-
[import_l7_core.gl.FUNC_SUBTRACT]: "subtract",
|
|
111
|
-
[import_l7_core.gl.FUNC_REVERSE_SUBTRACT]: "reverse subtract"
|
|
112
|
-
};
|
|
113
|
-
var blendFuncMap = {
|
|
114
|
-
[import_l7_core.gl.ZERO]: "zero",
|
|
115
|
-
[import_l7_core.gl.ONE]: "one",
|
|
116
|
-
[import_l7_core.gl.SRC_COLOR]: "src color",
|
|
117
|
-
[import_l7_core.gl.ONE_MINUS_SRC_COLOR]: "one minus src color",
|
|
118
|
-
[import_l7_core.gl.SRC_ALPHA]: "src alpha",
|
|
119
|
-
[import_l7_core.gl.ONE_MINUS_SRC_ALPHA]: "one minus src alpha",
|
|
120
|
-
[import_l7_core.gl.DST_COLOR]: "dst color",
|
|
121
|
-
[import_l7_core.gl.ONE_MINUS_DST_COLOR]: "one minus dst color",
|
|
122
|
-
[import_l7_core.gl.DST_ALPHA]: "dst alpha",
|
|
123
|
-
[import_l7_core.gl.ONE_MINUS_DST_ALPHA]: "one minus dst alpha",
|
|
124
|
-
[import_l7_core.gl.CONSTANT_COLOR]: "constant color",
|
|
125
|
-
[import_l7_core.gl.ONE_MINUS_CONSTANT_COLOR]: "one minus constant color",
|
|
126
|
-
[import_l7_core.gl.CONSTANT_ALPHA]: "constant alpha",
|
|
127
|
-
[import_l7_core.gl.ONE_MINUS_CONSTANT_ALPHA]: "one minus constant alpha",
|
|
128
|
-
[import_l7_core.gl.SRC_ALPHA_SATURATE]: "src alpha saturate"
|
|
129
|
-
};
|
|
130
|
-
var stencilFuncMap = {
|
|
131
|
-
[import_l7_core.gl.NEVER]: "never",
|
|
132
|
-
[import_l7_core.gl.ALWAYS]: "always",
|
|
133
|
-
[import_l7_core.gl.LESS]: "less",
|
|
134
|
-
[import_l7_core.gl.LEQUAL]: "lequal",
|
|
135
|
-
[import_l7_core.gl.GREATER]: "greater",
|
|
136
|
-
[import_l7_core.gl.GEQUAL]: "gequal",
|
|
137
|
-
[import_l7_core.gl.EQUAL]: "equal",
|
|
138
|
-
[import_l7_core.gl.NOTEQUAL]: "notequal"
|
|
139
|
-
};
|
|
140
|
-
var stencilOpMap = {
|
|
141
|
-
[import_l7_core.gl.ZERO]: "zero",
|
|
142
|
-
[import_l7_core.gl.KEEP]: "keep",
|
|
143
|
-
[import_l7_core.gl.REPLACE]: "replace",
|
|
144
|
-
[import_l7_core.gl.INVERT]: "invert",
|
|
145
|
-
[import_l7_core.gl.INCR]: "increment",
|
|
146
|
-
[import_l7_core.gl.DECR]: "decrement",
|
|
147
|
-
[import_l7_core.gl.INCR_WRAP]: "increment wrap",
|
|
148
|
-
[import_l7_core.gl.DECR_WRAP]: "decrement wrap"
|
|
149
|
-
};
|
|
150
|
-
var cullFaceMap = {
|
|
151
|
-
[import_l7_core.gl.FRONT]: "front",
|
|
152
|
-
[import_l7_core.gl.BACK]: "back"
|
|
153
|
-
};
|
|
154
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
155
|
-
0 && (module.exports = {
|
|
156
|
-
blendEquationMap,
|
|
157
|
-
blendFuncMap,
|
|
158
|
-
colorSpaceMap,
|
|
159
|
-
cullFaceMap,
|
|
160
|
-
dataTypeMap,
|
|
161
|
-
depthFuncMap,
|
|
162
|
-
filterMap,
|
|
163
|
-
formatMap,
|
|
164
|
-
mipmapMap,
|
|
165
|
-
primitiveMap,
|
|
166
|
-
stencilFuncMap,
|
|
167
|
-
stencilOpMap,
|
|
168
|
-
usageMap,
|
|
169
|
-
wrapModeMap
|
|
170
|
-
});
|