/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module DisplayStyles
 */
import { JsonUtils } from "@itwin/core-bentley";
/** Namespace containing types controlling how ambient occlusion should be drawn.
 * @public
 */
export var AmbientOcclusion;
(function (AmbientOcclusion) {
    /** Describes the properties with which ambient occlusion should be drawn. These properties correspond to a horizon-based ambient occlusion approach. */
    class Settings {
        static _defaultBias = 0.25;
        static _defaultZLengthCap = 0.0025;
        static _defaultMaxDistance = 10000.0;
        static _defaultIntensity = 1.0;
        static _defaultTexelStepSize = 1;
        static _defaultBlurDelta = 1.0;
        static _defaultBlurSigma = 2.0;
        static _defaultBlurTexelStepSize = 1.0;
        bias;
        zLengthCap;
        maxDistance;
        intensity;
        texelStepSize;
        blurDelta;
        blurSigma;
        blurTexelStepSize;
        constructor(json) {
            if (undefined === json)
                json = {};
            this.bias = JsonUtils.asDouble(json.bias, Settings._defaultBias);
            this.zLengthCap = JsonUtils.asDouble(json.zLengthCap, Settings._defaultZLengthCap);
            this.maxDistance = JsonUtils.asDouble(json.maxDistance, Settings._defaultMaxDistance);
            this.intensity = JsonUtils.asDouble(json.intensity, Settings._defaultIntensity);
            this.texelStepSize = JsonUtils.asDouble(json.texelStepSize, Settings._defaultTexelStepSize);
            this.blurDelta = JsonUtils.asDouble(json.blurDelta, Settings._defaultBlurDelta);
            this.blurSigma = JsonUtils.asDouble(json.blurSigma, Settings._defaultBlurSigma);
            this.blurTexelStepSize = JsonUtils.asDouble(json.blurTexelStepSize, Settings._defaultBlurTexelStepSize);
        }
        static defaults = new Settings({});
        static fromJSON(json) { return undefined !== json ? new Settings(json) : this.defaults; }
        toJSON() {
            return {
                bias: this.bias !== Settings._defaultBias ? this.bias : undefined,
                zLengthCap: this.zLengthCap !== Settings._defaultZLengthCap ? this.zLengthCap : undefined,
                maxDistance: this.maxDistance !== Settings._defaultMaxDistance ? this.maxDistance : undefined,
                intensity: this.intensity !== Settings._defaultIntensity ? this.intensity : undefined,
                texelStepSize: this.texelStepSize !== Settings._defaultTexelStepSize ? this.texelStepSize : undefined,
                blurDelta: this.blurDelta !== Settings._defaultBlurDelta ? this.blurDelta : undefined,
                blurSigma: this.blurSigma !== Settings._defaultBlurSigma ? this.blurSigma : undefined,
                blurTexelStepSize: this.blurTexelStepSize !== Settings._defaultBlurTexelStepSize ? this.blurTexelStepSize : undefined,
            };
        }
    }
    AmbientOcclusion.Settings = Settings;
})(AmbientOcclusion || (AmbientOcclusion = {}));
//# sourceMappingURL=AmbientOcclusion.js.map