import { applyToneMappingPreset, createToneMappingCalibration, toneMapFloatPixels, toneMapPixels, toneMappingPresets } from "./PostProcessPass.js";
const INTENT_PRESETS = {
    "product-catalog": "cinematic",
    "material-review": "realistic",
    interior: "natural",
    interactive: "vibrant",
    debug: "natural"
};
export function createExternalParityToneMappingPolicy(intent, overrides = {}) {
    const presetName = INTENT_PRESETS[intent];
    const preset = toneMappingPresets[presetName];
    const toneMapping = {
        ...preset.toneMapping,
        ...overrides
    };
    return {
        intent,
        operator: toneMapping.operator,
        exposure: toneMapping.exposure,
        whitePoint: toneMapping.whitePoint,
        gamma: toneMapping.gamma,
        inputColorSpace: toneMapping.inputColorSpace,
        outputColorSpace: toneMapping.outputColorSpace,
        preset: presetName,
        calibration: createToneMappingCalibration(toneMapping)
    };
}
export function toneMapExternalParityPixels(pixels, width, height, policy) {
    return toneMapPixels(pixels, width, height, {
        exposure: policy.exposure,
        whitePoint: policy.whitePoint,
        gamma: policy.gamma,
        operator: policy.operator,
        inputColorSpace: policy.inputColorSpace,
        outputColorSpace: policy.outputColorSpace
    });
}
export function toneMapExternalParityHdrPixels(pixels, width, height, policy) {
    return toneMapFloatPixels(pixels, width, height, {
        exposure: policy.exposure,
        whitePoint: policy.whitePoint,
        gamma: policy.gamma,
        operator: policy.operator,
        outputColorSpace: policy.outputColorSpace
    });
}
export function applyExternalParityToneMappingPreset(pixels, width, height, intent) {
    return applyToneMappingPreset(pixels, width, height, INTENT_PRESETS[intent]);
}
export function listExternalParityToneMappingPresets() {
    return Object.values(toneMappingPresets);
}
//# sourceMappingURL=ToneMapping.js.map