UNPKG

s2maps-gpu

Version:

S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.

42 lines (41 loc) 1.42 kB
import { Color } from 'style/color/index.js'; import Workflow from './workflow.js'; import type Context from '../context/context.js'; import type { Projector } from 'ui/camera/projector/index.js'; import type { StyleDefinition } from 'style/style.spec.js'; import type { VectorPoint } from 'gis-tools/index.js'; import type { WallpaperWorkflow as WallpaperWorkflowSpec, WallpaperWorkflowUniforms } from './workflow.spec.js'; /** Storage for a wallpaper scheme */ export interface WallpaperScheme { background: Color; fade1: Color; fade2: Color; halo: Color; } /** Wallpaper Workflow renders a user styled wallpaper to the GPU */ export default class WallpaperWorkflow extends Workflow implements WallpaperWorkflowSpec { #private; label: "wallpaper"; scheme: WallpaperScheme; tileSize: number; scale: VectorPoint; uniforms: { [key in WallpaperWorkflowUniforms]: WebGLUniformLocation; }; /** @param context - WebGL(1|2) context */ constructor(context: Context); /** * Update the wallpaper style * @param style - input user defined style */ updateStyle(style: StyleDefinition): void; /** Flush the uniforms to the GPU */ flush(): void; /** Use this workflow as the current shaders for the GPU */ use(): void; /** * Draw the wallpaper * @param projector - Projector */ draw(projector: Projector): void; }