summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--integralimg.go8
1 files changed, 8 insertions, 0 deletions
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