Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KernelF32

Hierarchy

Index

Constructors

constructor

  • new KernelF32(components: 2 | 3 | 1 | 4, width: number, height?: number, depth?: number): KernelF32

Properties

Protected _components

_components: 2 | 3 | 1 | 4

Protected _depth

_depth: number
see

depth

Protected _height

_height: number
see

height

Protected _samples

_samples: Float32Array

Protected _width

_width: number
see

width

Accessors

bytesLength

  • get bytesLength(): number

bytesPerComponent

  • get bytesPerComponent(): number

components

  • get components(): number
  • Number of components per sample, e.g., 2 for 2-tuple samples, 3 for 3-tuple samples, etc.

    Returns number

depth

  • get depth(): number

elements

  • get elements(): number

height

  • get height(): number

length

  • get length(): number
  • Returns the number of samples, i.e., the number of elements times the number of components per element.

    Returns number

samples

  • get samples(): T

width

  • get width(): number

xStride

  • get xStride(): number
  • Distance between the indices of two adjacent elements along the x-axis in bytes.

    Returns number

yStride

  • get yStride(): number
  • Distance between the indices of two adjacent elements along the y-axis in bytes.

    Returns number

zStride

  • get zStride(): number
  • Distance between the indices of two adjacent elements along the z-axis in bytes.

    Returns number

Methods

fromArray

  • fromArray(samples: number[]): void

fromJSON

  • fromJSON(json: KernelJSON): void

get

  • get(xPosOrIndex: number, yPos?: number, zPos?: number): number[]
  • Returns the n-tuple/n-component element at index within the cached kernel.

    Parameters

    • xPosOrIndex: number

      If x is greater than width, this is interpreted as overall kernel index (requires y and z positions to be undefined). Position is clamped to the range [0, width - 1].

    • Optional yPos: number

      Position along the y-axis to access the kernel element at (clamped to range [0, height - 1]).

    • Optional zPos: number

      Position along the z-axis to access the kernel element at (clamped to range [0, depth - 1]).

    Returns number[]

    • Tuple of all components of the element at the requested index/position.

index

  • index(xPos: number, yPos?: number, zPos?: number): number
  • Returns the index of an element at a specific position.

    Parameters

    • xPos: number

      Position along the x-axis (clamped to range [0, width - 1]).

    • yPos: number = 0

      Position along the y-axis (clamped to range [0, height - 1]).

    • zPos: number = 0

      Position along the z-axis (clamped to range [0, depth - 1]).

    Returns number

    • The index of the element at the requested position.

position

  • Returns the position of an element at a specific index.

    Parameters

    • index: number

      Index of the requested position (clamped to range [0, size]).

    Returns GLsizei3

    • The position of the element at the requested index as 3-tuple [x, y, z].

Protected resize

  • resize(): void

set

  • set(sample: number[], xPosOrIndex: number, yPos?: number, zPos?: number): void
  • Sets the n-tuple/n-component sample at index within the cached kernel.

    Parameters

    • sample: number[]

      Values to be set at specified index or position.

    • xPosOrIndex: number

      If x is greater than width, this is interpreted as overall kernel index (requires y and z positions to be undefined). Position is clamped to the range [0, width - 1].

    • Optional yPos: number

      Position along the y-axis to access the kernel element at (clamped to range [0, height - 1]).

    • Optional zPos: number

      Position along the z-axis to access the kernel element at (clamped to range [0, depth - 1]).

    Returns void

sort

  • Sorts all samples based on the given sorting approach, e.g., by length of a sample. In order to sort an array of samples comprising a number of components an sort-auxiliary array is created, sorted, and, finally, mapped to the sample array.

    Parameters

    Returns void