Add option to draw images with WebGL

This commit is contained in:
Milan Nikolic
2017-10-06 10:29:21 +02:00
parent f36a47b9a2
commit a9c82d2d6e
4 changed files with 124 additions and 17 deletions

View File

@@ -24,6 +24,7 @@ type Server struct {
Delay int
FrameWidth float64
FrameHeight float64
WebGL bool
Camera *camera.Camera
}
@@ -42,7 +43,7 @@ func (s *Server) ListenAndServe() error {
basic = auth.NewBasicAuthenticator(realm, auth.HtpasswdFileProvider(s.Htpasswd))
}
http.Handle("/html", newAuthHandler(handlers.NewHTML(s.Bind, s.FrameWidth, s.FrameHeight), basic))
http.Handle("/html", newAuthHandler(handlers.NewHTML(s.Bind, s.FrameWidth, s.FrameHeight, s.WebGL), basic))
http.Handle("/jpeg", newAuthHandler(handlers.NewJPEG(s.Camera), basic))
http.Handle("/mjpeg", newAuthHandler(handlers.NewMJPEG(s.Camera, s.Delay), basic))