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) -> Tat(field: Grid<T>, at: Vec2) -> Tat(field: Grid<T>, at: IVec2) -> Tat(field: Volume<T>, at: Vec3) -> Tat(field: Volume<T>, at: IVec3) -> TThe 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
Section titled “at_linear”at_linear(field: Rows<T>, position: Float) -> Tat_linear(field: Grid<T>, position: Vec2) -> Tat_linear(field: Volume<T>, position: Vec3) -> TThe 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>) -> Intcount(field: Grid<T>) -> Intcount(field: Volume<T>) -> IntHow many elements the Field has.
需要能力: field.read
fetch(field: Rows<T>, index: Int) -> Tfetch(field: Grid<T>, at: Vec2) -> Tfetch(field: Grid<T>, at: IVec2) -> Tfetch(field: Volume<T>, at: Vec3) -> Tfetch(field: Volume<T>, at: IVec3) -> TAnother name for at.
需要能力: field.read
isize(field: Rows<T>) -> Intisize(field: Grid<T>) -> IVec2isize(field: Volume<T>) -> IVec3The Field’s extent along each axis, as integers.
需要能力: field.read
sample
Section titled “sample”sample(field: Rows<T>) -> Tsample(field: Grid<T>) -> Tsample(field: Volume<T>) -> TThe input’s element at this element’s own coordinates, clamped into the input.
需要能力: field.read · 只能在 Kernel 主体中调用
size(field: Grid<T>) -> Vec2size(field: Volume<T>) -> Vec3The Field’s extent along each axis.
需要能力: field.read

