ol 10.2.2-dev.1727979328194 → 10.2.2-dev.1728458917595
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/Map.d.ts.map +1 -1
- package/Map.js +4 -2
- package/dist/ol.js +1 -1
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/reproj/DataTile.d.ts.map +1 -1
- package/reproj/DataTile.js +1 -0
- package/reproj/glreproj.d.ts +7 -1
- package/reproj/glreproj.d.ts.map +1 -1
- package/reproj/glreproj.js +24 -1
- package/util.js +1 -1
package/package.json
CHANGED
package/reproj/DataTile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTile.d.ts","sourceRoot":"","sources":["DataTile.js"],"names":[],"mappings":";yBAsBa,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAI,OAAO,gBAAgB,EAAE,OAAO;;;;;UAK1E,QAAQ;;;;YACR,MAAM;;;;;;gBAKN,OAAO,uBAAuB,EAAE,OAAO;;;;oBACvC,OAAO,yBAAyB,EAAE,OAAO;;;;gBACzC,OAAO,uBAAuB,EAAE,OAAO;;;;oBACvC,OAAO,yBAAyB,EAAE,OAAO;;;;eACzC,OAAO,iBAAiB,EAAE,SAAS;;;;;;;;gBAEnC,MAAM;;;;YACN,MAAM;;;;qBACN,UAAU;;;;;;;;;;;;;;;;;;;;AApBxB;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;GAKG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAgOjB;IAtNC;;;OAGG;IACH,qBACiE;IAEjE;;;OAGG;IACH,oBAAqC;IAErC;;;OAGG;IACH,gBAA6B;IAE7B;;;OAGG;IACH,oBAAuB;IAEvB;;;OAGG;IACH,qBAAwB;IAExB;;;OAGG;IACH,oBAA4B;IAE5B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GG;IACH,oBAIwB;IAmDxB;;;OAGG;IACH,uBAOC;IAgGH;;OAEG;IACH,mBAuMC;IAqDD;;OAEG;IACH,yBAGC;CACF;qBAxjByD,gBAAgB"}
|
package/reproj/DataTile.js
CHANGED
package/reproj/glreproj.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export function releaseGLCanvas(gl: WebGLRenderingContext): void;
|
|
|
16
16
|
/**
|
|
17
17
|
* @typedef {Object} ImageExtent
|
|
18
18
|
* @property {import("../extent.js").Extent} extent Extent.
|
|
19
|
+
* @property {import("../extent.js").Extent} [clipExtent] Clip extent.
|
|
19
20
|
* @property {WebGLTexture} texture Texture.
|
|
20
21
|
* @property {number} width Width of texture.
|
|
21
22
|
* @property {number} height Height of texture.
|
|
@@ -37,9 +38,10 @@ export function releaseGLCanvas(gl: WebGLRenderingContext): void;
|
|
|
37
38
|
* TODO: Allow setting renderEdges value in the data as this is done in "data-space".
|
|
38
39
|
* @param {boolean | Array<number>} [renderEdges] Render reprojection edges.
|
|
39
40
|
* @param {boolean} [interpolate] Use linear interpolation when resampling.
|
|
41
|
+
* @param {boolean} [drawSingle] Draw single source images directly without stitchTexture.
|
|
40
42
|
* @return {{framebuffer: WebGLFramebuffer, width: number, height: number, texture: WebGLTexture}} Canvas with reprojected data.
|
|
41
43
|
*/
|
|
42
|
-
export function render(gl: WebGLRenderingContext, width_: number, height_: number, pixelRatio: number, sourceResolution: number, targetResolution: number, targetExtent: import("../extent.js").Extent, triangulation: import("../reproj/Triangulation.js").default, sources: Array<ImageExtent>, gutter: number, dataType: number, renderEdges?: boolean | number[] | undefined, interpolate?: boolean | undefined): {
|
|
44
|
+
export function render(gl: WebGLRenderingContext, width_: number, height_: number, pixelRatio: number, sourceResolution: number, targetResolution: number, targetExtent: import("../extent.js").Extent, triangulation: import("../reproj/Triangulation.js").default, sources: Array<ImageExtent>, gutter: number, dataType: number, renderEdges?: boolean | number[] | undefined, interpolate?: boolean | undefined, drawSingle?: boolean | undefined): {
|
|
43
45
|
framebuffer: WebGLFramebuffer;
|
|
44
46
|
width: number;
|
|
45
47
|
height: number;
|
|
@@ -54,6 +56,10 @@ export type ImageExtent = {
|
|
|
54
56
|
* Extent.
|
|
55
57
|
*/
|
|
56
58
|
extent: import("../extent.js").Extent;
|
|
59
|
+
/**
|
|
60
|
+
* Clip extent.
|
|
61
|
+
*/
|
|
62
|
+
clipExtent?: import("../extent.js").Extent | undefined;
|
|
57
63
|
/**
|
|
58
64
|
* Texture.
|
|
59
65
|
*/
|
package/reproj/glreproj.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glreproj.d.ts","sourceRoot":"","sources":["glreproj.js"],"names":[],"mappings":"AA4DA;;;;;;;GAOG;AACH,oNAFY,qBAAqB,CAsBhC;AAED;;;;GAIG;AACH,oCAFW,qBAAqB,QAO/B;AAOD
|
|
1
|
+
{"version":3,"file":"glreproj.d.ts","sourceRoot":"","sources":["glreproj.js"],"names":[],"mappings":"AA4DA;;;;;;;GAOG;AACH,oNAFY,qBAAqB,CAsBhC;AAED;;;;GAIG;AACH,oCAFW,qBAAqB,QAO/B;AAOD;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,2BAjBW,qBAAqB,UACrB,MAAM,WACN,MAAM,cACN,MAAM,oBACN,MAAM,oBACN,MAAM,gBACN,OAAO,cAAc,EAAE,MAAM,iBAC7B,OAAO,4BAA4B,EAAE,OAAO,WAC5C,KAAK,CAAC,WAAW,CAAC,UAClB,MAAM,YACN,MAAM,sHAKL;IAAC,WAAW,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAC,CA8UhG;AA9WD;;GAEG;AACH,2BAFU,KAAK,CAAC,iBAAiB,GAAG,eAAe,CAAC,CAErB;;;;;YAIjB,OAAO,cAAc,EAAE,MAAM;;;;;;;;aAE7B,YAAY;;;;WACZ,MAAM;;;;YACN,MAAM"}
|
package/reproj/glreproj.js
CHANGED
|
@@ -108,6 +108,7 @@ export const canvasGLPool = [];
|
|
|
108
108
|
/**
|
|
109
109
|
* @typedef {Object} ImageExtent
|
|
110
110
|
* @property {import("../extent.js").Extent} extent Extent.
|
|
111
|
+
* @property {import("../extent.js").Extent} [clipExtent] Clip extent.
|
|
111
112
|
* @property {WebGLTexture} texture Texture.
|
|
112
113
|
* @property {number} width Width of texture.
|
|
113
114
|
* @property {number} height Height of texture.
|
|
@@ -130,6 +131,7 @@ export const canvasGLPool = [];
|
|
|
130
131
|
* TODO: Allow setting renderEdges value in the data as this is done in "data-space".
|
|
131
132
|
* @param {boolean | Array<number>} [renderEdges] Render reprojection edges.
|
|
132
133
|
* @param {boolean} [interpolate] Use linear interpolation when resampling.
|
|
134
|
+
* @param {boolean} [drawSingle] Draw single source images directly without stitchTexture.
|
|
133
135
|
* @return {{framebuffer: WebGLFramebuffer, width: number, height: number, texture: WebGLTexture}} Canvas with reprojected data.
|
|
134
136
|
*/
|
|
135
137
|
export function render(
|
|
@@ -146,6 +148,7 @@ export function render(
|
|
|
146
148
|
dataType,
|
|
147
149
|
renderEdges,
|
|
148
150
|
interpolate,
|
|
151
|
+
drawSingle,
|
|
149
152
|
) {
|
|
150
153
|
const width = Math.round(pixelRatio * width_);
|
|
151
154
|
const height = Math.round(pixelRatio * height_);
|
|
@@ -221,7 +224,7 @@ export function render(
|
|
|
221
224
|
let stitchHeight;
|
|
222
225
|
const stitchScale = 1 / sourceResolution;
|
|
223
226
|
|
|
224
|
-
if (sources.length !== 1 || gutter !== 0) {
|
|
227
|
+
if (!drawSingle || sources.length !== 1 || gutter !== 0) {
|
|
225
228
|
stitchTexture = gl.createTexture();
|
|
226
229
|
if (resultTexture === null) {
|
|
227
230
|
throw new Error('Could not create texture');
|
|
@@ -281,6 +284,24 @@ export function render(
|
|
|
281
284
|
gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
|
|
282
285
|
gl.viewport(0, 0, stitchWidthFixed, stitchHeightFixed);
|
|
283
286
|
|
|
287
|
+
if (src.clipExtent) {
|
|
288
|
+
const xPos =
|
|
289
|
+
(src.clipExtent[0] - sourceDataExtent[0]) * stitchScale * scaleFactor;
|
|
290
|
+
const yPos =
|
|
291
|
+
-(src.clipExtent[3] - sourceDataExtent[3]) *
|
|
292
|
+
stitchScale *
|
|
293
|
+
scaleFactor;
|
|
294
|
+
const width = getWidth(src.clipExtent) * stitchScale * scaleFactor;
|
|
295
|
+
const height = getHeight(src.clipExtent) * stitchScale * scaleFactor;
|
|
296
|
+
gl.enable(gl.SCISSOR_TEST);
|
|
297
|
+
gl.scissor(
|
|
298
|
+
interpolate ? xPos : Math.round(xPos),
|
|
299
|
+
interpolate ? yPos : Math.round(yPos),
|
|
300
|
+
interpolate ? width : Math.round(xPos + width) - Math.round(xPos),
|
|
301
|
+
interpolate ? height : Math.round(yPos + height) - Math.round(yPos),
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
284
305
|
webGLCanvas.drawImage(
|
|
285
306
|
src.texture,
|
|
286
307
|
src.width,
|
|
@@ -298,6 +319,8 @@ export function render(
|
|
|
298
319
|
stitchWidthFixed,
|
|
299
320
|
stitchHeightFixed,
|
|
300
321
|
);
|
|
322
|
+
|
|
323
|
+
gl.disable(gl.SCISSOR_TEST);
|
|
301
324
|
});
|
|
302
325
|
gl.deleteFramebuffer(fb);
|
|
303
326
|
} else {
|
package/util.js
CHANGED