// Assumes that f is no smaller than x. func copyRealToChannel(f *rimg64.Multi, p int, x *fftw.Array2) { for u := 0; u < f.Width; u++ { for v := 0; v < f.Height; v++ { f.Set(u, v, p, real(x.At(u, v))) } } }
// Avoids f.Set(x, y, d, f.Get(x, y, d, ...)). func addToMulti(f *rimg64.Multi, x, y, d int, v float64) { f.Set(x, y, d, f.At(x, y, d)+v) }