@idetik/core 0.6.2 → 0.7.0

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/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as gl_matrix from 'gl-matrix';
2
2
  import { vec3, mat4, quat, vec4, vec2 } from 'gl-matrix';
3
+ import { Camera as Camera$1 } from '@/objects/cameras/camera';
3
4
  import { Location } from '@zarrita/core';
4
5
  import { Readable } from '@zarrita/storage';
5
6
  import * as zarr from 'zarrita';
@@ -327,6 +328,7 @@ type CullingMode = "none" | "front" | "back" | "both";
327
328
  declare abstract class RenderableObject extends Node {
328
329
  wireframeEnabled: boolean;
329
330
  wireframeColor: Color;
331
+ depthTest: boolean;
330
332
  private readonly textures_;
331
333
  private staleTextures_;
332
334
  private readonly transform_;
@@ -405,7 +407,7 @@ declare class EventDispatcher {
405
407
  }
406
408
 
407
409
  type LayerState = "initialized" | "loading" | "ready";
408
- type blendMode = "normal" | "additive" | "subtractive" | "multiply";
410
+ type blendMode = "normal" | "additive" | "subtractive" | "multiply" | "premultiplied";
409
411
  type StateChangeCallback = (newState: LayerState, prevState?: LayerState) => void;
410
412
  interface LayerOptions {
411
413
  transparent?: boolean;
@@ -439,6 +441,11 @@ declare abstract class Layer {
439
441
  protected addObject(object: RenderableObject): void;
440
442
  protected removeObject(object: RenderableObject): void;
441
443
  protected clearObjects(): void;
444
+ /**
445
+ * Get uniforms for shader program. Override in derived classes that need custom uniforms.
446
+ * @returns Object containing uniform name-value pairs
447
+ */
448
+ getUniforms(): Record<string, unknown>;
442
449
  }
443
450
 
444
451
  declare class LayerManager {
@@ -537,6 +544,7 @@ declare class ChunkStoreView {
537
544
  getTimeIndex(sliceCoords: SliceCoordinates): number;
538
545
  get lodCount(): number;
539
546
  getChunksToRender(sliceCoords: SliceCoordinates): Chunk[];
547
+ updateChunkStatesForVolume(sliceCoords: SliceCoordinates): void;
540
548
  updateChunkStates(sliceCoords: SliceCoordinates, viewport: Viewport): void;
541
549
  allVisibleLowestLODLoaded(sliceCoords: SliceCoordinates): boolean;
542
550
  get currentLOD(): number;
@@ -849,10 +857,41 @@ declare class ChunkedImageLayer extends Layer implements ChannelsEnabled {
849
857
  private releaseAndRemoveChunks;
850
858
  }
851
859
 
860
+ type VolumeLayerProps = {
861
+ source: ChunkSource;
862
+ sliceCoords: SliceCoordinates;
863
+ policy: ImageSourcePolicy;
864
+ };
852
865
  declare class VolumeLayer extends Layer {
853
866
  readonly type = "VolumeLayer";
854
- constructor();
855
- update(): void;
867
+ private readonly source_;
868
+ private readonly sliceCoords_;
869
+ private readonly currentChunks_;
870
+ private readonly pool_;
871
+ private sourcePolicy_;
872
+ private chunkStoreView_?;
873
+ private lastLoadedTime_;
874
+ private debugShowWireframes_;
875
+ debugShowDegenerateRays: boolean;
876
+ color: vec3;
877
+ samplesPerUnit: number;
878
+ maxIntensity: number;
879
+ opacityMultiplier: number;
880
+ earlyTerminationAlpha: number;
881
+ get debugShowWireframes(): boolean;
882
+ set debugShowWireframes(value: boolean);
883
+ set sourcePolicy(newPolicy: ImageSourcePolicy);
884
+ private createVolume;
885
+ constructor({ source, sliceCoords, policy }: VolumeLayerProps);
886
+ private getVolumeForChunk;
887
+ onAttached(context: IdetikContext): Promise<void>;
888
+ onDetached(_context: IdetikContext): void;
889
+ private updateChunks;
890
+ private updateVolumeChunk;
891
+ private releaseAndRemoveChunks;
892
+ update(context?: RenderContext): void;
893
+ reorderObjects(camera: Camera$1): void;
894
+ getUniforms(): Record<string, unknown>;
856
895
  }
857
896
 
858
897
  type ImageLayerProps = LayerOptions & {