@fxi/zartigl 0.10.5 → 0.11.1

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/engine.d.ts CHANGED
@@ -178,7 +178,10 @@ export declare function createColorRampTexture(gl: WebGL2RenderingContext, ramp?
178
178
  alphaFade?: AlphaFade;
179
179
  }): WebGLTexture;
180
180
 
181
- /** The frame source decoding `manifest`: scalar or vector by its encoding. */
181
+ /**
182
+ * The frame source decoding `manifest`: scalar or vector by its encoding.
183
+ * Scalar frames decode through WebCodecs where the browser supports it.
184
+ */
182
185
  export declare function createGeoVideoFrameSource(manifest: GeoVideoManifest, options?: {
183
186
  cacheSize?: number;
184
187
  }): GeoVideoScalarSource | GeoVideoVectorSource;
@@ -366,6 +369,8 @@ export declare class GeoVideoClock {
366
369
  /** Playhead, epoch ms. Assigning it also resets a terminal step's hold. */
367
370
  get ms(): number;
368
371
  set ms(value: number);
372
+ /** Progress through the final sample's held step, 0 elsewhere. */
373
+ get holdFraction(): number;
369
374
  /** Playback held, e.g. while a timeline thumb is held. */
370
375
  held: boolean;
371
376
  private playingValue;
@@ -381,6 +386,49 @@ export declare class GeoVideoClock {
381
386
  advance(dt: number, times: ArrayLike<number>, stepsPerSecond: number, range?: readonly [number, number], loop?: boolean, holdLastStep?: boolean): boolean;
382
387
  }
383
388
 
389
+ /**
390
+ * Scalar-luma GeoVideo decoded with WebCodecs, in decode order: playback
391
+ * feeds the decoder sample after sample instead of seeking a video element,
392
+ * which redecodes from the previous keyframe at every step. A step behind
393
+ * the last one taken, or past a later keyframe, restarts at its keyframe.
394
+ * Frames stay images, decoded on the GPU by GEOVIDEO_SCALAR_GLSL like those
395
+ * of GeoVideoScalarSource, which serves browsers without WebCodecs for the
396
+ * codec.
397
+ */
398
+ export declare class GeoVideoCodecScalarSource extends GeoVideoScalarSource {
399
+ private track;
400
+ private data;
401
+ /** Decode-order sample presenting each video frame. */
402
+ private sampleOfFrame;
403
+ private decoder;
404
+ /** Next sample (decode order) to feed; -1 when the decoder needs a reset. */
405
+ private fed;
406
+ /** Last video frame handed out; later frames can still be reached. */
407
+ private taken;
408
+ /** Decoded frames not taken yet, by video frame. */
409
+ private readonly outputs;
410
+ private progress;
411
+ private failure;
412
+ /** Aborts the media download of the current load on release. */
413
+ private loading;
414
+ /** True once the media decodes through WebCodecs. */
415
+ get usesWebCodecs(): boolean;
416
+ protected loadMedia(): Promise<void>;
417
+ release(): void;
418
+ protected decode(index: number, signal: AbortSignal): Promise<GeoVideoScalarFrame>;
419
+ private config;
420
+ /** Video frame `frame`, owned by the caller. */
421
+ private decodeFrame;
422
+ private dropOutputsBefore;
423
+ private keySample;
424
+ private restart;
425
+ private feed;
426
+ /** Next output, dequeue or error; a timer for decoders without events. */
427
+ private waitProgress;
428
+ private notify;
429
+ private closeDecoder;
430
+ }
431
+
384
432
  /**
385
433
  * GeoVideo frames as textures, decoded ahead of the playhead: vector frames
386
434
  * as float (u, v, validity, 0), scalar frames as the browser decodes them,
@@ -416,6 +464,8 @@ export declare class GeoVideoField {
416
464
  get maxSpeed(): number;
417
465
  /** Resolves once the step at `ms` is uploaded. */
418
466
  prime(ms: number): Promise<void>;
467
+ /** The uploaded texture of the step at `ms`, or null. */
468
+ texture(ms: number): WebGLTexture | null;
419
469
  /** True once the frames interpolated at `ms` are uploaded. */
420
470
  ready(ms: number): boolean;
421
471
  /**
@@ -530,7 +580,8 @@ export declare abstract class GeoVideoFrameSource<TFrame> {
530
580
  private drop;
531
581
  private load;
532
582
  private loadMask;
533
- private loadVideo;
583
+ /** Open the media; the default reads frames by seeking a video element. */
584
+ protected loadMedia(): Promise<void>;
534
585
  /** Seek to a frame and wait until it is presented. */
535
586
  private presentFrame;
536
587
  /**
@@ -539,6 +590,8 @@ export declare abstract class GeoVideoFrameSource<TFrame> {
539
590
  * playback would otherwise buffer far beyond the requested frame.
540
591
  */
541
592
  private primeDecoder;
593
+ /** Media time inside the video frame showing step `index`. */
594
+ protected stepSeconds(index: number): number;
542
595
  /**
543
596
  * Seek and capture one step. `signal` aborts it between steps; a seek
544
597
  * already started completes first, keeping the queue serial.
@@ -667,6 +720,12 @@ export declare class GeoVideoPlayback {
667
720
  constructor(options: GeoVideoPlaybackOptions, repaint: () => void, emit: <K extends keyof GeoVideoPlaybackEvents>(event: K, ...args: Parameters<GeoVideoPlaybackEvents[K]>) => void);
668
721
  load(gl: WebGL2RenderingContext, manifest: GeoVideoManifest): Promise<void>;
669
722
  sample(now: number): readonly [WebGLTexture, WebGLTexture, number] | null;
723
+ /**
724
+ * Through the final step of a chunk followed by a decoded one, the last
725
+ * frame blends into the next chunk's first, as steps do within a chunk:
726
+ * the chunk swap then lands on the frame already shown.
727
+ */
728
+ private handoff;
670
729
  get time(): number;
671
730
  get preloadedMediaUrl(): string | undefined;
672
731
  setStepsPerSecond(value: number): void;
package/dist/engine.js CHANGED
@@ -1,63 +1,64 @@
1
- import { K as o, L as s, G as r, M as i, j as d, N as t, O as G, P as c, Q as l, m as V, R as n, S as L, U as S, T as C, V as u, W as m, X as O, Y as _, b as p, Z as R, c as A, _ as T, $ as x, n as g, B as k, F, a0 as I, a1 as h, p as v, x as D, u as E, C as f, E as B, o as b, D as N, a2 as P, a3 as y, a4 as M, a5 as W, q as U, a6 as H, a7 as K, a8 as Y, H as j, a9 as q, aa as J, J as Q, v as X, ab as Z } from "./engine--787AbnI.js";
2
- import { B as w, a as z, f as aa, b as ea, e as oa, c as sa, g as ra, i as ia, r as da, d as ta } from "./backdrop-Dceb4d8E.js";
1
+ import { K as o, L as s, G as r, M as i, j as d, N as G, O as c, P as t, Q as l, R as V, m as n, S, U as C, V as L, T as u, W as m, X as O, Y as _, Z as p, b as R, _ as A, c as T, $ as x, a0 as g, n as k, B as F, F as I, a1 as h, a2 as v, p as D, x as E, u as f, C as B, E as b, o as N, D as P, a3 as y, a4 as M, a5 as W, a6 as U, q as H, a7 as K, a8 as Y, a9 as j, H as q, aa as J, ab as Q, J as X, v as Z, ac as $ } from "./engine-BBxJ6x3s.js";
2
+ import { B as z, a as aa, f as ea, b as oa, e as sa, c as ra, g as ia, i as da, r as Ga, d as ca } from "./backdrop-Dceb4d8E.js";
3
3
  export {
4
- w as BACKDROP_OFF,
4
+ z as BACKDROP_OFF,
5
5
  o as COLOR_GRADE_GLSL,
6
- z as COLOR_GRADE_OFF,
7
- aa as COLOR_GRADE_VIBRANT,
6
+ aa as COLOR_GRADE_OFF,
7
+ ea as COLOR_GRADE_VIBRANT,
8
8
  s as GEOVIDEO_SCALAR_GLSL,
9
9
  r as GLOW_GAIN,
10
10
  i as GLOW_GLSL,
11
11
  d as GLOW_SCALE,
12
- t as GeoVideoArchiveSource,
13
- G as GeoVideoClock,
14
- c as GeoVideoField,
15
- l as GeoVideoFrameSource,
16
- V as GeoVideoPlayback,
17
- n as GeoVideoScalarSource,
18
- L as GeoVideoVectorSource,
19
- S as RANDOM_GLSL,
20
- C as TrailFade,
21
- u as VELOCITY_BLEND_GLSL,
22
- m as VIBRANCE_GLSL,
23
- O as alphaFadeAt,
24
- _ as assertGeoVideoIndexIdentity,
25
- ea as backdropVec4,
26
- oa as colorGradeToGrade,
27
- sa as colorGradeVec4,
28
- p as createColorRampTexture,
29
- R as createGeoVideoFrameSource,
30
- A as createProgram,
31
- T as createShader,
32
- x as fadeToFrames,
33
- g as fadeToOpacity,
34
- k as formatUnit,
35
- F as geoVideoChunkSources,
36
- I as geoVideoGrid,
37
- h as geoVideoIndexChunks,
38
- v as geoVideoScalarUniforms,
39
- D as geoVideoTimelineValues,
40
- E as getPalettes,
41
- ra as gradeToColorGrade,
42
- f as isGeoVideoArchiveSource,
43
- ia as isHexColor,
44
- B as loadGeoVideoIndex,
45
- b as loadGeoVideoManifest,
46
- N as nextChunk,
47
- P as nextChunkSpan,
48
- y as pairChunk,
49
- M as pairChunkSpan,
50
- W as parseTimeRange,
51
- da as resolveBackdrop,
52
- ta as resolveColorGrade,
53
- U as resolveColorRamp,
54
- H as stepTime,
55
- K as subtractIsoDuration,
56
- Y as timeBracket,
57
- j as timeRangeBounds,
58
- q as timeStep,
59
- J as validateGeoVideoIndex,
60
- Q as validateGeoVideoManifest,
61
- X as validateScalarColorDomain,
62
- Z as velocityTexels
12
+ G as GeoVideoArchiveSource,
13
+ c as GeoVideoClock,
14
+ t as GeoVideoCodecScalarSource,
15
+ l as GeoVideoField,
16
+ V as GeoVideoFrameSource,
17
+ n as GeoVideoPlayback,
18
+ S as GeoVideoScalarSource,
19
+ C as GeoVideoVectorSource,
20
+ L as RANDOM_GLSL,
21
+ u as TrailFade,
22
+ m as VELOCITY_BLEND_GLSL,
23
+ O as VIBRANCE_GLSL,
24
+ _ as alphaFadeAt,
25
+ p as assertGeoVideoIndexIdentity,
26
+ oa as backdropVec4,
27
+ sa as colorGradeToGrade,
28
+ ra as colorGradeVec4,
29
+ R as createColorRampTexture,
30
+ A as createGeoVideoFrameSource,
31
+ T as createProgram,
32
+ x as createShader,
33
+ g as fadeToFrames,
34
+ k as fadeToOpacity,
35
+ F as formatUnit,
36
+ I as geoVideoChunkSources,
37
+ h as geoVideoGrid,
38
+ v as geoVideoIndexChunks,
39
+ D as geoVideoScalarUniforms,
40
+ E as geoVideoTimelineValues,
41
+ f as getPalettes,
42
+ ia as gradeToColorGrade,
43
+ B as isGeoVideoArchiveSource,
44
+ da as isHexColor,
45
+ b as loadGeoVideoIndex,
46
+ N as loadGeoVideoManifest,
47
+ P as nextChunk,
48
+ y as nextChunkSpan,
49
+ M as pairChunk,
50
+ W as pairChunkSpan,
51
+ U as parseTimeRange,
52
+ Ga as resolveBackdrop,
53
+ ca as resolveColorGrade,
54
+ H as resolveColorRamp,
55
+ K as stepTime,
56
+ Y as subtractIsoDuration,
57
+ j as timeBracket,
58
+ q as timeRangeBounds,
59
+ J as timeStep,
60
+ Q as validateGeoVideoIndex,
61
+ X as validateGeoVideoManifest,
62
+ Z as validateScalarColorDomain,
63
+ $ as velocityTexels
63
64
  };
@@ -191,7 +191,7 @@ function _e(e, a, o = {}) {
191
191
  }
192
192
  return A(s);
193
193
  }
