def band
stelliferous@0.0.2.0 · kernel_window.bend:18
import stelliferous@0.0.2.0/kernel_window.bend as KernelWindow
import Base
18
19
20
21def band(+parent_first: U32,+parent_rows: U32,+height: U32,+kernel: U32,+stride: U32,+padding: U32,+output_width: U32,+offset: U32,+span: U32) -> Band:
22 +parent_end = (parent_first + parent_rows : U32)
23 +top = ((parent_end - 1) / stride * stride : U32)
24 +first = U32.max(parent_first,U32.min(first_row(stride,padding,(offset / output_width : U32)),top))
25 +last = end_row(height,kernel,stride,padding,((offset + span - 1) / output_width : U32))
26 Band{first,(U32.min(parent_end,U32.max(last,(first + 1 : U32))) - first : U32)}