跳转到内容
查看源码

Field 读取(field)自动生成

从绑定到输入端口的 Field 中读取元素与尺寸。

返回 函数 需要能力
T at (field: Rows<T>, index: Int) +4 field.read
T at_linear (field: Rows<T>, position: Float) +2 field.read
Int count (field: Rows<T>) +2 field.read
T fetch (field: Rows<T>, index: Int) +4 field.read
Int isize (field: Rows<T>) +2 field.read
T sample (field: Rows<T>) +2 field.read
Vec2 size (field: Grid<T>) +1 field.read
at(field: Rows<T>, index: Int) -> T
at(field: Grid<T>, at: Vec2) -> T
at(field: Grid<T>, at: IVec2) -> T
at(field: Volume<T>, at: Vec3) -> T
at(field: Volume<T>, at: IVec3) -> T

The element at an address: the index, or the coordinates floored, clamped into the Field (NaN as zero). A memory reads as the steps have left it, and as it was bound in a scan’s initial value.

需要能力: field.read


at_linear(field: Rows<T>, position: Float) -> T
at_linear(field: Grid<T>, position: Vec2) -> T
at_linear(field: Volume<T>, position: Vec3) -> T

The neighboring elements blended by the fractional position (element centers at .5), T of floats only; clamped at the edges.

需要能力: field.read


count(field: Rows<T>) -> Int
count(field: Grid<T>) -> Int
count(field: Volume<T>) -> Int

How many elements the Field has.

需要能力: field.read


fetch(field: Rows<T>, index: Int) -> T
fetch(field: Grid<T>, at: Vec2) -> T
fetch(field: Grid<T>, at: IVec2) -> T
fetch(field: Volume<T>, at: Vec3) -> T
fetch(field: Volume<T>, at: IVec3) -> T

Another name for at.

需要能力: field.read


isize(field: Rows<T>) -> Int
isize(field: Grid<T>) -> IVec2
isize(field: Volume<T>) -> IVec3

The Field’s extent along each axis, as integers.

需要能力: field.read


sample(field: Rows<T>) -> T
sample(field: Grid<T>) -> T
sample(field: Volume<T>) -> T

The input’s element at this element’s own coordinates, clamped into the input.

需要能力: field.read · 只能在 Kernel 主体中调用


size(field: Grid<T>) -> Vec2
size(field: Volume<T>) -> Vec3

The Field’s extent along each axis.

需要能力: field.read