Table of Contents

Class DitherResponse

Namespace
Gamelogic.Extensions.Algorithms
Assembly
Assembly-CSharp.dll

Dithers responses by adding noise before passing it to a step response. The noise is provided by an arbitrary generator, and errors are diffused over several calls.

public class DitherResponse
Inheritance
DitherResponse
Inherited Members
Extension Methods

Constructors

DitherResponse(IResponseCurve<float>, IGenerator<float>, float[])

Constructs a new DitherResponse.

public DitherResponse(IResponseCurve<float> quantizer, IGenerator<float> noiseGenerator, float[] errorFactors)

Parameters

quantizer IResponseCurve<float>

The response used to quantize values, such as an instance of StepResponse.

noiseGenerator IGenerator<float>

A generator that provides noise. For satisfactory results, the mean should be 0.

errorFactors float[]

An array of factors used to diffuse the error over several calls. For example, if the error factors are [0.6, 0.3, 0.1], then 60% of the error is given added to the next sample, 30% to the sample after that, and 10% to the sample after that.

DitherResponse(IResponseCurve<float>, int, float, float[])

Dithers responses by adding noise before passing it to a step response. If the quality of the noise is 1, the noise is uniform noise. If the quality of the noise is 2, the noise is triangular noise. The higher the quality, the closer the noise follow a random distribution.

public DitherResponse(IResponseCurve<float> quantizer, int quality, float noiseScale, float[] errorFactors)

Parameters

quantizer IResponseCurve<float>

A response curve that converts inputs to discrete outputs.

quality int

The quality.

noiseScale float

The noise scale.

errorFactors float[]

An array of factors used to diffuse the error over several calls. For example, if the error factors are [0.6, 0.3, 0.1], then 60% of the error is given added to the next sample, 30% to the sample after that, and 10% to the sample after that.

Properties

this[float]

Gives the quantized value of the given input.

public float this[float input] { get; }

Parameters

input float

Property Value

float