summaryrefslogtreecommitdiff
path: root/integralimg_test.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-07-23 15:01:41 +0100
committerNick White <git@njw.name>2020-07-23 15:01:41 +0100
commitd9c6a724e97141db9cbaa66226e0410a5535ae28 (patch)
treed5c6bba5548bcf269470e5bfe8941a319259f9f8 /integralimg_test.go
parent1ae8e38ba4d9c141533a5a44e9fc1c470f4b29ff (diff)
Add Set and NewImage functions to implement image/draw.Image interface
Now the integralimg can be created directly from an image using image/draw.Draw.
Diffstat (limited to 'integralimg_test.go')
-rw-r--r--integralimg_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/integralimg_test.go b/integralimg_test.go
index 3bc8dd6..df97caa 100644
--- a/integralimg_test.go
+++ b/integralimg_test.go
@@ -23,10 +23,9 @@ func TestFromPNG(t *testing.T) {
t.Fatalf("Could not decode image: %v\n", err)
}
b := img.Bounds()
- gray := image.NewGray(image.Rect(0, 0, b.Dx(), b.Dy()))
- draw.Draw(gray, b, img, b.Min, draw.Src)
- integral := ToIntegralImg(gray)
+ integral := NewImage(image.Rect(0, 0, b.Dx(), b.Dy()))
+ draw.Draw(integral, b, img, b.Min, draw.Src)
if !imgsequal(img, integral) {
t.Errorf("Read png image differs to integral\n")