UNPKG

s2maps-gpu

Version:

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

38 lines (37 loc) 1.25 kB
import { Color } from 'style/color/index.js'; import type { Projector } from 'ui/camera/projector/index.js'; import type { StyleDefinition } from 'style/style.spec.js'; import type { WallpaperWorkflow as WallpaperWorkflowSpec } from './workflow.spec.js'; import type { WebGPUContext } from '../context/index.js'; /** Wallpaper color guide */ 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 implements WallpaperWorkflowSpec { #private; context: WebGPUContext; scheme: WallpaperScheme; tileSize: number; scale: Float32Array<ArrayBuffer>; pipeline: GPURenderPipeline; /** @param context - The WebGPU context */ constructor(context: WebGPUContext); /** Setup the wallpaper workflow */ setup(): Promise<void>; /** Cleanup the wallpaper workflow */ destroy(): void; /** * Update the wallpaper style * @param style - input user defined style */ updateStyle(style: StyleDefinition): void; /** * Draw the wallpaper to the GPU * @param projector - Projector */ draw(projector: Projector): void; }