mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-27 13:48:56 +08:00
Fix error with caputre and window interfaces
This commit is contained in:
parent
386042575f
commit
e4811ad1cb
@ -11,6 +11,11 @@ import (
|
|||||||
|
|
||||||
var _ gobot.Driver = (*CameraDriver)(nil)
|
var _ gobot.Driver = (*CameraDriver)(nil)
|
||||||
|
|
||||||
|
type capture interface {
|
||||||
|
RetrieveFrame(int) *cv.IplImage
|
||||||
|
GrabFrame() bool
|
||||||
|
}
|
||||||
|
|
||||||
type CameraDriver struct {
|
type CameraDriver struct {
|
||||||
name string
|
name string
|
||||||
camera capture
|
camera capture
|
||||||
|
@ -2,11 +2,6 @@ package opencv
|
|||||||
|
|
||||||
import cv "github.com/hybridgroup/go-opencv/opencv"
|
import cv "github.com/hybridgroup/go-opencv/opencv"
|
||||||
|
|
||||||
type capture interface {
|
|
||||||
RetrieveFrame(int) *cv.IplImage
|
|
||||||
GrabFrame() bool
|
|
||||||
}
|
|
||||||
|
|
||||||
type testCapture struct{}
|
type testCapture struct{}
|
||||||
|
|
||||||
func (c *testCapture) RetrieveFrame(i int) *cv.IplImage {
|
func (c *testCapture) RetrieveFrame(i int) *cv.IplImage {
|
||||||
@ -17,10 +12,6 @@ func (c *testCapture) GrabFrame() bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
type window interface {
|
|
||||||
ShowImage(*cv.IplImage)
|
|
||||||
}
|
|
||||||
|
|
||||||
type testWindow struct{}
|
type testWindow struct{}
|
||||||
|
|
||||||
func (w *testWindow) ShowImage(i *cv.IplImage) { return }
|
func (w *testWindow) ShowImage(i *cv.IplImage) { return }
|
||||||
|
@ -7,6 +7,10 @@ import (
|
|||||||
|
|
||||||
var _ gobot.Driver = (*WindowDriver)(nil)
|
var _ gobot.Driver = (*WindowDriver)(nil)
|
||||||
|
|
||||||
|
type window interface {
|
||||||
|
ShowImage(*cv.IplImage)
|
||||||
|
}
|
||||||
|
|
||||||
type WindowDriver struct {
|
type WindowDriver struct {
|
||||||
name string
|
name string
|
||||||
window window
|
window window
|
||||||
|
Loading…
x
Reference in New Issue
Block a user