import { depthOfFieldPixels } from "../../PostProcessPass.js";
import { applyThreeCompatPixelKernel, createThreeCompatDepthProxy } from "./PostProcessTypes.js";
export class DepthOfFieldPassThreeCompat {
    blur;
    name = "DepthOfFieldPass";
    enabled = true;
    constructor(blur = 0.35) {
        this.blur = blur;
    }
    apply(frame) {
        return applyThreeCompatPixelKernel({ ...frame, blur: frame.blur + this.blur }, this.name, (pixels, width, height) => depthOfFieldPixels(pixels, width, height, {
            depth: frame.depth ?? createThreeCompatDepthProxy(width, height),
            focusDepth: 0.44,
            focusRange: 0.09,
            maxRadius: Math.max(1, Math.round(this.blur * 6))
        }).pixels, "depthOfFieldPixels kernel");
    }
}
//# sourceMappingURL=DepthOfFieldPass.js.map