summaryrefslogtreecommitdiff
path: root/wipesides.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-08-04 17:16:18 +0100
committerNick White <git@njw.name>2020-08-04 17:16:18 +0100
commit194c11847ff55e41301da04c86118609bfc28188 (patch)
treee51845eb0b233139370000e619914c2a5a23fea7 /wipesides.go
parentadd5499c74e7884edeca03ca045e41b1ac7888c5 (diff)
Slightly simplify a couple of wipesides.go functions
Diffstat (limited to 'wipesides.go')
-rw-r--r--wipesides.go4
1 files 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