import { BaseRenderer } from './BaseRenderer.js'; import { Viewport } from '../viewport/Viewport.js'; import { RawJpegData } from '../tilecache/CacheableRawJpegTile.js'; import { Renderer, IntArrayRenderOptions } from '../shared/types.js'; import { WarpedMap } from '../maps/WarpedMap.js'; type WasmModule = { decode_jpeg_test(jpegBytes: Uint8Array): { width: number; height: number; }; encode_rgba_to_png(pixels: Uint8Array, width: number, height: number): Uint8Array; encode_rgba_to_webp(pixels: Uint8Array, width: number, height: number): Uint8Array; encode_rgba_to_jpeg(pixels: Uint8Array, width: number, height: number, quality: number): Uint8Array; render_warped_tile_rgba(jpeg_tiles: Uint8Array, tile_offsets: Uint32Array, tile_widths: Uint32Array, tile_heights: Uint32Array, tile_columns: Float64Array, tile_rows: Float64Array, tile_scale_factors: Float64Array, tile_original_widths: Float64Array, tile_original_heights: Float64Array, transform_type: string, transform_args: Float64Array, source_points: Float64Array, mask_polygon: Float64Array, canvas_to_geo: Float64Array, output_width: number, output_height: number): Uint8Array; render_warped_tile_rgba_direct(rgba_tiles: Uint8Array, tile_offsets: Uint32Array, tile_widths: Uint32Array, tile_heights: Uint32Array, tile_columns: Float64Array, tile_rows: Float64Array, tile_scale_factors: Float64Array, tile_original_widths: Float64Array, tile_original_heights: Float64Array, transform_type: string, transform_args: Float64Array, source_points: Float64Array, mask_polygon: Float64Array, canvas_to_geo: Float64Array, output_width: number, output_height: number): Uint8Array; render_warped_tile(jpeg_tiles: Uint8Array, tile_offsets: Uint32Array, tile_widths: Uint32Array, tile_heights: Uint32Array, tile_columns: Float64Array, tile_rows: Float64Array, tile_scale_factors: Float64Array, tile_original_widths: Float64Array, tile_original_heights: Float64Array, transform_type: string, transform_args: Float64Array, source_points: Float64Array, mask_polygon: Float64Array, canvas_to_geo: Float64Array, output_width: number, output_height: number): Uint8Array; render_warped_tile_webp(jpeg_tiles: Uint8Array, tile_offsets: Uint32Array, tile_widths: Uint32Array, tile_heights: Uint32Array, tile_columns: Float64Array, tile_rows: Float64Array, tile_scale_factors: Float64Array, tile_original_widths: Float64Array, tile_original_heights: Float64Array, transform_type: string, transform_args: Float64Array, source_points: Float64Array, mask_polygon: Float64Array, canvas_to_geo: Float64Array, output_width: number, output_height: number): Uint8Array; render_warped_tile_jpeg(jpeg_tiles: Uint8Array, tile_offsets: Uint32Array, tile_widths: Uint32Array, tile_heights: Uint32Array, tile_columns: Float64Array, tile_rows: Float64Array, tile_scale_factors: Float64Array, tile_original_widths: Float64Array, tile_original_heights: Float64Array, transform_type: string, transform_args: Float64Array, source_points: Float64Array, mask_polygon: Float64Array, canvas_to_geo: Float64Array, output_width: number, output_height: number, quality: number): Uint8Array; }; export type OutputFormat = 'png' | 'webp' | 'jpeg'; /** * Class that renders WarpedMaps using WASM with raw JPEG tiles * Caches raw JPEG bytes and decodes them in WASM for maximum performance */ export declare class WasmRenderer extends BaseRenderer implements Renderer { #private; wasmModule: WasmModule; outputFormat: OutputFormat; backgroundColor?: [number, number, number]; constructor(wasmModule: WasmModule, options?: Partial & { outputFormat?: OutputFormat; backgroundColor?: [number, number, number]; }); /** * Render the map for a given viewport using WASM. * * @param viewport - the viewport to render */ render(viewport: Viewport): Promise; } export {};