/**
 * TwinfinityPostProcess is the base class that can be used to extend classes for post-process effects.
 */
export class TwinfinityPostProcess {
    _postProcess = undefined;
    _affectedCameras = new Set();
    /**
     * Returns a set of all the cameras this post-process effect is attached to.
     */
    get affectedCameras() {
        return this._affectedCameras;
    }
    /**
     * Runs the initialize method if the post-process has not yet been initialized.
     * Then attaches the post-process effect to the specified camera.
     * @param camera The camera to attach the post-process effect to.
     * @returns true if the post-process effect was successfully attached to the camera, otherwise false.
     */
    attach(camera) {
        this._postProcess = this.initialize(camera);
        if (!this.affectedCameras.has(camera)) {
            camera.attachPostProcess(this._postProcess);
            this.affectedCameras.add(camera);
            return true;
        }
        return false;
    }
    /**
     * Disables the post-process effect for the specified camera.
     * @param camera The camera to detach the post-process effect from.
     * @returns true if the post-process effect was successfully detached from the camera, otherwise false.
     */
    detach(camera) {
        if (this._affectedCameras.has(camera)) {
            camera.detachPostProcess(this._postProcess);
            this._affectedCameras.delete(camera);
            return true;
        }
        return false;
    }
}
//# sourceMappingURL=TwinfinityPostProcess.js.map