DriftTexture · interface

Operator

Explained in DriftTexture.

interface Operator
import type { Operator } from '@driftengine/texture';

Properties

NameTypeDescription
arityreadonlyreadonly [number, number]How many inputs it takes, fewest and most.
ranksreadonlyoptionalreadonly number[]The rank each input must have, in order, where it matters. Checked before shape runs, because an operator reading an image as [channels, height, width] reads a value with one more axis as its first three and validates it — and then declares an output it fills only part of.

Methods

shape

shape(inputs: readonly Shape[], attributes: Attributes): number[] | string
ParameterTypeDescription
inputsreadonly Shape[]
attributesAttributes

scratchoptional

scratch?(inputs: readonly Shape[], attributes: Attributes): number

Scratch values it needs beyond its output, if any.

ParameterTypeDescription
inputsreadonly Shape[]
attributesAttributes

evaluate

evaluate(inputs: readonly Float32Array[], shapes: readonly Shape[], attributes: Attributes, out: Float32Array, scratch: Float32Array): void
ParameterTypeDescription
inputsreadonly Float32Array[]
shapesreadonly Shape[]
attributesAttributes
outFloat32Array
scratchFloat32Array