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