"use strict";
/*---------------------------------------------------------------------------------------------
* 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
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.AmbientOcclusion = void 0;
const core_bentley_1 = require("@itwin/core-bentley");
/** Namespace containing types controlling how ambient occlusion should be drawn.
 * @public
 */
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 {
        constructor(json) {
            if (undefined === json)
                json = {};
            this.bias = core_bentley_1.JsonUtils.asDouble(json.bias, Settings._defaultBias);
            this.zLengthCap = core_bentley_1.JsonUtils.asDouble(json.zLengthCap, Settings._defaultZLengthCap);
            this.maxDistance = core_bentley_1.JsonUtils.asDouble(json.maxDistance, Settings._defaultMaxDistance);
            this.intensity = core_bentley_1.JsonUtils.asDouble(json.intensity, Settings._defaultIntensity);
            this.texelStepSize = core_bentley_1.JsonUtils.asDouble(json.texelStepSize, Settings._defaultTexelStepSize);
            this.blurDelta = core_bentley_1.JsonUtils.asDouble(json.blurDelta, Settings._defaultBlurDelta);
            this.blurSigma = core_bentley_1.JsonUtils.asDouble(json.blurSigma, Settings._defaultBlurSigma);
            this.blurTexelStepSize = core_bentley_1.JsonUtils.asDouble(json.blurTexelStepSize, Settings._defaultBlurTexelStepSize);
        }
        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,
            };
        }
    }
    Settings._defaultBias = 0.25;
    Settings._defaultZLengthCap = 0.0025;
    Settings._defaultMaxDistance = 10000.0;
    Settings._defaultIntensity = 1.0;
    Settings._defaultTexelStepSize = 1;
    Settings._defaultBlurDelta = 1.0;
    Settings._defaultBlurSigma = 2.0;
    Settings._defaultBlurTexelStepSize = 1.0;
    Settings.defaults = new Settings({});
    AmbientOcclusion.Settings = Settings;
})(AmbientOcclusion || (exports.AmbientOcclusion = AmbientOcclusion = {}));
//# sourceMappingURL=AmbientOcclusion.js.map