194
- const S = "0.10.5", N = { "maplibre-gl": "^5.17.0" }, le = {
194
+ const S = "0.11.1", N = { "maplibre-gl": "^5.17.0" }, le = {
195
195
  version: S,
196
196
  devDependencies: N
197
197
  }, F = "https://sos-ch-gva-2.exo.io/mapx-zartigl/catalog/v2/catalog.json";
package/dist/zartigl.js CHANGED
@@ -1,6 +1,6 @@
1
- import { m as WA, p as yB, s as rB, a as rg, b as ng, r as OI, c as RC, d as UA, e as dC, f as nB, g as UC } from "./index-Bo7du_KN.js";
2
- import { T as lC, g as LC, r as kC, d as JC, c as wA, a as MC, b as iI, e as KC, f as mA, h as SI, i as aA, G as qC, j as Fg, v as YA, k as fA, s as zI, l as jI, m as FB, n as wg, o as uI, p as YC, q as pI, t as fC, u as wB, w as EA, x as cg, y as HC, z as mC, A as uC, B as Sg, C as QI, D as pC, E as xC, F as TC, H as WC } from "./engine--787AbnI.js";
3
- import { I as qi, J as Yi } from "./engine--787AbnI.js";
1
+ import { m as WA, p as yB, s as rB, a as rg, b as ng, r as OI, c as RC, d as UA, e as dC, f as nB, g as UC } from "./index-DKYFuzyw.js";
2
+ import { T as lC, g as LC, r as kC, d as JC, c as wA, a as MC, b as iI, e as KC, f as mA, h as SI, i as aA, G as qC, j as Fg, v as YA, k as fA, s as zI, l as jI, m as FB, n as wg, o as uI, p as YC, q as pI, t as fC, u as wB, w as EA, x as cg, y as HC, z as mC, A as uC, B as Sg, C as QI, D as pC, E as xC, F as TC, H as WC } from "./engine-BBxJ6x3s.js";
3
+ import { I as qi, J as Yi } from "./engine-BBxJ6x3s.js";
4
4
  import { B as bC, a as vC, b as PC, c as ZC, d as cB, r as SB, e as VC, g as OC } from "./backdrop-Dceb4d8E.js";
5
5
  import { f as Hi, i as mi } from "./backdrop-Dceb4d8E.js";
6
6
  const xI = 85, zC = 89.9;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fxi/zartigl",
3
- "version": "0.10.5",
3
+ "version": "0.11.1",
4
4
  "description": "MapLibre GL JS visualization for catalog-backed Zarr, WMTS, and GeoVideo data",
5
5
  "repository": {
6
6
  "type": "git",