Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GaussFilter

Gaussian Filter implemented using a fragment shader. Renders the filtered result into COLOR_ATTACHMENT0 of the currently bound framebuffer. Does not support integer textures.

todo:

revisit this class design w.r.t. post planned catalogue of processing/filtering passes ...

Hierarchy

Index

Constructors

constructor

Properties

Protected _context

_context: Context

Protected _fragmentShader

_fragmentShader: Shader

Protected _kernelSize

_kernelSize: number = 7

Protected _ndcTriangle

_ndcTriangle: NdcFillingTriangle

Protected _ndcTriangleShared

_ndcTriangleShared: boolean = false

Protected _program

_program: Program

Protected _redistribute

_redistribute: boolean = true

Protected _standardDeviation

_standardDeviation: number = 1.0

Protected _uDelta

_uDelta: WebGLUniformLocation

Protected _uWeights

_uWeights: WebGLUniformLocation

Protected _weights

_weights: undefined | ([number, ...number[]] & { length: 32 })

Protected assertInitialized

assertInitialized: () => void = ...

Asserts the objects initialization status to be true. Note that the implementation is cached and forwarded to either an empty function when initialized and to an acutal assert(false) otherwise.

Type declaration

    • (): void
    • Returns void

Protected assertUninitialized

assertUninitialized: () => void = ...

Asserts the objects initialization status to be false. Note that the implementation is cached and forwarded to either an empty function when uninitialized and to an acutal assert(false) otherwise.

Type declaration

    • (): void
    • Returns void

Static Protected Readonly _MAXKERNELSIZEHALF

_MAXKERNELSIZEHALF: 32 = 32

Accessors

initialized

  • get initialized(): boolean
  • Property getter for readonly access to the initialization status of an initializable instance.

    Returns boolean

kernelSize

  • get kernelSize(): number
  • set kernelSize(kernelSize: number): void

redistribute

  • get redistribute(): boolean
  • set redistribute(redistribute: boolean): void
  • Parameter determining whether the weights outside of the kernel get redistributed on the kernel.

    Returns boolean

  • Sets the redistribute parameter. If this is true then the sum of all weights inside the kernel is always 1.

    Parameters

    • redistribute: boolean

    Returns void

standardDeviation

  • get standardDeviation(): number
  • set standardDeviation(standardDeviation: number): void

Methods

filter

  • Filters the given texture in the given direction using the configured weights. The weights will be recalculated if necessary.

    Parameters

    • texture: Texture2D

      The float texture to filter.

    • direction: Direction

      The direction to filter the texture in.

    Returns void

initialize

Protected recalculateWeights

  • recalculateWeights(): boolean
  • Recalculates the weights if necessary.

    Returns boolean

    • True if the weights were recalculated, false otherwise.

uninitialize

  • uninitialize(): void

Static Protected Readonly assertInitializedFalse

Static Protected Readonly assertUninitializedFalse

Static assert_initialized

  • assert_initialized(): MethodDecorator

Static assert_uninitialized

  • assert_uninitialized(): MethodDecorator

Static discard

  • discard(): MethodDecorator
  • Method decorator for discarding of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be discarded, invokes its uninitialization, and falsifies the initialization status. In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to a static, always-failing assert and an empty/undefined function respectively.

    Returns MethodDecorator

Static initialize

  • initialize(): MethodDecorator
  • Method decorator for initialization of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be initialized, invokes its initialization with arbitrary number of parameters, and sets the initialization status to the initialization success (either false or true). In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to either a static, always-failing assert or an empty/undefined function.

    Returns MethodDecorator

Static uninitialize

  • uninitialize(): MethodDecorator
  • Method decorator for uninitialization of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be uninitialized, invokes its uninitialization, and falsifies the initialization status. In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to a static, always-failing assert and an empty/undefined function respectively.

    Returns MethodDecorator