@antv/l7-renderer 2.25.6 → 2.25.7

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.
Files changed (93) hide show
  1. package/package.json +4 -4
  2. package/es/device/DeviceAttribute.d.ts +0 -13
  3. package/es/device/DeviceAttribute.js +0 -30
  4. package/es/device/DeviceBuffer.d.ts +0 -18
  5. package/es/device/DeviceBuffer.js +0 -51
  6. package/es/device/DeviceCache.d.ts +0 -14
  7. package/es/device/DeviceCache.js +0 -198
  8. package/es/device/DeviceElements.d.ts +0 -13
  9. package/es/device/DeviceElements.js +0 -42
  10. package/es/device/DeviceFramebuffer.d.ts +0 -24
  11. package/es/device/DeviceFramebuffer.js +0 -81
  12. package/es/device/DeviceModel.d.ts +0 -61
  13. package/es/device/DeviceModel.js +0 -488
  14. package/es/device/DeviceTexture2D.d.ts +0 -23
  15. package/es/device/DeviceTexture2D.js +0 -132
  16. package/es/device/constants.d.ts +0 -35
  17. package/es/device/constants.js +0 -117
  18. package/es/device/index.d.ts +0 -68
  19. package/es/device/index.js +0 -311
  20. package/es/device/utils/HashMap.d.ts +0 -24
  21. package/es/device/utils/HashMap.js +0 -86
  22. package/es/device/utils/pipeline.d.ts +0 -1
  23. package/es/device/utils/pipeline.js +0 -6
  24. package/es/device/utils/typedarray.d.ts +0 -7
  25. package/es/device/utils/typedarray.js +0 -33
  26. package/es/device/utils/webgl.d.ts +0 -1
  27. package/es/device/utils/webgl.js +0 -10
  28. package/es/index.d.ts +0 -3
  29. package/es/index.js +0 -7
  30. package/es/regl/ReglAttribute.d.ts +0 -16
  31. package/es/regl/ReglAttribute.js +0 -29
  32. package/es/regl/ReglBuffer.d.ts +0 -17
  33. package/es/regl/ReglBuffer.js +0 -33
  34. package/es/regl/ReglElements.d.ts +0 -14
  35. package/es/regl/ReglElements.js +0 -27
  36. package/es/regl/ReglFramebuffer.d.ts +0 -16
  37. package/es/regl/ReglFramebuffer.js +0 -31
  38. package/es/regl/ReglModel.d.ts +0 -46
  39. package/es/regl/ReglModel.js +0 -302
  40. package/es/regl/ReglRenderbuffer.d.ts +0 -16
  41. package/es/regl/ReglRenderbuffer.js +0 -24
  42. package/es/regl/ReglTexture2D.d.ts +0 -22
  43. package/es/regl/ReglTexture2D.js +0 -94
  44. package/es/regl/constants.d.ts +0 -43
  45. package/es/regl/constants.js +0 -133
  46. package/es/regl/index.d.ts +0 -56
  47. package/es/regl/index.js +0 -227
  48. package/lib/device/DeviceAttribute.d.ts +0 -13
  49. package/lib/device/DeviceAttribute.js +0 -50
  50. package/lib/device/DeviceBuffer.d.ts +0 -18
  51. package/lib/device/DeviceBuffer.js +0 -71
  52. package/lib/device/DeviceCache.d.ts +0 -14
  53. package/lib/device/DeviceCache.js +0 -214
  54. package/lib/device/DeviceElements.d.ts +0 -13
  55. package/lib/device/DeviceElements.js +0 -62
  56. package/lib/device/DeviceFramebuffer.d.ts +0 -24
  57. package/lib/device/DeviceFramebuffer.js +0 -101
  58. package/lib/device/DeviceModel.d.ts +0 -61
  59. package/lib/device/DeviceModel.js +0 -495
  60. package/lib/device/DeviceTexture2D.d.ts +0 -23
  61. package/lib/device/DeviceTexture2D.js +0 -151
  62. package/lib/device/constants.d.ts +0 -35
  63. package/lib/device/constants.js +0 -141
  64. package/lib/device/index.d.ts +0 -68
  65. package/lib/device/index.js +0 -332
  66. package/lib/device/utils/HashMap.d.ts +0 -24
  67. package/lib/device/utils/HashMap.js +0 -113
  68. package/lib/device/utils/pipeline.d.ts +0 -1
  69. package/lib/device/utils/pipeline.js +0 -30
  70. package/lib/device/utils/typedarray.d.ts +0 -7
  71. package/lib/device/utils/typedarray.js +0 -58
  72. package/lib/device/utils/webgl.d.ts +0 -1
  73. package/lib/device/utils/webgl.js +0 -34
  74. package/lib/index.d.ts +0 -3
  75. package/lib/index.js +0 -42
  76. package/lib/regl/ReglAttribute.d.ts +0 -16
  77. package/lib/regl/ReglAttribute.js +0 -49
  78. package/lib/regl/ReglBuffer.d.ts +0 -17
  79. package/lib/regl/ReglBuffer.js +0 -53
  80. package/lib/regl/ReglElements.d.ts +0 -14
  81. package/lib/regl/ReglElements.js +0 -47
  82. package/lib/regl/ReglFramebuffer.d.ts +0 -16
  83. package/lib/regl/ReglFramebuffer.js +0 -51
  84. package/lib/regl/ReglModel.d.ts +0 -46
  85. package/lib/regl/ReglModel.js +0 -311
  86. package/lib/regl/ReglRenderbuffer.d.ts +0 -16
  87. package/lib/regl/ReglRenderbuffer.js +0 -44
  88. package/lib/regl/ReglTexture2D.d.ts +0 -22
  89. package/lib/regl/ReglTexture2D.js +0 -107
  90. package/lib/regl/constants.d.ts +0 -43
  91. package/lib/regl/constants.js +0 -170
  92. package/lib/regl/index.d.ts +0 -56
  93. package/lib/regl/index.js +0 -256
