@loaders.gl/images 3.3.0-alpha.5 → 3.3.0-alpha.6
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/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/image-loader.js +1 -5
- package/dist/es5/image-loader.js.map +1 -1
- package/dist/es5/image-writer.js +0 -2
- package/dist/es5/image-writer.js.map +1 -1
- package/dist/es5/index.js +14 -21
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/category-api/binary-image-api.js +3 -13
- package/dist/es5/lib/category-api/binary-image-api.js.map +1 -1
- package/dist/es5/lib/category-api/image-format.js +1 -7
- package/dist/es5/lib/category-api/image-format.js.map +1 -1
- package/dist/es5/lib/category-api/image-type.js +1 -9
- package/dist/es5/lib/category-api/image-type.js.map +1 -1
- package/dist/es5/lib/category-api/parsed-image-api.js +3 -19
- package/dist/es5/lib/category-api/parsed-image-api.js.map +1 -1
- package/dist/es5/lib/encoders/encode-image.js +1 -21
- package/dist/es5/lib/encoders/encode-image.js.map +1 -1
- package/dist/es5/lib/parsers/parse-image.js +0 -24
- package/dist/es5/lib/parsers/parse-image.js.map +1 -1
- package/dist/es5/lib/parsers/parse-to-image-bitmap.js +1 -26
- package/dist/es5/lib/parsers/parse-to-image-bitmap.js.map +1 -1
- package/dist/es5/lib/parsers/parse-to-image.js +0 -19
- package/dist/es5/lib/parsers/parse-to-image.js.map +1 -1
- package/dist/es5/lib/parsers/parse-to-node-image.js +1 -10
- package/dist/es5/lib/parsers/parse-to-node-image.js.map +1 -1
- package/dist/es5/lib/parsers/svg-utils.js +3 -9
- package/dist/es5/lib/parsers/svg-utils.js.map +1 -1
- package/dist/es5/lib/texture-api/async-deep-map.js +3 -32
- package/dist/es5/lib/texture-api/async-deep-map.js.map +1 -1
- package/dist/es5/lib/texture-api/deep-load.js +0 -14
- package/dist/es5/lib/texture-api/deep-load.js.map +1 -1
- package/dist/es5/lib/texture-api/generate-url.js +3 -12
- package/dist/es5/lib/texture-api/generate-url.js.map +1 -1
- package/dist/es5/lib/texture-api/load-image.js +9 -43
- package/dist/es5/lib/texture-api/load-image.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/lib/utils/version.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/image-loader.js +1 -0
- package/dist/esm/image-loader.js.map +1 -1
- package/dist/esm/image-writer.js +1 -0
- package/dist/esm/image-writer.js.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/category-api/binary-image-api.js +4 -11
- package/dist/esm/lib/category-api/binary-image-api.js.map +1 -1
- package/dist/esm/lib/category-api/image-format.js +3 -5
- package/dist/esm/lib/category-api/image-format.js.map +1 -1
- package/dist/esm/lib/category-api/image-type.js +2 -6
- package/dist/esm/lib/category-api/image-type.js.map +1 -1
- package/dist/esm/lib/category-api/parsed-image-api.js +1 -10
- package/dist/esm/lib/category-api/parsed-image-api.js.map +1 -1
- package/dist/esm/lib/encoders/encode-image.js +9 -7
- package/dist/esm/lib/encoders/encode-image.js.map +1 -1
- package/dist/esm/lib/parsers/parse-image.js +3 -6
- package/dist/esm/lib/parsers/parse-image.js.map +1 -1
- package/dist/esm/lib/parsers/parse-to-image-bitmap.js +3 -6
- package/dist/esm/lib/parsers/parse-to-image-bitmap.js.map +1 -1
- package/dist/esm/lib/parsers/parse-to-image.js +2 -2
- package/dist/esm/lib/parsers/parse-to-image.js.map +1 -1
- package/dist/esm/lib/parsers/parse-to-node-image.js +3 -0
- package/dist/esm/lib/parsers/parse-to-node-image.js.map +1 -1
- package/dist/esm/lib/parsers/svg-utils.js +2 -4
- package/dist/esm/lib/parsers/svg-utils.js.map +1 -1
- package/dist/esm/lib/texture-api/async-deep-map.js +6 -6
- package/dist/esm/lib/texture-api/async-deep-map.js.map +1 -1
- package/dist/esm/lib/texture-api/deep-load.js.map +1 -1
- package/dist/esm/lib/texture-api/generate-url.js +4 -5
- package/dist/esm/lib/texture-api/generate-url.js.map +1 -1
- package/dist/esm/lib/texture-api/load-image.js +14 -11
- package/dist/esm/lib/texture-api/load-image.js.map +1 -1
- package/dist/esm/lib/utils/version.js +2 -1
- package/dist/esm/lib/utils/version.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.asyncDeepMap = asyncDeepMap;
|
|
9
8
|
exports.mapSubtree = mapSubtree;
|
|
10
|
-
|
|
11
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
|
-
|
|
13
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
-
|
|
15
11
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
16
12
|
|
|
17
13
|
var isObject = function isObject(value) {
|
|
@@ -21,11 +17,10 @@ var isObject = function isObject(value) {
|
|
|
21
17
|
function asyncDeepMap(_x, _x2) {
|
|
22
18
|
return _asyncDeepMap.apply(this, arguments);
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
function _asyncDeepMap() {
|
|
26
21
|
_asyncDeepMap = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(tree, func) {
|
|
27
22
|
var options,
|
|
28
|
-
|
|
23
|
+
_args = arguments;
|
|
29
24
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
30
25
|
while (1) {
|
|
31
26
|
switch (_context.prev = _context.next) {
|
|
@@ -33,10 +28,8 @@ function _asyncDeepMap() {
|
|
|
33
28
|
options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
|
|
34
29
|
_context.next = 3;
|
|
35
30
|
return mapSubtree(tree, func, options);
|
|
36
|
-
|
|
37
31
|
case 3:
|
|
38
32
|
return _context.abrupt("return", _context.sent);
|
|
39
|
-
|
|
40
33
|
case 4:
|
|
41
34
|
case "end":
|
|
42
35
|
return _context.stop();
|
|
@@ -46,11 +39,9 @@ function _asyncDeepMap() {
|
|
|
46
39
|
}));
|
|
47
40
|
return _asyncDeepMap.apply(this, arguments);
|
|
48
41
|
}
|
|
49
|
-
|
|
50
42
|
function mapSubtree(_x3, _x4, _x5) {
|
|
51
43
|
return _mapSubtree.apply(this, arguments);
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
function _mapSubtree() {
|
|
55
46
|
_mapSubtree = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(object, func, options) {
|
|
56
47
|
var url;
|
|
@@ -62,33 +53,25 @@ function _mapSubtree() {
|
|
|
62
53
|
_context2.next = 4;
|
|
63
54
|
break;
|
|
64
55
|
}
|
|
65
|
-
|
|
66
56
|
_context2.next = 3;
|
|
67
57
|
return mapArray(object, func, options);
|
|
68
|
-
|
|
69
58
|
case 3:
|
|
70
59
|
return _context2.abrupt("return", _context2.sent);
|
|
71
|
-
|
|
72
60
|
case 4:
|
|
73
61
|
if (!isObject(object)) {
|
|
74
62
|
_context2.next = 8;
|
|
75
63
|
break;
|
|
76
64
|
}
|
|
77
|
-
|
|
78
65
|
_context2.next = 7;
|
|
79
66
|
return mapObject(object, func, options);
|
|
80
|
-
|
|
81
67
|
case 7:
|
|
82
68
|
return _context2.abrupt("return", _context2.sent);
|
|
83
|
-
|
|
84
69
|
case 8:
|
|
85
70
|
url = object;
|
|
86
71
|
_context2.next = 11;
|
|
87
72
|
return func(url, options);
|
|
88
|
-
|
|
89
73
|
case 11:
|
|
90
74
|
return _context2.abrupt("return", _context2.sent);
|
|
91
|
-
|
|
92
75
|
case 12:
|
|
93
76
|
case "end":
|
|
94
77
|
return _context2.stop();
|
|
@@ -98,22 +81,18 @@ function _mapSubtree() {
|
|
|
98
81
|
}));
|
|
99
82
|
return _mapSubtree.apply(this, arguments);
|
|
100
83
|
}
|
|
101
|
-
|
|
102
84
|
function mapObject(_x6, _x7, _x8) {
|
|
103
85
|
return _mapObject.apply(this, arguments);
|
|
104
86
|
}
|
|
105
|
-
|
|
106
87
|
function _mapObject() {
|
|
107
88
|
_mapObject = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(object, func, options) {
|
|
108
89
|
var promises, values, _loop, key;
|
|
109
|
-
|
|
110
90
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
111
91
|
while (1) {
|
|
112
92
|
switch (_context3.prev = _context3.next) {
|
|
113
93
|
case 0:
|
|
114
94
|
promises = [];
|
|
115
95
|
values = {};
|
|
116
|
-
|
|
117
96
|
_loop = function _loop(key) {
|
|
118
97
|
var url = object[key];
|
|
119
98
|
var promise = mapSubtree(url, func, options).then(function (value) {
|
|
@@ -121,17 +100,13 @@ function _mapObject() {
|
|
|
121
100
|
});
|
|
122
101
|
promises.push(promise);
|
|
123
102
|
};
|
|
124
|
-
|
|
125
103
|
for (key in object) {
|
|
126
104
|
_loop(key);
|
|
127
105
|
}
|
|
128
|
-
|
|
129
106
|
_context3.next = 6;
|
|
130
107
|
return Promise.all(promises);
|
|
131
|
-
|
|
132
108
|
case 6:
|
|
133
109
|
return _context3.abrupt("return", values);
|
|
134
|
-
|
|
135
110
|
case 7:
|
|
136
111
|
case "end":
|
|
137
112
|
return _context3.stop();
|
|
@@ -141,16 +116,14 @@ function _mapObject() {
|
|
|
141
116
|
}));
|
|
142
117
|
return _mapObject.apply(this, arguments);
|
|
143
118
|
}
|
|
144
|
-
|
|
145
119
|
function mapArray(_x9, _x10) {
|
|
146
120
|
return _mapArray.apply(this, arguments);
|
|
147
121
|
}
|
|
148
|
-
|
|
149
122
|
function _mapArray() {
|
|
150
123
|
_mapArray = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(urlArray, func) {
|
|
151
124
|
var options,
|
|
152
|
-
|
|
153
|
-
|
|
125
|
+
promises,
|
|
126
|
+
_args4 = arguments;
|
|
154
127
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
155
128
|
while (1) {
|
|
156
129
|
switch (_context4.prev = _context4.next) {
|
|
@@ -161,10 +134,8 @@ function _mapArray() {
|
|
|
161
134
|
});
|
|
162
135
|
_context4.next = 4;
|
|
163
136
|
return Promise.all(promises);
|
|
164
|
-
|
|
165
137
|
case 4:
|
|
166
138
|
return _context4.abrupt("return", _context4.sent);
|
|
167
|
-
|
|
168
139
|
case 5:
|
|
169
140
|
case "end":
|
|
170
141
|
return _context4.stop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"async-deep-map.js","names":["isObject","value","asyncDeepMap","tree","func","options","mapSubtree","object","Array","isArray","mapArray","mapObject","url","promises","values","key","promise","then","push","Promise","all","urlArray","map"],"sources":["../../../../src/lib/texture-api/async-deep-map.ts"],"sourcesContent":["/*\nAsynchronously maps a deep structure of values (e.g. objects and arrays of urls).\n\nE.g. a mipmapped cubemap\n{\n [CUBE_FACE_FRONT]: [\n \"image-front-0.jpg\",\n \"image-front-1.jpg\",\n \"image-front-2.jpg\",\n ],\n [CUBE_MAP_BACK]: [\n ...\n ]\n}\n*/\n\nconst isObject = (value) => value && typeof value === 'object';\n\n// Loads a deep structure of urls (objects and arrays of urls)\n// Returns an object with six key-value pairs containing the images (or image mip arrays)\n// for each cube face\nexport async function asyncDeepMap(tree, func, options = {}) {\n return await mapSubtree(tree, func, options);\n}\n\nexport async function mapSubtree(object, func, options) {\n if (Array.isArray(object)) {\n return await mapArray(object, func, options);\n }\n\n if (isObject(object)) {\n return await mapObject(object, func, options);\n }\n\n // TODO - ignore non-urls, non-arraybuffers?\n const url = object;\n return await func(url, options);\n}\n\n// HELPERS\n\nasync function mapObject(object, func, options) {\n const promises: Promise<any>[] = [];\n const values = {};\n\n for (const key in object) {\n const url = object[key];\n const promise = mapSubtree(url, func, options).then((value) => {\n values[key] = value;\n });\n promises.push(promise);\n }\n\n await Promise.all(promises);\n\n return values;\n}\n\nasync function mapArray(urlArray, func, options = {}) {\n const promises = urlArray.map((url) => mapSubtree(url, func, options));\n return await Promise.all(promises);\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAMA,QAAQ,GAAG,SAAXA,QAAQ,CAAIC,KAAK;EAAA,OAAKA,KAAK,IAAI,sBAAOA,KAAK,MAAK,QAAQ;AAAA;;AAAC,SAKzCC,YAAY;EAAA;AAAA;AAAA;EAAA,0EAA3B,iBAA4BC,IAAI,EAAEC,IAAI;IAAA;MAAA;IAAA;MAAA;QAAA;UAAA;YAAEC,OAAO,2DAAG,CAAC,CAAC;YAAA;YAAA,OAC5CC,UAAU,CAACH,IAAI,EAAEC,IAAI,EAAEC,OAAO,CAAC;UAAA;YAAA;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAC7C;EAAA;AAAA;AAAA,SAEqBC,UAAU;EAAA;AAAA;AAAA;EAAA,wEAAzB,kBAA0BC,MAAM,EAAEH,IAAI,EAAEC,OAAO;IAAA;IAAA;MAAA;QAAA;UAAA;YAAA,KAChDG,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC;cAAA;cAAA;YAAA;YAAA;YAAA,OACVG,QAAQ,CAACH,MAAM,EAAEH,IAAI,EAAEC,OAAO,CAAC;UAAA;YAAA;UAAA;YAAA,KAG1CL,QAAQ,CAACO,MAAM,CAAC;cAAA;cAAA;YAAA;YAAA;YAAA,OACLI,SAAS,CAACJ,MAAM,EAAEH,IAAI,EAAEC,OAAO,CAAC;UAAA;YAAA;UAAA;YAIzCO,GAAG,GAAGL,MAAM;YAAA;YAAA,OACLH,IAAI,CAACQ,GAAG,EAAEP,OAAO,CAAC;UAAA;YAAA;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAChC;EAAA;AAAA;AAAA,SAIcM,SAAS;EAAA;AAAA;AAAA;EAAA,uEAAxB,kBAAyBJ,MAAM,EAAEH,IAAI,EAAEC,OAAO;IAAA;IAAA;MAAA;QAAA;UAAA;YACtCQ,QAAwB,GAAG,EAAE;YAC7BC,MAAM,GAAG,CAAC,CAAC;YAAA,uBAENC,GAAG;cACZ,IAAMH,GAAG,GAAGL,MAAM,CAACQ,GAAG,CAAC;cACvB,IAAMC,OAAO,GAAGV,UAAU,CAACM,GAAG,EAAER,IAAI,EAAEC,OAAO,CAAC,CAACY,IAAI,CAAC,UAAChB,KAAK,EAAK;gBAC7Da,MAAM,CAACC,GAAG,CAAC,GAAGd,KAAK;cACrB,CAAC,CAAC;cACFY,QAAQ,CAACK,IAAI,CAACF,OAAO,CAAC;YAAC;YALzB,KAAWD,GAAG,IAAIR,MAAM,EAAE;cAAA,MAAfQ,GAAG;YAMd;YAAC;YAAA,OAEKI,OAAO,CAACC,GAAG,CAACP,QAAQ,CAAC;UAAA;YAAA,kCAEpBC,MAAM;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACd;EAAA;AAAA;AAAA,SAEcJ,QAAQ;EAAA;AAAA;AAAA;EAAA,sEAAvB,kBAAwBW,QAAQ,EAAEjB,IAAI;IAAA;MAAA;MAAA;IAAA;MAAA;QAAA;UAAA;YAAEC,OAAO,8DAAG,CAAC,CAAC;YAC5CQ,QAAQ,GAAGQ,QAAQ,CAACC,GAAG,CAAC,UAACV,GAAG;cAAA,OAAKN,UAAU,CAACM,GAAG,EAAER,IAAI,EAAEC,OAAO,CAAC;YAAA,EAAC;YAAA;YAAA,OACzDc,OAAO,CAACC,GAAG,CAACP,QAAQ,CAAC;UAAA;YAAA;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACnC;EAAA;AAAA"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.deepLoad = deepLoad;
|
|
9
8
|
exports.shallowLoad = shallowLoad;
|
|
10
|
-
|
|
11
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
|
-
|
|
13
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
-
|
|
15
11
|
var _asyncDeepMap = require("./async-deep-map");
|
|
16
|
-
|
|
17
12
|
function deepLoad(_x, _x2, _x3) {
|
|
18
13
|
return _deepLoad.apply(this, arguments);
|
|
19
14
|
}
|
|
20
|
-
|
|
21
15
|
function _deepLoad() {
|
|
22
16
|
_deepLoad = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(urlTree, load, options) {
|
|
23
17
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -28,10 +22,8 @@ function _deepLoad() {
|
|
|
28
22
|
return (0, _asyncDeepMap.asyncDeepMap)(urlTree, function (url) {
|
|
29
23
|
return shallowLoad(url, load, options);
|
|
30
24
|
});
|
|
31
|
-
|
|
32
25
|
case 2:
|
|
33
26
|
return _context.abrupt("return", _context.sent);
|
|
34
|
-
|
|
35
27
|
case 3:
|
|
36
28
|
case "end":
|
|
37
29
|
return _context.stop();
|
|
@@ -41,11 +33,9 @@ function _deepLoad() {
|
|
|
41
33
|
}));
|
|
42
34
|
return _deepLoad.apply(this, arguments);
|
|
43
35
|
}
|
|
44
|
-
|
|
45
36
|
function shallowLoad(_x4, _x5, _x6) {
|
|
46
37
|
return _shallowLoad.apply(this, arguments);
|
|
47
38
|
}
|
|
48
|
-
|
|
49
39
|
function _shallowLoad() {
|
|
50
40
|
_shallowLoad = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(url, load, options) {
|
|
51
41
|
var response, arrayBuffer;
|
|
@@ -55,20 +45,16 @@ function _shallowLoad() {
|
|
|
55
45
|
case 0:
|
|
56
46
|
_context2.next = 2;
|
|
57
47
|
return fetch(url, options.fetch);
|
|
58
|
-
|
|
59
48
|
case 2:
|
|
60
49
|
response = _context2.sent;
|
|
61
50
|
_context2.next = 5;
|
|
62
51
|
return response.arrayBuffer();
|
|
63
|
-
|
|
64
52
|
case 5:
|
|
65
53
|
arrayBuffer = _context2.sent;
|
|
66
54
|
_context2.next = 8;
|
|
67
55
|
return load(arrayBuffer, options);
|
|
68
|
-
|
|
69
56
|
case 8:
|
|
70
57
|
return _context2.abrupt("return", _context2.sent);
|
|
71
|
-
|
|
72
58
|
case 9:
|
|
73
59
|
case "end":
|
|
74
60
|
return _context2.stop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"deep-load.js","names":["deepLoad","urlTree","load","options","asyncDeepMap","url","shallowLoad","fetch","response","arrayBuffer"],"sources":["../../../../src/lib/texture-api/deep-load.ts"],"sourcesContent":["import {asyncDeepMap} from './async-deep-map';\n\nexport async function deepLoad(urlTree, load, options) {\n return await asyncDeepMap(urlTree, (url) => shallowLoad(url, load, options));\n}\n\nexport async function shallowLoad(url, load, options) {\n // console.error('loading', url);\n const response = await fetch(url, options.fetch);\n const arrayBuffer = await response.arrayBuffer();\n return await load(arrayBuffer, options);\n}\n"],"mappings":";;;;;;;;;;AAAA;AAA8C,SAExBA,QAAQ;EAAA;AAAA;AAAA;EAAA,sEAAvB,iBAAwBC,OAAO,EAAEC,IAAI,EAAEC,OAAO;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACtC,IAAAC,0BAAY,EAACH,OAAO,EAAE,UAACI,GAAG;cAAA,OAAKC,WAAW,CAACD,GAAG,EAAEH,IAAI,EAAEC,OAAO,CAAC;YAAA,EAAC;UAAA;YAAA;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAC7E;EAAA;AAAA;AAAA,SAEqBG,WAAW;EAAA;AAAA;AAAA;EAAA,yEAA1B,kBAA2BD,GAAG,EAAEH,IAAI,EAAEC,OAAO;IAAA;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OAE3BI,KAAK,CAACF,GAAG,EAAEF,OAAO,CAACI,KAAK,CAAC;UAAA;YAA1CC,QAAQ;YAAA;YAAA,OACYA,QAAQ,CAACC,WAAW,EAAE;UAAA;YAA1CA,WAAW;YAAA;YAAA,OACJP,IAAI,CAACO,WAAW,EAAEN,OAAO,CAAC;UAAA;YAAA;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACxC;EAAA;AAAA"}
|
|
@@ -1,34 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.generateUrl = generateUrl;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _loaderUtils = require("@loaders.gl/loader-utils");
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
12
|
function generateUrl(getUrl, options, urlOptions) {
|
|
19
13
|
var url = getUrl;
|
|
20
|
-
|
|
21
14
|
if (typeof getUrl === 'function') {
|
|
22
15
|
url = getUrl(_objectSpread(_objectSpread({}, options), urlOptions));
|
|
23
16
|
}
|
|
24
|
-
|
|
25
17
|
(0, _loaderUtils.assert)(typeof url === 'string');
|
|
26
|
-
var baseUrl = options.baseUrl;
|
|
27
18
|
|
|
19
|
+
var baseUrl = options.baseUrl;
|
|
28
20
|
if (baseUrl) {
|
|
29
21
|
url = baseUrl[baseUrl.length - 1] === '/' ? "".concat(baseUrl).concat(url) : "".concat(baseUrl, "/").concat(url);
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
return (0, _loaderUtils.resolvePath)(url);
|
|
33
24
|
}
|
|
34
25
|
//# sourceMappingURL=generate-url.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"generate-url.js","names":["generateUrl","getUrl","options","urlOptions","url","assert","baseUrl","length","resolvePath"],"sources":["../../../../src/lib/texture-api/generate-url.ts"],"sourcesContent":["import {resolvePath, assert} from '@loaders.gl/loader-utils';\n\n// Generate a url by calling getUrl with mix of options, applying options.baseUrl\nexport function generateUrl(getUrl, options, urlOptions) {\n // Get url\n let url = getUrl;\n if (typeof getUrl === 'function') {\n url = getUrl({...options, ...urlOptions});\n }\n assert(typeof url === 'string');\n\n // Apply options.baseUrl\n const {baseUrl} = options;\n if (baseUrl) {\n url = baseUrl[baseUrl.length - 1] === '/' ? `${baseUrl}${url}` : `${baseUrl}/${url}`;\n }\n\n return resolvePath(url);\n}\n"],"mappings":";;;;;;;;AAAA;AAA6D;AAAA;AAGtD,SAASA,WAAW,CAACC,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAE;EAEvD,IAAIC,GAAG,GAAGH,MAAM;EAChB,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;IAChCG,GAAG,GAAGH,MAAM,iCAAKC,OAAO,GAAKC,UAAU,EAAE;EAC3C;EACA,IAAAE,mBAAM,EAAC,OAAOD,GAAG,KAAK,QAAQ,CAAC;;EAG/B,IAAOE,OAAO,GAAIJ,OAAO,CAAlBI,OAAO;EACd,IAAIA,OAAO,EAAE;IACXF,GAAG,GAAGE,OAAO,CAACA,OAAO,CAACC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,aAAMD,OAAO,SAAGF,GAAG,cAAQE,OAAO,cAAIF,GAAG,CAAE;EACtF;EAEA,OAAO,IAAAI,wBAAW,EAACJ,GAAG,CAAC;AACzB"}
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.loadImage = loadImage;
|
|
9
7
|
exports.getImageUrls = getImageUrls;
|
|
10
8
|
exports.getMipLevels = getMipLevels;
|
|
11
|
-
|
|
9
|
+
exports.loadImage = loadImage;
|
|
12
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
-
|
|
18
13
|
var _loaderUtils = require("@loaders.gl/loader-utils");
|
|
19
|
-
|
|
20
14
|
var _parseImage = _interopRequireDefault(require("../parsers/parse-image"));
|
|
21
|
-
|
|
22
15
|
var _parsedImageApi = require("../category-api/parsed-image-api");
|
|
23
|
-
|
|
24
16
|
var _generateUrl = require("./generate-url");
|
|
25
|
-
|
|
26
17
|
var _deepLoad = require("./deep-load");
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
|
-
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
32
20
|
function loadImage(_x) {
|
|
33
21
|
return _loadImage.apply(this, arguments);
|
|
34
22
|
}
|
|
35
|
-
|
|
36
23
|
function _loadImage() {
|
|
37
24
|
_loadImage = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(getUrl) {
|
|
38
25
|
var options,
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
imageUrls,
|
|
27
|
+
_args = arguments;
|
|
41
28
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
42
29
|
while (1) {
|
|
43
30
|
switch (_context.prev = _context.next) {
|
|
@@ -45,15 +32,12 @@ function _loadImage() {
|
|
|
45
32
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
46
33
|
_context.next = 3;
|
|
47
34
|
return getImageUrls(getUrl, options);
|
|
48
|
-
|
|
49
35
|
case 3:
|
|
50
36
|
imageUrls = _context.sent;
|
|
51
37
|
_context.next = 6;
|
|
52
38
|
return (0, _deepLoad.deepLoad)(imageUrls, _parseImage.default, options);
|
|
53
|
-
|
|
54
39
|
case 6:
|
|
55
40
|
return _context.abrupt("return", _context.sent);
|
|
56
|
-
|
|
57
41
|
case 7:
|
|
58
42
|
case "end":
|
|
59
43
|
return _context.stop();
|
|
@@ -63,42 +47,34 @@ function _loadImage() {
|
|
|
63
47
|
}));
|
|
64
48
|
return _loadImage.apply(this, arguments);
|
|
65
49
|
}
|
|
66
|
-
|
|
67
50
|
function getImageUrls(_x2, _x3) {
|
|
68
51
|
return _getImageUrls.apply(this, arguments);
|
|
69
52
|
}
|
|
70
|
-
|
|
71
53
|
function _getImageUrls() {
|
|
72
54
|
_getImageUrls = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(getUrl, options) {
|
|
73
55
|
var urlOptions,
|
|
74
|
-
|
|
75
|
-
|
|
56
|
+
mipLevels,
|
|
57
|
+
_args2 = arguments;
|
|
76
58
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
77
59
|
while (1) {
|
|
78
60
|
switch (_context2.prev = _context2.next) {
|
|
79
61
|
case 0:
|
|
80
62
|
urlOptions = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
|
|
81
63
|
mipLevels = options && options.image && options.image.mipLevels || 0;
|
|
82
|
-
|
|
83
64
|
if (!(mipLevels !== 0)) {
|
|
84
65
|
_context2.next = 8;
|
|
85
66
|
break;
|
|
86
67
|
}
|
|
87
|
-
|
|
88
68
|
_context2.next = 5;
|
|
89
69
|
return getMipmappedImageUrls(getUrl, mipLevels, options, urlOptions);
|
|
90
|
-
|
|
91
70
|
case 5:
|
|
92
71
|
_context2.t0 = _context2.sent;
|
|
93
72
|
_context2.next = 9;
|
|
94
73
|
break;
|
|
95
|
-
|
|
96
74
|
case 8:
|
|
97
75
|
_context2.t0 = (0, _generateUrl.generateUrl)(getUrl, options, urlOptions);
|
|
98
|
-
|
|
99
76
|
case 9:
|
|
100
77
|
return _context2.abrupt("return", _context2.t0);
|
|
101
|
-
|
|
102
78
|
case 10:
|
|
103
79
|
case "end":
|
|
104
80
|
return _context2.stop();
|
|
@@ -108,32 +84,26 @@ function _getImageUrls() {
|
|
|
108
84
|
}));
|
|
109
85
|
return _getImageUrls.apply(this, arguments);
|
|
110
86
|
}
|
|
111
|
-
|
|
112
87
|
function getMipmappedImageUrls(_x4, _x5, _x6, _x7) {
|
|
113
88
|
return _getMipmappedImageUrls.apply(this, arguments);
|
|
114
89
|
}
|
|
115
|
-
|
|
116
90
|
function _getMipmappedImageUrls() {
|
|
117
91
|
_getMipmappedImageUrls = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(getUrl, mipLevels, options, urlOptions) {
|
|
118
92
|
var urls, url, image, _getImageSize, width, height, mipLevel, _url;
|
|
119
|
-
|
|
120
93
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
121
94
|
while (1) {
|
|
122
95
|
switch (_context3.prev = _context3.next) {
|
|
123
96
|
case 0:
|
|
124
97
|
urls = [];
|
|
125
|
-
|
|
126
98
|
if (!(mipLevels === 'auto')) {
|
|
127
99
|
_context3.next = 9;
|
|
128
100
|
break;
|
|
129
101
|
}
|
|
130
|
-
|
|
131
102
|
url = (0, _generateUrl.generateUrl)(getUrl, options, _objectSpread(_objectSpread({}, urlOptions), {}, {
|
|
132
103
|
lod: 0
|
|
133
104
|
}));
|
|
134
105
|
_context3.next = 5;
|
|
135
106
|
return (0, _deepLoad.shallowLoad)(url, _parseImage.default, options);
|
|
136
|
-
|
|
137
107
|
case 5:
|
|
138
108
|
image = _context3.sent;
|
|
139
109
|
_getImageSize = (0, _parsedImageApi.getImageSize)(image), width = _getImageSize.width, height = _getImageSize.height;
|
|
@@ -141,20 +111,17 @@ function _getMipmappedImageUrls() {
|
|
|
141
111
|
width: width,
|
|
142
112
|
height: height
|
|
143
113
|
});
|
|
144
|
-
urls.push(url);
|
|
145
114
|
|
|
115
|
+
urls.push(url);
|
|
146
116
|
case 9:
|
|
147
117
|
(0, _loaderUtils.assert)(mipLevels > 0);
|
|
148
|
-
|
|
149
118
|
for (mipLevel = urls.length; mipLevel < mipLevels; ++mipLevel) {
|
|
150
119
|
_url = (0, _generateUrl.generateUrl)(getUrl, options, _objectSpread(_objectSpread({}, urlOptions), {}, {
|
|
151
120
|
lod: mipLevel
|
|
152
121
|
}));
|
|
153
122
|
urls.push(_url);
|
|
154
123
|
}
|
|
155
|
-
|
|
156
124
|
return _context3.abrupt("return", urls);
|
|
157
|
-
|
|
158
125
|
case 12:
|
|
159
126
|
case "end":
|
|
160
127
|
return _context3.stop();
|
|
@@ -164,10 +131,9 @@ function _getMipmappedImageUrls() {
|
|
|
164
131
|
}));
|
|
165
132
|
return _getMipmappedImageUrls.apply(this, arguments);
|
|
166
133
|
}
|
|
167
|
-
|
|
168
134
|
function getMipLevels(_ref) {
|
|
169
135
|
var width = _ref.width,
|
|
170
|
-
|
|
136
|
+
height = _ref.height;
|
|
171
137
|
return 1 + Math.floor(Math.log2(Math.max(width, height)));
|
|
172
138
|
}
|
|
173
139
|
//# sourceMappingURL=load-image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"load-image.js","names":["loadImage","getUrl","options","getImageUrls","imageUrls","deepLoad","parseImage","urlOptions","mipLevels","image","getMipmappedImageUrls","generateUrl","urls","url","lod","shallowLoad","getImageSize","width","height","getMipLevels","push","assert","mipLevel","length","Math","floor","log2","max"],"sources":["../../../../src/lib/texture-api/load-image.ts"],"sourcesContent":["import {assert} from '@loaders.gl/loader-utils';\nimport parseImage from '../parsers/parse-image';\nimport {getImageSize} from '../category-api/parsed-image-api';\nimport {generateUrl} from './generate-url';\nimport {deepLoad, shallowLoad} from './deep-load';\n\nexport async function loadImage(getUrl, options = {}) {\n const imageUrls = await getImageUrls(getUrl, options);\n return await deepLoad(imageUrls, parseImage, options);\n}\n\nexport async function getImageUrls(getUrl, options, urlOptions = {}) {\n const mipLevels = (options && options.image && options.image.mipLevels) || 0;\n return mipLevels !== 0\n ? await getMipmappedImageUrls(getUrl, mipLevels, options, urlOptions)\n : generateUrl(getUrl, options, urlOptions);\n}\n\nasync function getMipmappedImageUrls(getUrl, mipLevels, options, urlOptions) {\n const urls: string[] = [];\n\n // If no mip levels supplied, we need to load the level 0 image and calculate based on size\n if (mipLevels === 'auto') {\n const url = generateUrl(getUrl, options, {...urlOptions, lod: 0});\n const image = await shallowLoad(url, parseImage, options);\n\n const {width, height} = getImageSize(image);\n mipLevels = getMipLevels({width, height});\n\n // TODO - push image and make `deepLoad` pass through non-url values, avoid loading twice?\n urls.push(url);\n }\n\n // We now know how many mipLevels we need, remaining image urls can now be constructed\n assert(mipLevels > 0);\n\n for (let mipLevel = urls.length; mipLevel < mipLevels; ++mipLevel) {\n const url = generateUrl(getUrl, options, {...urlOptions, lod: mipLevel});\n urls.push(url);\n }\n\n return urls;\n}\n\n// Calculates number of mipmaps based on texture size (log2)\nexport function getMipLevels({width, height}) {\n return 1 + Math.floor(Math.log2(Math.max(width, height)));\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAAkD;AAAA;AAAA,SAE5BA,SAAS;EAAA;AAAA;AAAA;EAAA,uEAAxB,iBAAyBC,MAAM;IAAA;MAAA;MAAA;IAAA;MAAA;QAAA;UAAA;YAAEC,OAAO,2DAAG,CAAC,CAAC;YAAA;YAAA,OAC1BC,YAAY,CAACF,MAAM,EAAEC,OAAO,CAAC;UAAA;YAA/CE,SAAS;YAAA;YAAA,OACF,IAAAC,kBAAQ,EAACD,SAAS,EAAEE,mBAAU,EAAEJ,OAAO,CAAC;UAAA;YAAA;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACtD;EAAA;AAAA;AAAA,SAEqBC,YAAY;EAAA;AAAA;AAAA;EAAA,0EAA3B,kBAA4BF,MAAM,EAAEC,OAAO;IAAA;MAAA;MAAA;IAAA;MAAA;QAAA;UAAA;YAAEK,UAAU,8DAAG,CAAC,CAAC;YAC3DC,SAAS,GAAIN,OAAO,IAAIA,OAAO,CAACO,KAAK,IAAIP,OAAO,CAACO,KAAK,CAACD,SAAS,IAAK,CAAC;YAAA,MACrEA,SAAS,KAAK,CAAC;cAAA;cAAA;YAAA;YAAA;YAAA,OACZE,qBAAqB,CAACT,MAAM,EAAEO,SAAS,EAAEN,OAAO,EAAEK,UAAU,CAAC;UAAA;YAAA;YAAA;YAAA;UAAA;YAAA,eACnE,IAAAI,wBAAW,EAACV,MAAM,EAAEC,OAAO,EAAEK,UAAU,CAAC;UAAA;YAAA;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAC7C;EAAA;AAAA;AAAA,SAEcG,qBAAqB;EAAA;AAAA;AAAA;EAAA,mFAApC,kBAAqCT,MAAM,EAAEO,SAAS,EAAEN,OAAO,EAAEK,UAAU;IAAA;IAAA;MAAA;QAAA;UAAA;YACnEK,IAAc,GAAG,EAAE;YAAA,MAGrBJ,SAAS,KAAK,MAAM;cAAA;cAAA;YAAA;YAChBK,GAAG,GAAG,IAAAF,wBAAW,EAACV,MAAM,EAAEC,OAAO,kCAAMK,UAAU;cAAEO,GAAG,EAAE;YAAC,GAAE;YAAA;YAAA,OAC7C,IAAAC,qBAAW,EAACF,GAAG,EAAEP,mBAAU,EAAEJ,OAAO,CAAC;UAAA;YAAnDO,KAAK;YAAA,gBAEa,IAAAO,4BAAY,EAACP,KAAK,CAAC,EAApCQ,KAAK,iBAALA,KAAK,EAAEC,MAAM,iBAANA,MAAM;YACpBV,SAAS,GAAGW,YAAY,CAAC;cAACF,KAAK,EAALA,KAAK;cAAEC,MAAM,EAANA;YAAM,CAAC,CAAC;;YAGzCN,IAAI,CAACQ,IAAI,CAACP,GAAG,CAAC;UAAC;YAIjB,IAAAQ,mBAAM,EAACb,SAAS,GAAG,CAAC,CAAC;YAErB,KAASc,QAAQ,GAAGV,IAAI,CAACW,MAAM,EAAED,QAAQ,GAAGd,SAAS,EAAE,EAAEc,QAAQ,EAAE;cAC3DT,IAAG,GAAG,IAAAF,wBAAW,EAACV,MAAM,EAAEC,OAAO,kCAAMK,UAAU;gBAAEO,GAAG,EAAEQ;cAAQ,GAAE;cACxEV,IAAI,CAACQ,IAAI,CAACP,IAAG,CAAC;YAChB;YAAC,kCAEMD,IAAI;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACZ;EAAA;AAAA;AAGM,SAASO,YAAY,OAAkB;EAAA,IAAhBF,KAAK,QAALA,KAAK;IAAEC,MAAM,QAANA,MAAM;EACzC,OAAO,CAAC,GAAGM,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,IAAI,CAACF,IAAI,CAACG,GAAG,CAACV,KAAK,EAAEC,MAAM,CAAC,CAAC,CAAC;AAC3D"}
|
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VERSION = void 0;
|
|
7
|
-
var VERSION = typeof "3.3.0-alpha.
|
|
7
|
+
var VERSION = typeof "3.3.0-alpha.6" !== 'undefined' ? "3.3.0-alpha.6" : 'latest';
|
|
8
8
|
exports.VERSION = VERSION;
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"version.js","names":["VERSION"],"sources":["../../../../src/lib/utils/version.ts"],"sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n"],"mappings":";;;;;;AAGO,IAAMA,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAAC"}
|
package/dist/es5/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["/**\n * data images\n */\nexport type ImageDataType = {\n data: Uint8Array;\n width: number;\n height: number;\n compressed?: boolean;\n};\n\n/**\n * Supported Image Types\n */\nexport type ImageType = ImageBitmap | typeof Image | ImageDataType;\n\n/**\n * Image type string used to control or determine the type of images returned from ImageLoader\n */\nexport type ImageTypeEnum = 'imagebitmap' | 'image' | 'data';\n"],"mappings":""}
|
package/dist/esm/bundle.js
CHANGED
package/dist/esm/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":";AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAS,CAAC;AACxCC,UAAU,CAACC,OAAO,GAAGD,UAAU,CAACC,OAAO,IAAI,CAAC,CAAC;AAC7CC,MAAM,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACL,UAAU,CAACC,OAAO,EAAEH,aAAa,CAAC"}
|
package/dist/esm/image-loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"image-loader.js","names":["VERSION","parseImage","getBinaryImageMetadata","EXTENSIONS","MIME_TYPES","DEFAULT_IMAGE_LOADER_OPTIONS","image","type","decode","ImageLoader","id","module","name","version","mimeTypes","extensions","parse","tests","arrayBuffer","Boolean","DataView","options","_typecheckImageLoader"],"sources":["../../src/image-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {VERSION} from './lib/utils/version';\nimport parseImage from './lib/parsers/parse-image';\nimport {getBinaryImageMetadata} from './lib/category-api/binary-image-api';\n\nconst EXTENSIONS = ['png', 'jpg', 'jpeg', 'gif', 'webp', 'bmp', 'ico', 'svg'];\nconst MIME_TYPES = [\n 'image/png',\n 'image/jpeg',\n 'image/gif',\n 'image/webp',\n 'image/bmp',\n 'image/vnd.microsoft.icon',\n 'image/svg+xml'\n];\n\nexport type ImageLoaderOptions = LoaderOptions & {\n image?: {\n type?: 'auto' | 'data' | 'imagebitmap' | 'image';\n decode?: boolean;\n };\n imagebitmap?: ImageBitmapOptions;\n};\n\nconst DEFAULT_IMAGE_LOADER_OPTIONS: ImageLoaderOptions = {\n image: {\n type: 'auto',\n decode: true // if format is HTML\n }\n // imagebitmap: {} - passes (platform dependent) parameters to ImageBitmap constructor\n};\n\n/**\n * Loads a platform-specific image type\n * Note: This type can be used as input data to WebGL texture creation\n */\nexport const ImageLoader = {\n id: 'image',\n module: 'images',\n name: 'Images',\n version: VERSION,\n mimeTypes: MIME_TYPES,\n extensions: EXTENSIONS,\n parse: parseImage,\n // TODO: byteOffset, byteLength;\n tests: [(arrayBuffer) => Boolean(getBinaryImageMetadata(new DataView(arrayBuffer)))],\n options: DEFAULT_IMAGE_LOADER_OPTIONS\n};\n\nexport const _typecheckImageLoader: LoaderWithParser = ImageLoader;\n"],"mappings":"AACA,SAAQA,OAAO,QAAO,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,2BAA2B;AAClD,SAAQC,sBAAsB,QAAO,qCAAqC;AAE1E,MAAMC,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AAC7E,MAAMC,UAAU,GAAG,CACjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,0BAA0B,EAC1B,eAAe,CAChB;AAUD,MAAMC,4BAAgD,GAAG;EACvDC,KAAK,EAAE;IACLC,IAAI,EAAE,MAAM;IACZC,MAAM,EAAE;EACV;AAEF,CAAC;;AAMD,OAAO,MAAMC,WAAW,GAAG;EACzBC,EAAE,EAAE,OAAO;EACXC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,QAAQ;EACdC,OAAO,EAAEb,OAAO;EAChBc,SAAS,EAAEV,UAAU;EACrBW,UAAU,EAAEZ,UAAU;EACtBa,KAAK,EAAEf,UAAU;EAEjBgB,KAAK,EAAE,CAAEC,WAAW,IAAKC,OAAO,CAACjB,sBAAsB,CAAC,IAAIkB,QAAQ,CAACF,WAAW,CAAC,CAAC,CAAC,CAAC;EACpFG,OAAO,EAAEhB;AACX,CAAC;AAED,OAAO,MAAMiB,qBAAuC,GAAGb,WAAW"}
|
package/dist/esm/image-writer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"image-writer.js","names":["VERSION","encodeImage","ImageWriter","name","id","module","version","extensions","options","image","mimeType","jpegQuality","encode"],"sources":["../../src/image-writer.ts"],"sourcesContent":["// import type {Writer} from '@loaders.gl/loader-utils';\nimport {VERSION} from './lib/utils/version';\nimport {encodeImage} from './lib/encoders/encode-image';\n\nexport const ImageWriter = {\n name: 'Images',\n id: 'image',\n module: 'images',\n version: VERSION,\n extensions: ['jpeg'],\n options: {\n image: {\n mimeType: 'image/png',\n jpegQuality: null\n }\n },\n encode: encodeImage\n};\n"],"mappings":";AACA,SAAQA,OAAO,QAAO,qBAAqB;AAC3C,SAAQC,WAAW,QAAO,6BAA6B;AAEvD,OAAO,MAAMC,WAAW,GAAG;EACzBC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,OAAO;EACXC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAEN,OAAO;EAChBO,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE;IACPC,KAAK,EAAE;MACLC,QAAQ,EAAE,WAAW;MACrBC,WAAW,EAAE;IACf;EACF,CAAC;EACDC,MAAM,EAAEX;AACV,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
export { ImageLoader } from './image-loader';
|
|
2
4
|
export { ImageWriter } from './image-writer';
|
|
5
|
+
|
|
3
6
|
export { getBinaryImageMetadata } from './lib/category-api/binary-image-api';
|
|
7
|
+
|
|
4
8
|
export { isImageTypeSupported, getDefaultImageType } from './lib/category-api/image-type';
|
|
5
9
|
export { isImage, getImageType, getImageSize, getImageData } from './lib/category-api/parsed-image-api';
|
|
10
|
+
|
|
6
11
|
export { _isImageFormatSupported } from './lib/category-api/image-format';
|
|
12
|
+
|
|
7
13
|
export { loadImage } from './lib/texture-api/load-image';
|
|
8
14
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["ImageLoader","ImageWriter","getBinaryImageMetadata","isImageTypeSupported","getDefaultImageType","isImage","getImageType","getImageSize","getImageData","_isImageFormatSupported","loadImage"],"sources":["../../src/index.ts"],"sourcesContent":["// TYPES\nexport type {ImageDataType, ImageType, ImageTypeEnum} from './types';\nexport type {ImageLoaderOptions} from './image-loader';\n\n// LOADERS AND WRITERS\nexport {ImageLoader} from './image-loader';\nexport {ImageWriter} from './image-writer';\n\n// IMAGE CATEGORY API\n\n// Binary Image API\nexport {getBinaryImageMetadata} from './lib/category-api/binary-image-api';\n\n// Parsed Image API\nexport {isImageTypeSupported, getDefaultImageType} from './lib/category-api/image-type';\n\nexport {\n isImage,\n getImageType,\n getImageSize,\n getImageData\n} from './lib/category-api/parsed-image-api';\n\n// EXPERIMENTAL\nexport {_isImageFormatSupported} from './lib/category-api/image-format';\n\n// DEPRECATED - Remove in V3 (fix dependency in luma.gl)\nexport {loadImage} from './lib/texture-api/load-image';\n"],"mappings":";;AAKA,SAAQA,WAAW,QAAO,gBAAgB;AAC1C,SAAQC,WAAW,QAAO,gBAAgB;;AAK1C,SAAQC,sBAAsB,QAAO,qCAAqC;;AAG1E,SAAQC,oBAAoB,EAAEC,mBAAmB,QAAO,+BAA+B;AAEvF,SACEC,OAAO,EACPC,YAAY,EACZC,YAAY,EACZC,YAAY,QACP,qCAAqC;;AAG5C,SAAQC,uBAAuB,QAAO,iCAAiC;;AAGvE,SAAQC,SAAS,QAAO,8BAA8B"}
|