Contents

BNNSLinearSamplingAlignCorners

The align corners sampling mode.

Declaration

var BNNSLinearSamplingAlignCorners: BNNSLinearSamplingMode { get }

Discussion

This sampling mode is the same as BNNSLinearSamplingStrictAlignCorners unless the input grid has a size of 1.

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:

spacing = (Xin - Xin/Xout) / (Xout - 1)

grid_point[0] = (Xin-1) / 2, if Xout==1
grid_point[i] = min(Xin-1, max(0, i*spacing)), for i=0,1,...,Xout-1, if Xout!=1

See Also

Constants