Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KernelI32

Hierarchy

Index

Constructors

constructor

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

Properties

Protected _components

_components: 1 | 2 | 3 | 4

Protected _depth

_depth: GLsizei
see

depth

Protected _height

_height: GLsizei
see

height

Protected _samples

_samples: Int32Array

Protected _width

_width: GLsizei
see

width

Accessors

bytesLength

  • get bytesLength(): GLsizei

bytesPerComponent

  • get bytesPerComponent(): GLsizei

components

  • get components(): GLsizei

depth

  • get depth(): GLsizei

elements

  • get elements(): GLsizei

height

  • get height(): GLsizei

length

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

    Returns GLsizei

samples

  • get samples(): Int32Array

width

  • get width(): GLsizei

xStride

  • get xStride(): GLsizei

yStride

  • get yStride(): GLsizei

zStride

  • get zStride(): GLsizei

Methods

fromArray

  • fromArray(samples: Array<number>): void
  • Copies and converts samples to this kernels typed samples.

    Parameters

    • samples: Array<number>

      Flat array of all sample values.

    Returns void

fromJSON

get

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

    Parameters

    • xPosOrIndex: GLsizei

      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: GLsizei

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

    • Optional zPos: GLsizei

      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: GLsizei, yPos?: GLsizei, zPos?: GLsizei): GLsizei
  • Returns the index of an element at a specific position.

    Parameters

    • xPos: GLsizei

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

    • Default value yPos: GLsizei = 0

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

    • Default value zPos: GLsizei = 0

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

    Returns GLsizei

    • The index of the element at the requested position.

position

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

    Parameters

    • index: GLsizei

      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: GLsizei, yPos?: GLsizei, zPos?: GLsizei): 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: GLsizei

      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: GLsizei

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

    • Optional zPos: GLsizei

      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

    • approach: SortApproach

      Sorting approach that is to be used.

    Returns void