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 _kernelSize

_kernelSize: GLsizei = 7

Protected _ndcTriangle

_ndcTriangle: NdcFillingTriangle

Protected _ndcTriangleShared

_ndcTriangleShared: boolean = false

Protected _program

_program: Program

Protected _redistribute

_redistribute: GLboolean = true

Protected _standardDeviation

_standardDeviation: GLfloat = 1

Protected _uDirection

_uDirection: WebGLUniformLocation

Protected _uKernelSize

_uKernelSize: WebGLUniformLocation

Protected _uTextureSize

_uTextureSize: WebGLUniformLocation

Protected _uWeights

_uWeights: WebGLUniformLocation

Protected _weights

_weights: [number, Array] & object | undefined

Static Protected _MAXKERNELSIZEHALF

_MAXKERNELSIZEHALF: 32 = 32

Accessors

initialized

  • get initialized(): boolean

kernelSize

  • get kernelSize(): GLsizei
  • set kernelSize(kernelSize: GLsizei): void
  • Size of the kernel.

    Returns GLsizei

  • Sets the size of the kernel. The kernel size has to be an odd integer.

    Parameters

    • kernelSize: GLsizei

    Returns void

redistribute

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

    Returns GLboolean

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

    Parameters

    • redistribute: GLboolean

    Returns void

standardDeviation

  • get standardDeviation(): GLfloat
  • set standardDeviation(standardDeviation: GLfloat): void
  • Standard deviation used to calculate the weights.

    Returns GLfloat

  • Sets the standard deviation.

    Parameters

    • standardDeviation: GLfloat

    Returns void

Methods

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.

    Returns void

Protected assertUninitialized

  • assertUninitialized(): undefined
  • 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.

    Returns undefined

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

  • Creates and initializes the gaussian filters resources.

    Parameters

    • Optional ndcTriangle: NdcFillingTriangle

      If specified, assumed to be used as shared geometry. If none is specified, a ndc-filling triangle will be created internally.

    Returns boolean

Protected recalculateWeights

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

    Returns boolean

    • True if the weights were recalculated, false otherwise.

uninitialize

  • uninitialize(): void

Static Protected assertInitializedFalse

Static Protected assertUninitializedFalse

Static assert_initialized

Static assert_uninitialized

Static initialize

  • 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

  • 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