diff --git a/stream.go b/stream.go index b12b5b8..bc200ea 100755 --- a/stream.go +++ b/stream.go @@ -17,10 +17,11 @@ import ( // Stream Unexported type Stream struct { - URL string `json:"url"` - Base64 string `json:"base64"` - Interval int `json:"interval"` - FileLock sync.Mutex `json:"lock"` + URL string `json:"url"` + Base64 string `json:"base64"` + Interval int `json:"interval"` + Areas map[string][]image.Rectangle `json:"areas"` + FileLock sync.Mutex `json:"lock"` } // NewStream creates a new Stream Object @@ -31,7 +32,22 @@ func NewStream(URL string) Stream { URL: URL, Base64: base64, Interval: 5000, + Areas: make(map[string][]image.Rectangle), } + rectList := make([]image.Rectangle, 0) + rectList = append(rectList, image.Rectangle{ + Min: image.Point{X: 30, Y: 30}, + Max: image.Point{X: 400, Y: 200}, + }) + rectList = append(rectList, image.Rectangle{ + Min: image.Point{X: 500, Y: 30}, + Max: image.Point{X: 400, Y: 200}, + }) + rectList = append(rectList, image.Rectangle{ + Min: image.Point{X: 500, Y: 500}, + Max: image.Point{X: 400, Y: 200}, + }) + stream.Areas["test"] = rectList stream.WriteStreamJSON() return stream }