Contents

BNNSLinearSamplingOffsetCorners

The offset corners sampling mode.

Declaration

var BNNSLinearSamplingOffsetCorners: BNNSLinearSamplingMode { get }

Discussion

Given an input grid with a size of Xin and an output grid with a size Xout, this mode samples the grid using the following:

delta = max(1, Xin - 1) / Xout
spacing = ((Xout - 1) * delta) / (Xout - 1)

grid_point[i] = min(Xin-1, max(0, 0.5*delta + i*spacing)), for i=0,1,...,Xout-1

See Also

Constants