import { BaseRenderPass, type RenderPassContext } from "./RenderPass";
import { type RenderDevice, type RenderTarget } from "./RenderDevice";
export type ToneMappingOperator = "linear" | "reinhard" | "aces" | "filmic" | "uncharted2" | "agx" | "neutral";
export type PostProcessColorSpace = "linear" | "srgb";
export type DepthTextureFormat = "depth24";
export type ToneMappingPresetName = "natural" | "cinematic" | "vibrant" | "realistic" | "stylized";
export interface BloomOptions {
    readonly threshold?: number;
    readonly intensity?: number;
    readonly radius?: number;
}
export interface FXAAOptions {
    readonly edgeThreshold?: number;
    readonly subpixelBlend?: number;
}
export interface ToneMappingOptions {
    readonly exposure?: number;
    readonly whitePoint?: number;
    readonly gamma?: number;
    readonly operator?: ToneMappingOperator;
    readonly inputColorSpace?: PostProcessColorSpace;
    readonly outputColorSpace?: PostProcessColorSpace;
}
export interface ColorGradeOptions {
    readonly contrast?: number;
    readonly temperature?: number;
    readonly tint?: number;
    readonly saturation?: number;
    readonly vibrance?: number;
    readonly vignette?: number;
    readonly sharpening?: number;
}
export interface ColorGradeResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly changedPixels: number;
    readonly vignetteDarkenedPixels: number;
    readonly sharpenedPixels: number;
    readonly settings: Required<ColorGradeOptions>;
}
export interface ToneMappingPreset {
    readonly name: ToneMappingPresetName;
    readonly label: string;
    readonly toneMapping: Required<ToneMappingOptions>;
    readonly colorGrade: Required<ColorGradeOptions>;
    readonly autoExposure: boolean;
    readonly adaptationSpeed: number;
    readonly minExposure: number;
    readonly maxExposure: number;
}
export interface ExposureHistogramOptions {
    readonly inputColorSpace?: PostProcessColorSpace;
    readonly binCount?: number;
    readonly minLuminance?: number;
    readonly maxLuminance?: number;
}
export interface ExposureHistogram {
    readonly bins: readonly number[];
    readonly binCount: number;
    readonly minLuminance: number;
    readonly maxLuminance: number;
    readonly pixelCount: number;
    readonly averageLuminance: number;
    readonly minObservedLuminance: number;
    readonly maxObservedLuminance: number;
}
export interface AutoExposureOptions {
    readonly targetLuminance?: number;
    readonly previousExposure?: number;
    readonly adaptationSpeed?: number;
    readonly deltaTimeSeconds?: number;
    readonly minExposure?: number;
    readonly maxExposure?: number;
}
export interface AutoExposureResult {
    readonly exposure: number;
    readonly targetExposure: number;
    readonly averageLuminance: number;
    readonly adaptationRate: number;
    readonly clamped: boolean;
}
export interface ToneMappingPresetResult {
    readonly width: number;
    readonly height: number;
    readonly preset: ToneMappingPresetName;
    readonly pixels: Uint8Array;
    readonly toneMapped: ToneMappingResult;
    readonly colorGraded: ColorGradeResult;
    readonly histogram: ExposureHistogram;
    readonly autoExposure?: AutoExposureResult;
}
export interface ChromaticAberrationOptions {
    readonly strength?: number;
}
export interface ChromaticAberrationResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly changedPixels: number;
    readonly maxChannelOffsetPixels: number;
}
export interface OutlineOptions {
    readonly color?: readonly [number, number, number, number?];
    readonly width?: number;
    readonly threshold?: number;
    readonly opacity?: number;
}
export interface OutlineResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly outlineMask: Uint8Array;
    readonly outlinedPixels: number;
    readonly changedPixels: number;
    readonly maxGradient: number;
    readonly method: "sobel-luma";
}
export interface FilmGrainOptions {
    readonly intensity?: number;
    readonly seed?: number;
    readonly monochrome?: boolean;
}
export interface FilmGrainResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly changedPixels: number;
    readonly seed: number;
    readonly intensity: number;
    readonly monochrome: boolean;
}
export interface DepthOfFieldOptions {
    readonly depth?: DepthTextureBinding;
    readonly focusDepth?: number;
    readonly focusRange?: number;
    readonly maxRadius?: number;
}
export interface DepthOfFieldResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly blurredPixels: number;
    readonly maxBlurRadius: number;
    readonly focusDepth: number;
    readonly focusRange: number;
}
export interface MotionBlurOptions {
    readonly velocity: Float32Array;
    readonly samples?: number;
    readonly scale?: number;
}
export interface MotionBlurResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly blurredPixels: number;
    readonly samples: number;
    readonly maxVelocityPixels: number;
}
export interface SSAOOptions {
    readonly depth?: DepthTextureBinding;
    readonly radius?: number;
    readonly intensity?: number;
    readonly bias?: number;
}
export interface SSAOResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly occludedPixels: number;
    readonly averageOcclusion: number;
    readonly radius: number;
    readonly intensity: number;
}
export interface ContactShadowPostProcessOptions {
    readonly depth?: DepthTextureBinding;
    readonly radius?: number;
    readonly intensity?: number;
    readonly bias?: number;
    readonly thickness?: number;
    readonly direction?: readonly [number, number];
}
export interface ContactShadowPostProcessResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly contactPixels: number;
    readonly averageContactDarkening: number;
    readonly radius: number;
    readonly intensity: number;
    readonly mode: "screen-space-depth-contact";
}
export interface SSRResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly reflectedPixels: number;
    readonly maxReflectionBoost: number;
    readonly intensity: number;
    readonly maxDistance: number;
}
export interface SSROptions {
    readonly depth?: DepthTextureBinding;
    readonly intensity?: number;
    readonly maxDistance?: number;
}
export interface TAAOptions {
    readonly history: Uint8Array;
    readonly blend?: number;
}
export interface TAAResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly blendedPixels: number;
    readonly blend: number;
}
export interface ToneMappingResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly colorSpace: PostProcessColorSpace;
    readonly calibration: ToneMappingCalibration;
}
export interface HdrToneMappingResult extends ToneMappingResult {
    readonly inputOverbrightPixels: number;
    readonly maxInputValue: number;
}
export interface BloomResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly brightPixels: Uint8Array;
    readonly horizontalBlurPixels: Uint8Array;
    readonly verticalBlurPixels: Uint8Array;
    readonly brightPixelCount: number;
    readonly brightEnergy: number;
    readonly maxNeighborBoost: number;
    readonly changedPixels: number;
    readonly maxChannelDelta: number;
    readonly pipeline: readonly ["bright-extract", "horizontal-blur", "vertical-blur", "composite"];
}
export interface HdrBloomResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Float32Array;
    readonly brightPixels: Float32Array;
    readonly horizontalBlurPixels: Float32Array;
    readonly verticalBlurPixels: Float32Array;
    readonly brightPixelCount: number;
    readonly brightEnergy: number;
    readonly maxNeighborBoost: number;
    readonly changedPixels: number;
    readonly maxChannelDelta: number;
    readonly maxInputValue: number;
    readonly pipeline: readonly ["bright-extract", "horizontal-blur", "vertical-blur", "composite"];
}
export interface FXAAResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly edgeMask: Uint8Array;
}
export type FusedLdrPostProcessPassName = "tone-mapping" | "color-grade" | "fxaa";
export interface FusedLdrPostProcessPass {
    readonly name: FusedLdrPostProcessPassName;
    readonly options: ToneMappingOptions | ColorGradeOptions | FXAAOptions;
}
export interface FusedLdrPostProcessScratch {
    bufferA?: Uint8Array;
    bufferB?: Uint8Array;
    toneMappingLookup?: Uint8Array;
    toneMappingLookupKey?: string;
    vignetteFactors?: Float32Array;
    vignetteFactorsKey?: string;
}
export interface FusedLdrPostProcessOptions {
    readonly scratch?: FusedLdrPostProcessScratch;
    readonly mutateInput?: boolean;
    readonly toneMappingDefaults?: ToneMappingOptions;
}
export interface ToneMappingCalibrationSample {
    readonly inputLinear: number;
    readonly mappedLinear: number;
    readonly encodedByte: number;
}
export interface ToneMappingCalibration {
    readonly operator: ToneMappingOperator;
    readonly exposure: number;
    readonly whitePoint: number;
    readonly gamma: number;
    readonly inputColorSpace: PostProcessColorSpace;
    readonly outputColorSpace: PostProcessColorSpace;
    readonly samples: readonly ToneMappingCalibrationSample[];
    readonly monotonic: boolean;
}
export interface DepthTextureBinding {
    readonly label: string;
    readonly width: number;
    readonly height: number;
    readonly format: DepthTextureFormat;
    readonly data: Float32Array;
}
export interface DepthTextureStats {
    readonly label: string;
    readonly width: number;
    readonly height: number;
    readonly format: DepthTextureFormat;
    readonly byteLength: number;
    readonly minDepth: number;
    readonly maxDepth: number;
    readonly centerDepth: number;
    readonly nearSample: number;
    readonly farSample: number;
    readonly edgePixelCount: number;
}
export interface DepthVisualizationResult {
    readonly width: number;
    readonly height: number;
    readonly pixels: Uint8Array;
    readonly stats: DepthTextureStats;
}
export interface ToneMappingPassOptions extends ToneMappingOptions {
    readonly name?: string;
    readonly source: RenderTarget;
    readonly target?: RenderTarget;
    readonly readResource?: string;
    readonly writeResource?: string;
}
export interface BloomPassOptions extends BloomOptions {
    readonly name?: string;
    readonly source: RenderTarget;
    readonly target?: RenderTarget;
    readonly readResource?: string;
    readonly writeResource?: string;
}
export interface FXAAPassOptions extends FXAAOptions {
    readonly name?: string;
    readonly source: RenderTarget;
    readonly target?: RenderTarget;
    readonly readResource?: string;
    readonly writeResource?: string;
}
export interface DepthVisualizationPassOptions {
    readonly name?: string;
    readonly source: DepthTextureBinding;
    readonly target?: RenderTarget;
    readonly edgeThreshold?: number;
    readonly readResource?: string;
    readonly writeResource?: string;
}
export declare class ToneMappingPass extends BaseRenderPass {
    private readonly options;
    private readonly exposure;
    private readonly whitePoint;
    private readonly gamma;
    private readonly operator;
    private readonly inputColorSpace;
    private readonly outputColorSpace;
    private lastResult;
    constructor(options: ToneMappingPassOptions);
    execute(context: RenderPassContext): void;
    getLastResult(): ToneMappingResult | null;
}
export declare class DepthVisualizationPass extends BaseRenderPass {
    private readonly options;
    private readonly edgeThreshold;
    private lastResult;
    constructor(options: DepthVisualizationPassOptions);
    execute(context: RenderPassContext): void;
    getLastResult(): DepthVisualizationResult | null;
}
export declare class BloomPass extends BaseRenderPass {
    private readonly options;
    private readonly threshold;
    private readonly intensity;
    private readonly radius;
    private lastResult;
    constructor(options: BloomPassOptions);
    execute(context: RenderPassContext): void;
    getLastResult(): BloomResult | null;
}
export declare class FXAAPass extends BaseRenderPass {
    private readonly options;
    private readonly edgeThreshold;
    private readonly subpixelBlend;
    private lastResult;
    constructor(options: FXAAPassOptions);
    execute(context: RenderPassContext): void;
    getLastResult(): FXAAResult | null;
}
export declare function toneMapPixels(pixels: Uint8Array, width: number, height: number, options?: ToneMappingOptions): ToneMappingResult;
export declare function toneMapFloatPixels(pixels: Float32Array, width: number, height: number, options?: ToneMappingOptions): HdrToneMappingResult;
export declare function colorGradePixels(pixels: Uint8Array, width: number, height: number, options?: ColorGradeOptions): ColorGradeResult;
export declare const toneMappingPresets: Record<ToneMappingPresetName, ToneMappingPreset>;
export declare function resolveToneMappingPreset(name: ToneMappingPresetName, overrides?: ToneMappingOptions & ColorGradeOptions & Partial<Pick<ToneMappingPreset, "autoExposure" | "adaptationSpeed" | "minExposure" | "maxExposure">>): ToneMappingPreset;
export declare function computeExposureHistogramFromPixels(pixels: Uint8Array, width: number, height: number, options?: ExposureHistogramOptions): ExposureHistogram;
export declare function computeAutoExposureFromHistogram(histogram: ExposureHistogram, options?: AutoExposureOptions): AutoExposureResult;
export declare function applyToneMappingPreset(pixels: Uint8Array, width: number, height: number, presetName: ToneMappingPresetName, options?: ToneMappingOptions & ColorGradeOptions & AutoExposureOptions & Partial<Pick<ToneMappingPreset, "autoExposure" | "adaptationSpeed" | "minExposure" | "maxExposure">>): ToneMappingPresetResult;
export declare function chromaticAberrationPixels(pixels: Uint8Array, width: number, height: number, options?: ChromaticAberrationOptions): ChromaticAberrationResult;
export declare function outlinePixels(pixels: Uint8Array, width: number, height: number, options?: OutlineOptions): OutlineResult;
export declare function filmGrainPixels(pixels: Uint8Array, width: number, height: number, options?: FilmGrainOptions): FilmGrainResult;
export declare function depthOfFieldPixels(pixels: Uint8Array, width: number, height: number, options: DepthOfFieldOptions): DepthOfFieldResult;
export declare function motionBlurPixels(pixels: Uint8Array, width: number, height: number, options: MotionBlurOptions): MotionBlurResult;
export declare function ssaoPixels(pixels: Uint8Array, width: number, height: number, options: SSAOOptions): SSAOResult;
export declare function contactShadowPixels(pixels: Uint8Array, width: number, height: number, options: ContactShadowPostProcessOptions): ContactShadowPostProcessResult;
export declare function ssrPixels(pixels: Uint8Array, width: number, height: number, options: SSROptions): SSRResult;
export declare function taaPixels(pixels: Uint8Array, width: number, height: number, options: TAAOptions): TAAResult;
export declare function bloomPixels(pixels: Uint8Array, width: number, height: number, options?: BloomOptions): BloomResult;
export declare function extractBloomBrightPixels(pixels: Uint8Array, width: number, height: number, threshold: number): {
    readonly pixels: Uint8Array;
    readonly brightPixelCount: number;
    readonly brightEnergy: number;
};
export declare function blurBloomPixelsHorizontal(pixels: Uint8Array, width: number, height: number, radius: number): Uint8Array;
export declare function blurBloomPixelsVertical(pixels: Uint8Array, width: number, height: number, radius: number): Uint8Array;
export declare function compositeBloomPixels(sourcePixels: Uint8Array, blurredPixels: Uint8Array, width: number, height: number, intensity: number, brightPixels?: Uint8Array): {
    readonly pixels: Uint8Array;
    readonly maxNeighborBoost: number;
    readonly changedPixels: number;
    readonly maxChannelDelta: number;
};
export declare function bloomFloatPixels(pixels: Float32Array, width: number, height: number, options?: BloomOptions): HdrBloomResult;
export declare function createDepthTextureBinding(options: {
    readonly label: string;
    readonly width: number;
    readonly height: number;
    readonly data?: Float32Array;
}): DepthTextureBinding;
export declare function createToneMappingCalibration(options: Required<ToneMappingOptions>): ToneMappingCalibration;
export declare function visualizeDepthTexture(texture: DepthTextureBinding, options?: {
    readonly edgeThreshold?: number;
}): DepthVisualizationResult;
export declare function depthTextureStats(texture: DepthTextureBinding, edgeThreshold?: number): DepthTextureStats;
export declare function fxaaPixels(pixels: Uint8Array, width: number, height: number, options?: FXAAOptions): FXAAResult;
export declare function fusedLdrPostprocessPixels(pixels: Uint8Array, width: number, height: number, passes: readonly FusedLdrPostProcessPass[], options?: FusedLdrPostProcessOptions): Uint8Array;
export declare function writePostProcessPixels(device: RenderDevice, source: RenderTarget, target: RenderTarget | undefined, pixels: Uint8Array): void;
//# sourceMappingURL=PostProcessPass.d.ts.map