@@ -1,113 +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/device/utils/HashMap.ts
20
- var HashMap_exports = {};
21
- __export(HashMap_exports, {
22
- HashMap: () => HashMap,
23
- hashCodeNumberFinish: () => hashCodeNumberFinish,
24
- hashCodeNumberUpdate: () => hashCodeNumberUpdate,
25
- nullHashFunc: () => nullHashFunc
26
- });
27
- module.exports = __toCommonJS(HashMap_exports);
28
- function hashCodeNumberUpdate(hash, v = 0) {
29
- hash += v;
30
- hash += hash << 10;
31
- hash += hash >>> 6;
32
- return hash >>> 0;
33
- }
34
- function hashCodeNumberFinish(hash) {
35
- hash += hash << 3;
36
- hash ^= hash >>> 11;
37
- hash += hash << 15;
38
- return hash >>> 0;
39
- }
40
- function nullHashFunc() {
41
- return 0;
42
- }
43
- var HashBucket = class {
44
- constructor() {
45
- this.keys = [];
46
- this.values = [];
47
- }
48
- };
49
- var HashMap = class {
50
- constructor(keyEqualFunc, keyHashFunc) {
51
- this.keyEqualFunc = keyEqualFunc;
52
- this.keyHashFunc = keyHashFunc;
53
- this.buckets = /* @__PURE__ */ new Map();
54
- }
55
- findBucketIndex(bucket, k) {
56
- for (let i = 0; i < bucket.keys.length; i++)
57
- if (this.keyEqualFunc(k, bucket.keys[i]))
58
- return i;
59
- return -1;
60
- }
61
- findBucket(k) {
62
- const bw = this.keyHashFunc(k);
63
- return this.buckets.get(bw);
64
- }
65
- get(k) {
66
- const bucket = this.findBucket(k);
67
- if (bucket === void 0)
68
- return null;
69
- const bi = this.findBucketIndex(bucket, k);
70
- if (bi < 0)
71
- return null;
72
- return bucket.values[bi];
73
- }
74
- add(k, v) {
75
- const bw = this.keyHashFunc(k);
76
- if (this.buckets.get(bw) === void 0)
77
- this.buckets.set(bw, new HashBucket());
78
- const bucket = this.buckets.get(bw);
79
- bucket.keys.push(k);
80
- bucket.values.push(v);
81
- }
82
- delete(k) {
83
- const bucket = this.findBucket(k);
84
- if (bucket === void 0)
85
- return;
86
- const bi = this.findBucketIndex(bucket, k);
87
- if (bi === -1)
88
- return;
89
- bucket.keys.splice(bi, 1);
90
- bucket.values.splice(bi, 1);
91
- }
92
- clear() {
93
- this.buckets.clear();
94
- }
95
- size() {
96
- let acc = 0;
97
- for (const bucket of this.buckets.values())
98
- acc += bucket.values.length;
99
- return acc;
100
- }
101
- *values() {
102
- for (const bucket of this.buckets.values())
103
- for (let j = bucket.values.length - 1; j >= 0; j--)
104
- yield bucket.values[j];
105
- }
106
- };
107
- // Annotate the CommonJS export names for ESM import in node:
108
- 0 && (module.exports = {
109
- HashMap,
110
- hashCodeNumberFinish,
111
- hashCodeNumberUpdate,
112
- nullHashFunc
113
- });
@@ -1 +0,0 @@
1
- export declare function pipelineEquals(): void;
@@ -1,30 +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/device/utils/pipeline.ts
20
- var pipeline_exports = {};
21
- __export(pipeline_exports, {
22
- pipelineEquals: () => pipelineEquals
23
- });
24
- module.exports = __toCommonJS(pipeline_exports);
25
- function pipelineEquals() {
26
- }
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- pipelineEquals
30
- });
@@ -1,7 +0,0 @@
1
- export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
2
- export declare function isTypedArray(x: any): x is TypedArray;
3
- /**
4
- * WebGPU does not support RGB texture, so we need to convert RGB to RGBA
5
- * @see https://github.com/antvis/L7/pull/2262
6
- */
7
- export declare function extend3ChannelsTo4(array: Float32Array, valueToInsert: number): Float32Array;
@@ -1,58 +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/device/utils/typedarray.ts
20
- var typedarray_exports = {};
21
- __export(typedarray_exports, {
22
- extend3ChannelsTo4: () => extend3ChannelsTo4,
23
- isTypedArray: () => isTypedArray
24
- });
25
- module.exports = __toCommonJS(typedarray_exports);
26
- var dtypes = {
27
- "[object Int8Array]": 5120,
28
- "[object Int16Array]": 5122,
29
- "[object Int32Array]": 5124,
30
- "[object Uint8Array]": 5121,
31
- "[object Uint8ClampedArray]": 5121,
32
- "[object Uint16Array]": 5123,
33
- "[object Uint32Array]": 5125,
34
- "[object Float32Array]": 5126,
35
- "[object Float64Array]": 5121,
36
- "[object ArrayBuffer]": 5121
37
- };
38
- function isTypedArray(x) {
39
- return Object.prototype.toString.call(x) in dtypes;
40
- }
41
- function extend3ChannelsTo4(array, valueToInsert) {
42
- const originalLength = array.length;
43
- const insertCount = Math.ceil(originalLength / 3);
44
- const newLength = originalLength + insertCount;
45
- const newArray = new Float32Array(newLength);
46
- for (let i = 0; i < newLength; i += 4) {
47
- newArray[i] = array[i / 4 * 3];
48
- newArray[i + 1] = array[i / 4 * 3 + 1];
49
- newArray[i + 2] = array[i / 4 * 3 + 2];
50
- newArray[i + 3] = valueToInsert;
51
- }
52
- return newArray;
53
- }
54
- // Annotate the CommonJS export names for ESM import in node:
55
- 0 && (module.exports = {
56
- extend3ChannelsTo4,
57
- isTypedArray
58
- });
@@ -1 +0,0 @@
1
- export declare function isWebGL2(gl: WebGL2RenderingContext | WebGLRenderingContext): gl is WebGL2RenderingContext;
@@ -1,34 +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/device/utils/webgl.ts
20
- var webgl_exports = {};
21
- __export(webgl_exports, {
22
- isWebGL2: () => isWebGL2
23
- });
24
- module.exports = __toCommonJS(webgl_exports);
25
- function isWebGL2(gl) {
26
- if (typeof WebGL2RenderingContext !== "undefined" && gl instanceof WebGL2RenderingContext) {
27
- return true;
28
- }
29
- return Boolean(gl && gl._version === 2);
30
- }
31
- // Annotate the CommonJS export names for ESM import in node:
32
- 0 && (module.exports = {
33
- isWebGL2
34
- });
package/lib/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import DeviceRendererService from './device';
2
- import ReglRendererService from './regl';
3
- export { DeviceRendererService, ReglRendererService };
package/lib/index.js DELETED
@@ -1,42 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/index.ts
30
- var src_exports = {};
31
- __export(src_exports, {
32
- DeviceRendererService: () => import_device.default,
33
- ReglRendererService: () => import_regl.default
34
- });
35
- module.exports = __toCommonJS(src_exports);
36
- var import_device = __toESM(require("./device"));
37
- var import_regl = __toESM(require("./regl"));
38
- // Annotate the CommonJS export names for ESM import in node:
39
- 0 && (module.exports = {
40
- DeviceRendererService,
41
- ReglRendererService
42
- });
@@ -1,16 +0,0 @@
1
- import type { IAttribute, IAttributeInitializationOptions } from '@antv/l7-core';
2
- import type regl from 'regl';
3
- /**
4
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes
5
- */
6
- export default class ReglAttribute implements IAttribute {
7
- private attribute;
8
- private buffer;
9
- constructor(gl: regl.Regl, options: IAttributeInitializationOptions);
10
- get(): regl.Attribute;
11
- updateBuffer(options: {
12
- data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;
13
- offset: number;
14
- }): void;
15
- destroy(): void;
16
- }
@@ -1,49 +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/ReglAttribute.ts
20
- var ReglAttribute_exports = {};
21
- __export(ReglAttribute_exports, {
22
- default: () => ReglAttribute
23
- });
24
- module.exports = __toCommonJS(ReglAttribute_exports);
25
- var ReglAttribute = class {
26
- constructor(gl, options) {
27
- const { buffer, offset, stride, normalized, size, divisor } = options;
28
- this.buffer = buffer;
29
- this.attribute = {
30
- buffer: buffer.get(),
31
- offset: offset || 0,
32
- stride: stride || 0,
33
- normalized: normalized || false,
34
- divisor: divisor || 0
35
- };
36
- if (size) {
37
- this.attribute.size = size;
38
- }
39
- }
40
- get() {
41
- return this.attribute;
42
- }
43
- updateBuffer(options) {
44
- this.buffer.subData(options);
45
- }
46
- destroy() {
47
- this.buffer.destroy();
48
- }
49
- };
@@ -1,17 +0,0 @@
1
- import type { IBuffer, IBufferInitializationOptions } from '@antv/l7-core';
2
- import type regl from 'regl';
3
- /**
4
- * adaptor for regl.Buffer
5
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers
6
- */
7
- export default class ReglBuffer implements IBuffer {
8
- private buffer;
9
- private isDestroyed;
10
- constructor(reGl: regl.Regl, options: IBufferInitializationOptions);
11
- get(): regl.Buffer;
12
- destroy(): void;
13
- subData({ data, offset, }: {
14
- data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;
15
- offset: number;
16
- }): void;
17
- }
@@ -1,53 +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/ReglBuffer.ts
20
- var ReglBuffer_exports = {};
21
- __export(ReglBuffer_exports, {
22
- default: () => ReglBuffer
23
- });
24
- module.exports = __toCommonJS(ReglBuffer_exports);
25
- var import_l7_core = require("@antv/l7-core");
26
- var import_constants = require("./constants");
27
- var ReglBuffer = class {
28
- constructor(reGl, options) {
29
- this.isDestroyed = false;
30
- const { data, usage, type } = options;
31
- this.buffer = reGl.buffer({
32
- data,
33
- usage: import_constants.usageMap[usage || import_l7_core.gl.STATIC_DRAW],
34
- type: import_constants.dataTypeMap[type || import_l7_core.gl.UNSIGNED_BYTE]
35
- // length: 0,
36
- });
37
- }
38
- get() {
39
- return this.buffer;
40
- }
41
- destroy() {
42
- if (!this.isDestroyed) {
43
- this.buffer.destroy();
44
- }
45
- this.isDestroyed = true;
46
- }
47
- subData({
48
- data,
49
- offset
50
- }) {
51
- this.buffer.subdata(data, offset);
52
- }
53
- };
@@ -1,14 +0,0 @@
1
- import type { IElements, IElementsInitializationOptions } from '@antv/l7-core';
2
- import type regl from 'regl';
3
- /**
4
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#elements
5
- */
6
- export default class ReglElements implements IElements {
7
- private elements;
8
- constructor(reGl: regl.Regl, options: IElementsInitializationOptions);
9
- get(): regl.Elements;
10
- subData({ data, }: {
11
- data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;
12
- }): void;
13
- destroy(): void;
14
- }
@@ -1,47 +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/ReglElements.ts
20
- var ReglElements_exports = {};
21
- __export(ReglElements_exports, {
22
- default: () => ReglElements
23
- });
24
- module.exports = __toCommonJS(ReglElements_exports);
25
- var import_l7_core = require("@antv/l7-core");
26
- var import_constants = require("./constants");
27
- var ReglElements = class {
28
- constructor(reGl, options) {
29
- const { data, usage, type, count } = options;
30
- this.elements = reGl.elements({
31
- data,
32
- usage: import_constants.usageMap[usage || import_l7_core.gl.STATIC_DRAW],
33
- type: import_constants.dataTypeMap[type || import_l7_core.gl.UNSIGNED_BYTE],
34
- count
35
- });
36
- }
37
- get() {
38
- return this.elements;
39
- }
40
- subData({
41
- data
42
- }) {
43
- this.elements.subdata(data);
44
- }
45
- destroy() {
46
- }
47
- };
@@ -1,16 +0,0 @@
1
- import type { IFramebuffer, IFramebufferInitializationOptions } from '@antv/l7-core';
2
- import type regl from 'regl';
3
- /**
4
- * adaptor for regl.Framebuffer
5
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#framebuffers
6
- */
7
- export default class ReglFramebuffer implements IFramebuffer {
8
- private framebuffer;
9
- constructor(reGl: regl.Regl, options: IFramebufferInitializationOptions);
10
- get(): regl.Framebuffer;
11
- destroy(): void;
12
- resize({ width, height }: {
13
- width: number;
14
- height: number;
15
- }): void;
16
- }
@@ -1,51 +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/ReglFramebuffer.ts
20
- var ReglFramebuffer_exports = {};
21
- __export(ReglFramebuffer_exports, {
22
- default: () => ReglFramebuffer
23
- });
24
- module.exports = __toCommonJS(ReglFramebuffer_exports);
25
- var ReglFramebuffer = class {
26
- constructor(reGl, options) {
27
- const { width, height, color, colors } = options;
28
- const framebufferOptions = {
29
- width,
30
- height
31
- };
32
- if (Array.isArray(colors)) {
33
- framebufferOptions.colors = colors.map(
34
- (c) => c.get()
35
- );
36
- }
37
- if (color && typeof color !== "boolean") {
38
- framebufferOptions.color = color.get();
39
- }
40
- this.framebuffer = reGl.framebuffer(framebufferOptions);
41
- }
42
- get() {
43
- return this.framebuffer;
44
- }
45
- destroy() {
46
- this.framebuffer.destroy();
47
- }
48
- resize({ width, height }) {
49
- this.framebuffer.resize(width, height);
50
- }
51
- };
@@ -1,46 +0,0 @@
1
- import type { IAttribute, IElements, IModel, IModelDrawOptions, IModelInitializationOptions, IUniform } from '@antv/l7-core';
2
- import type regl from 'regl';
3
- /**
4
- * adaptor for regl.DrawCommand
5
- */
6
- export default class ReglModel implements IModel {
7
- private reGl;
8
- private destroyed;
9
- private drawCommand;
10
- private drawParams;
11
- private options;
12
- private uniforms;
13
- constructor(reGl: regl.Regl, options: IModelInitializationOptions);
14
- updateAttributesAndElements(attributes: {
15
- [key: string]: IAttribute;
16
- }, elements: IElements): void;
17
- updateAttributes(attributes: {
18
- [key: string]: IAttribute;
19
- }): void;
20
- addUniforms(uniforms: {
21
- [key: string]: IUniform;
22
- }): void;
23
- draw(options: IModelDrawOptions, pick?: boolean): void;
24
- destroy(): void;
25
- /**
26
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#depth-buffer
27
- */
28
- private initDepthDrawParams;
29
- private getBlendDrawParams;
30
- /**
31
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#stencil
32
- */
33
- private getStencilDrawParams;
34
- private getColorMaskDrawParams;
35
- /**
36
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#culling
37
- */
38
- private initCullDrawParams;
39
- /**
40
- * 考虑结构体命名, eg:
41
- * a: { b: 1 } -> 'a.b'
42
- * a: [ { b: 1 } ] -> 'a[0].b'
43
- */
44
- private extractUniforms;
45
- private extractUniformsRecursively;
46
- }