summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-07-23 16:55:33 +0100
committerNick White <git@njw.name>2020-07-23 16:55:33 +0100
commit89de06b827594d5336efcbbd726886fdec113b39 (patch)
tree2a92930f9717652c71fd18a98933ad2dbd659355
parentaf25f6abf822cc8767518c7854909f41307817b6 (diff)
Add remaining SqImage versions of I functions
-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