import { type Camera, Color, type Scene, type WebGLRenderer } from "three";
import { SAOPass, SSAARenderPass, SSAOPass, TAARenderPass } from "three/examples/jsm/Addons";
import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer";
import { OutlinePass } from "three/examples/jsm/postprocessing/OutlinePass";
import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass";
import { SMAAPass } from "three/examples/jsm/postprocessing/SMAAPass";
import { type ViralViewerApi } from "../..";
import { DevicePerformanceChecker } from "../../utils/device";
import { AlphaSelectionOutlinePass } from "./alpha-selection-outline-pass";
import { type ScreenSpaceEdgesOptions, ScreenSpaceEdgesPass } from "./screen-space-edges-pass";
import { type SelectionOutlineOptions, SelectionOutlinePass } from "./selection-outline-pass";
export declare class PostProcessingRenderer {
    private renderer;
    viralViewerApi: ViralViewerApi;
    composer: EffectComposer;
    renderPass: any;
    gammaPass: ShaderPass | null;
    ssaoPass: SSAOPass | null;
    saoPass: SAOPass | null;
    smaaPass: SMAAPass | null;
    ssaaPass: SSAARenderPass | null;
    fxaaPass: ShaderPass | null;
    taaPass: TAARenderPass | null;
    sobelPass: ShaderPass | null;
    whitePass: ShaderPass | null;
    shadowRemovalPass: ShaderPass | null;
    outlinePass: OutlinePass | null;
    screenSpaceEdgesPass: ScreenSpaceEdgesPass | null;
    selectionOutlinePass: SelectionOutlinePass | null;
    alphaSelectionOutlinePass: AlphaSelectionOutlinePass | null;
    n8aoPass: any;
    perfChecker: DevicePerformanceChecker;
    constructor(renderer: WebGLRenderer, viralViewerApi: ViralViewerApi);
    isWebGL2Available(): boolean;
    render(): void;
    /**
     * Update the camera on all existing passes without recreating them.
     * Use this when switching between perspective/orthographic cameras.
     */
    updateCamera(camera: Camera): void;
    initRenderPass(scene: Scene, camera: Camera): void;
    initGammaPass(): void;
    initn8aoPass(scene: Scene, camera: Camera): void;
    enableN8AOPass(): void;
    disableN8AOPass(): void;
    enableN8AOPassScreenSpaceRadius(): void;
    disableN8AOPassScreenSpaceRadius(): void;
    initSMAAPass(): void;
    initSSAAPass(scene: Scene, camera: Camera): void;
    initFXAAPass(): void;
    initTAAPass(scene: Scene, camera: Camera): void;
    enableTAA(): void;
    disableTAA(): void;
    initSAOPass(scene: Scene, camera: Camera): void;
    initSSAOPass(scene: Scene, camera: Camera): void;
    enableSSAO(): void;
    disableSSAO(): void;
    enableSobel(): void;
    disableSobel(): void;
    /**
     * Initialize screen-space edge detection pass
     * This detects edges on-the-fly without generating geometry, using:
     * - Depth discontinuity detection (silhouettes)
     * - Normal discontinuity detection (creases/corners)
     * - Object ID discontinuity detection (object boundaries)
     */
    initScreenSpaceEdgesPass(scene: Scene, camera: Camera): void;
    /**
     * Enable screen-space edge detection
     * Much more efficient than geometry-based edges for large models
     */
    enableScreenSpaceEdges(): void;
    /**
     * Disable screen-space edge detection
     */
    disableScreenSpaceEdges(): void;
    /**
     * 🔧 FAST: Bypass screen-space edges (instant, no geometry render)
     * Use this during camera movement for smooth performance
     * The pass stays in the pipeline but just copies input to output
     */
    bypassScreenSpaceEdges(): void;
    /**
     * 🔧 FAST: Resume screen-space edges after bypassing
     * Call this when camera stops moving
     */
    resumeScreenSpaceEdges(): void;
    /**
     * Configure screen-space edge detection options
     */
    setScreenSpaceEdgesOptions(options: Partial<ScreenSpaceEdgesOptions>): void;
    /**
     * Set screen-space edge color
     */
    setScreenSpaceEdgeColor(color: Color | number): void;
    /**
     * Set screen-space edge opacity (0-1)
     */
    setScreenSpaceEdgeOpacity(opacity: number): void;
    /**
     * Set screen-space edge thickness in pixels
     */
    setScreenSpaceEdgeThickness(thickness: number): void;
    /**
     * Configure which edge detection methods are enabled
     */
    setScreenSpaceEdgeMethods(options: {
        depth?: boolean;
        normal?: boolean;
        objectId?: boolean;
    }): void;
    /**
     * Set "Pen Mode" - technical drawing style with full opacity black lines
     */
    setScreenSpaceEdgesPenMode(): void;
    /**
     * Set "Shaded Mode" - subtle edges for 3D visualization
     */
    setScreenSpaceEdgesShadedMode(): void;
    /**
     * Set alpha threshold below which fragments are excluded from edge detection.
     * Use this to skip ghosted elements when rendering edges.
     * @param threshold - Alpha value (0-1). Fragments with alpha < threshold are skipped.
     *                   - 0.01 (default): Only hidden elements skipped
     *                   - 0.15: Also skip ghosted elements (typically alpha ~0.1)
     */
    setScreenSpaceEdgesGhostThreshold(threshold: number): void;
    /**
     * Get the current alpha threshold for edge detection ghost filtering.
     */
    getScreenSpaceEdgesGhostThreshold(): number;
    private _whiteShader;
    initWhitePass(): void;
    initOutlinePass(scene: Scene, camera: Camera): void;
    enableOutline(): void;
    disableOutline(): void;
    /**
     * Initialize lightweight selection outline pass
     * Renders selected geometry to mask, then applies Sobel edge detection
     * Cost: 1 extra draw call + 1 fullscreen pass
     */
    initSelectionOutlinePass(scene: Scene, camera: Camera): void;
    /**
     * Update selection outline geometry
     * Call this when selection changes
     * @param positions - Merged Float32Array of selected element positions, or null to clear
     */
    updateSelectionOutline(positions: Float32Array | null): void;
    /**
     * Notify the outline pass whether elements are currently selected.
     * The GPU reads selection state directly from vertex colors — no data transfer needed.
     */
    setSelectionOutlineActive(hasSelection: boolean): void;
    /**
     * Enable selection outline rendering
     */
    enableSelectionOutline(): void;
    /**
     * Disable selection outline rendering
     */
    disableSelectionOutline(): void;
    /**
     * 🔧 FAST: Bypass selection outline (instant, no mask render)
     * Use this during camera movement for smooth performance
     * The pass stays in the pipeline but just copies input to output
     */
    bypassSelectionOutline(): void;
    /**
     * 🔧 FAST: Resume selection outline after bypassing
     * Call this when camera stops moving
     */
    resumeSelectionOutline(): void;
    /**
     * Configure selection outline options
     */
    setSelectionOutlineOptions(options: Partial<SelectionOutlineOptions>): void;
    /**
     * Set selection outline color
     */
    setSelectionOutlineColor(color: Color | number | string): void;
    /**
     * Set selection outline thickness in pixels
     */
    setSelectionOutlineThickness(thickness: number): void;
    /**
     * Initialize alpha-based selection outline pass
     * ZERO extra render passes - detects selection via alpha channel in main render
     * Cost: 1 fullscreen pass only (no geometry re-render)
     *
     * This is MUCH faster than SelectionOutlinePass for large selections
     * Works with both batched meshes (per-vertex alpha) and instanced meshes (per-instance alpha)
     */
    initAlphaSelectionOutlinePass(): void;
    /**
     * Enable alpha selection outline rendering
     */
    enableAlphaSelectionOutline(): void;
    /**
     * Disable alpha selection outline rendering
     */
    disableAlphaSelectionOutline(): void;
    /**
     * Bypass alpha selection outline (instant, zero cost)
     */
    bypassAlphaSelectionOutline(): void;
    /**
     * Resume alpha selection outline after bypassing
     */
    resumeAlphaSelectionOutline(): void;
    /**
     * Set alpha selection outline color
     */
    setAlphaSelectionOutlineColor(color: Color | number | string): void;
    /**
     * Set alpha selection outline thickness in pixels
     */
    setAlphaSelectionOutlineThickness(thickness: number): void;
    /**
     * Update alpha selection outline state
     * Call this when selection changes
     * @param hasSelection - Whether there's any selection active
     */
    updateAlphaSelectionOutline(hasSelection: boolean): void;
    /**
     * Dispose all post-processing resources.
     * EffectComposer.dispose() releases render targets and passes.
     */
    dispose(): void;
}
