canvas

package
v1.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	// contains filtered or unexported fields
}

Canvas struct holds the Javascript objects needed for the Canvas creation

func NewCanvas

func NewCanvas() *Canvas

NewCanvas creates and initializes the new Canvas element

func (*Canvas) Alert

func (c *Canvas) Alert(args ...interface{})

Alert calls the `alert` Javascript function

func (*Canvas) Log

func (c *Canvas) Log(args ...interface{})

Log calls the `console.log` Javascript function

func (*Canvas) Render

func (c *Canvas) Render() error

Render calls the `requestAnimationFrame` Javascript function in asynchronous mode.

func (*Canvas) StartWebcam

func (c *Canvas) StartWebcam() (*Canvas, error)

StartWebcam reads the webcam data and feeds it into the canvas element. It returns an empty struct in case of success and error in case of failure.

func (*Canvas) Stop

func (c *Canvas) Stop()

Stop stops the rendering.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL