From 194c11847ff55e41301da04c86118609bfc28188 Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 4 Aug 2020 17:16:18 +0100 Subject: Slightly simplify a couple of wipesides.go functions --- wipesides.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wipesides.go b/wipesides.go index 644bc9c..9183479 100644 --- a/wipesides.go +++ b/wipesides.go @@ -143,7 +143,7 @@ func wipesides(img *image.Gray, lowedge int, highedge int) *image.Gray { // toonarrow checks whether the area between lowedge and highedge is // less than min % of the total image width -func toonarrow(img *image.Gray, lowedge int, highedge int, min int) bool { +func toonarrow(img image.Image, lowedge int, highedge int, min int) bool { b := img.Bounds() imgw := b.Max.X - b.Min.X wipew := highedge - lowedge @@ -161,7 +161,7 @@ func sideways(img image.Image) *image.Gray { for x := b.Min.X; x < b.Max.X; x++ { for y := b.Min.Y; y < b.Max.Y; y++ { c := img.At(x, y) - new.SetGray(y, x, color.GrayModel.Convert(c).(color.Gray)) + new.Set(y, x, c) } } return new -- cgit v1.2.1-24-ge1ad