From a83cb40860f0d5856d903b5591054c0af4136cd7 Mon Sep 17 00:00:00 2001 From: jst Date: Tue, 28 Jan 2014 19:53:26 +0100 Subject: [PATCH] Remove some redundancies. --- filters.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/filters.go b/filters.go index 5cad466..deb66a7 100644 --- a/filters.go +++ b/filters.go @@ -65,7 +65,7 @@ func (f *filterModel) SetKernelWeights(u float32) { } } -func (f *filterModel) convolution1d(x float32) (c colorArray) { +func (f *filterModel) convolution1d() (c colorArray) { for j := range f.tempRow { for i := range c { c[i] += f.tempRow[j][i] * f.kernelWeight[j] @@ -88,7 +88,7 @@ func (f *filterModel) Interpolate(u float32, y int) color.RGBA64 { f.at(uf+i, y, &f.tempRow[i]) } - c := f.convolution1d(u) + c := f.convolution1d() return color.RGBA64{ clampToUint16(c[0]), clampToUint16(c[1]), @@ -227,8 +227,6 @@ func lanczosKernel(a uint) func(float32) float32 { } } -const lanczosTableSize = 300 - // Lanczos interpolation (a=2) func Lanczos2(img image.Image, factor float32) Filter { return createFilter(img, factor, 4, lanczosKernel(2))