var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Vector2 } from "three";
import { MODULES } from "../../../engine/engine_modules.js";
import { serializable } from "../../../engine/engine_serialization.js";
import { PostProcessingEffect } from "../PostProcessingEffect.js";
import { VolumeParameter } from "../VolumeParameter.js";
import { registerCustomEffectType } from "../VolumeProfile.js";
/**
 * [ChromaticAberration](https://engine.needle.tools/docs/api/ChromaticAberration) simulates the color fringing effect seen in real-world cameras.
 * It offsets the red, green, and blue color channels to create a distorted, colorful edge around objects.
 * This effect can enhance the visual appeal of scenes by adding a subtle or pronounced chromatic distortion.
 * @summary Chromatic Aberration Post-Processing Effect
 * @category Effects
 * @group Components
 */
export class ChromaticAberration extends PostProcessingEffect {
    get typeName() {
        return "ChromaticAberration";
    }
    intensity = new VolumeParameter(0);
    onCreateEffect() {
        const chromatic = new MODULES.POSTPROCESSING.MODULE.ChromaticAberrationEffect();
        chromatic.offset = new Vector2(0, 0);
        chromatic.radialModulation = true;
        chromatic.modulationOffset = .15;
        this.intensity.valueProcessor = v => v * .02;
        this.intensity.onValueChanged = v => {
            chromatic.offset.x = -v;
            chromatic.offset.y = v;
        };
        return chromatic;
    }
}
__decorate([
    serializable(VolumeParameter)
], ChromaticAberration.prototype, "intensity", void 0);
;
registerCustomEffectType("ChromaticAberration", ChromaticAberration);
//# sourceMappingURL=ChromaticAberration.js.map