import { ThreeElements } from '@react-three/fiber'; import { VuerProps } from '../../vuer/interfaces'; import * as THREE from "three"; export interface LoDLevel { stride: number; maxDistance: number; geometry: THREE.BufferGeometry | null; pointCount: number; } export interface LoDConfig { stride: number; maxDistance: number; } export declare const DEFAULT_LOD_CONFIGS: LoDConfig[]; export interface PointCloudInstance { id: string; position: THREE.Vector3; rotation?: THREE.Euler; lodLevels: LoDLevel[]; boundingBox: THREE.Box3; boundingSphere: THREE.Sphere; source?: PointCloudSource; } export interface PointCloudSource { depthData: Float32Array; colorData: Uint8Array; width: number; height: number; depthMeters: Float32Array; } export interface BakeOptions { depthUnit?: number; depthOffset?: number; invertDepth?: boolean; depthMin?: number; depthMax?: number; edgeFilter?: boolean; edgeThreshold?: number; /** Horizontal field of view in radians (default: 87° for RealSense D435) */ hfov?: number; /** Vertical field of view in radians (default: 58° for RealSense D435) */ vfov?: number; /** Principal point X in pixels (default: image center = width/2) */ cx?: number; /** Principal point Y in pixels (default: image center = height/2) */ cy?: number; } /** * Prepare source data for lazy baking (pre-compute depth in meters) */ export declare function preparePointCloudSource(depthData: Float32Array, colorData: Uint8Array, width: number, height: number, options?: BakeOptions): { source: PointCloudSource; boundingBox: THREE.Box3; boundingSphere: THREE.Sphere; }; /** * Bake a single LoD level from source data */ export declare function bakeSingleLoD(source: PointCloudSource, stride: number, maxDistance: number, options?: BakeOptions): LoDLevel; /** * Create a lazy instance - only prepares source, no geometry baked yet */ export declare function createLazyInstance(id: string, position: THREE.Vector3, depthData: Float32Array, colorData: Uint8Array, width: number, height: number, lodConfigs?: LoDConfig[], options?: BakeOptions): PointCloudInstance; /** * Bake a specific LoD level for an instance (and all lower-detail levels) */ export declare function bakeInstanceLoD(instance: PointCloudInstance, targetLodIndex: number, options?: BakeOptions): void; /** * Bake a point cloud at multiple LoD levels (eager - all at once) */ export declare function bakePointCloudWithLoD(depthData: Float32Array, colorData: Uint8Array, width: number, height: number, lodStrides?: number[], lodDistances?: number[], options?: BakeOptions): Promise<{ lodLevels: LoDLevel[]; boundingBox: THREE.Box3; boundingSphere: THREE.Sphere; }>; /** * Load depth image and return as Float32Array. * Supports PNG (16-bit precision via UPNG) and JPG/WebP (8-bit precision via Canvas). */ export declare function loadDepthImage(url: string): Promise<{ data: Float32Array; width: number; height: number; }>; /** * Load depth PNG (16-bit) and return as Float32Array * @deprecated Use loadDepthImage instead, which supports both PNG and JPG formats */ export declare function loadDepthPNG(url: string): Promise<{ data: Float32Array; width: number; height: number; }>; /** * Load color image and return as RGBA Uint8Array */ export declare function loadColorImage(url: string): Promise<{ data: Uint8Array; width: number; height: number; }>; /** * Configuration for the DepthPointCloudManager */ export interface PointCloudManagerConfig { /** * Size of rendered points * @dial visualization * @dial-dtype number * @dial-min 0.1 * @dial-max 20 * @dial-step 0.1 * @dial-default 2.0 */ pointSize?: number; /** * Use screen-space point sizing (constant size regardless of distance) * @dial visualization * @dial-label-left * @dial-dtype boolean * @dial-default true */ screenSpacePoints?: boolean; /** * Enable false color visualization based on depth/height * @dial visualization * @dial-label-left * @dial-dtype boolean * @dial-default false */ useFalseColor?: boolean; /** * Color mode: 0=Baked depth, 1=Camera Z, 2=Camera distance, 3=Height (local), 4=Height (world) * @dial visualization * @dial-dtype int * @dial-min 0 * @dial-max 4 * @dial-default 0 */ colorMode?: number; /** * Minimum depth value for false color mapping * @dial visualization * @dial-dtype number * @dial-min 0 * @dial-max 100 * @dial-step 0.1 * @dial-default 0.1 */ depthMin?: number; /** * Maximum depth value for false color mapping * @dial visualization * @dial-dtype number * @dial-min 0 * @dial-max 100 * @dial-step 0.1 * @dial-default 50 */ depthMax?: number; /** * Minimum height value for false color mapping * @dial visualization * @dial-dtype number * @dial-step 0.1 * @dial-default -2 */ heightMin?: number; /** * Maximum height value for false color mapping * @dial visualization * @dial-dtype number * @dial-step 0.1 * @dial-default 2 */ heightMax?: number; /** * Enable frustum culling for point clouds outside view * @dial performance * @dial-label-left * @dial-dtype boolean * @dial-default true */ frustumCulling?: boolean; /** * Margin multiplier for frustum culling bounding sphere * @dial performance * @dial-dtype number * @dial-min 1 * @dial-max 5 * @dial-step 0.1 * @dial-default 2.0 */ cullingMargin?: number; /** * Enable Level-of-Detail rendering * @dial performance * @dial-label-left * @dial-dtype boolean * @dial-default true */ lodEnabled?: boolean; } /** * Props for the DepthPointCloudManager component */ type PointCloudManagerProps = VuerProps<{ /** * Array of point cloud instances to render * @dial-ignore */ instances: PointCloudInstance[]; /** * Configuration options for visualization and performance * @dial-ignore */ config?: PointCloudManagerConfig; /** * Callback for rendering statistics * @dial-ignore */ onStats?: (stats: { visible: number; culled: number; totalPoints: number; }) => void; } & ThreeElements['group']>; export default function DepthPointCloudManager({ instances, config, onStats, ...rest }: PointCloudManagerProps): import("react/jsx-runtime").JSX.Element; export {};