From 89de06b827594d5336efcbbd726886fdec113b39 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 23 Jul 2020 16:55:33 +0100 Subject: Add remaining SqImage versions of I functions --- integralimg.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'integralimg.go') diff --git a/integralimg.go b/integralimg.go index b40944a..d0bcb34 100644 --- a/integralimg.go +++ b/integralimg.go @@ -221,6 +221,10 @@ func (i I) GetWindow(x, y, size int) Window { return Window { i[miny][minx], i[miny][maxx], i[maxy][minx], i[maxy][maxx], maxx-minx, maxy-miny} } +func (i SqImage) GetWindow(x, y, size int) Window { + return I(i).GetWindow(x, y, size) +} + // GetVerticalWindow gets the values of the corners of a vertical // slice of an Integral Image, starting at x func (i I) GetVerticalWindow(x, width int) Window { @@ -233,6 +237,10 @@ func (i I) GetVerticalWindow(x, width int) Window { return Window { i[0][x], i[0][maxx], i[maxy][x], i[maxy][maxx], width, maxy } } +func (i SqImage) GetVerticalWindow(x, width int) Window { + return I(i).GetVerticalWindow(x, width) +} + // Sum returns the sum of all pixels in a Window func (w Window) Sum() uint64 { return w.bottomright + w.topleft - w.topright - w.bottomleft -- cgit v1.2.1-24-ge1ad