code: func createWeights8(dy, filterLength int, blur, scale float64, kernel func(float64) float64) ([]int16, []int, int) {
  	filterLength = filterLength * int(math.Max(math.Ceil(blur*scale), 1))
  	filterFactor := math.Min(1./(blur*scale), 1)
  
  	coeffs := make([]int16, dy*filterLength)
  	start := make([]int, dy)
  	for y := 0; y < dy; y++ {
  		interpX := scale*(float64(y)+0.5) - 0.5
  		start[y] = int(interpX) - filterLength/2 + 1
  		interpX -= float64(start[y])
  		for i := 0; i < filterLength; i++ {
  			in := (interpX - float64(i)) * filterFactor
  			coeffs[y*filterLength+i] = int16(kernel(in) * 256)
  		}
  	}
  
  	return coeffs, start, filterLength
  }
docs: // range [-256,256]