hybridgroup.gobot/platforms/opencv/window_driver.go

29 lines
554 B
Go
Raw Normal View History

2014-04-28 07:58:34 +08:00
package opencv
import (
cv "github.com/hybridgroup/go-opencv/opencv"
"github.com/hybridgroup/gobot"
)
type WindowDriver struct {
gobot.Driver
window *cv.Window
}
func NewWindowDriver() *WindowDriver {
return &WindowDriver{}
}
func (w *WindowDriver) Start() bool {
cv.StartWindowThread()
w.window = cv.NewWindow(w.Name, cv.CV_WINDOW_NORMAL)
return true
}
func (w *WindowDriver) Halt() bool { return true }
func (w *WindowDriver) Init() bool { return true }
func (w *WindowDriver) ShowImage(image *cv.IplImage) {
w.window.ShowImage(image)
}