Documentation
¶
Overview ¶
Package camera shows what a phone's camera sees in a window's native UI, and takes photos: AVCaptureSession on iOS, CameraX on Android. For a photo in the system's own camera screen, use package imagepicker: it needs no permission.
cam, err := camera.New(win, camera.Options{})
...
ui.WebView(c, cam).Fill() // in the view; what it draws after shows over the preview
path, err := cam.TakePhoto(ctx)
The preview shows under the content, as a web view does. On desktops and in browsers New reports errors.ErrUnsupported.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type Camera struct {
// contains filtered or unexported fields
}
Camera is a preview of a camera, which takes photos. Show it with ui.WebView.
func New ¶
New asks the user for the camera, the first time, and makes its preview in a window showing native UI.
func (*Camera) Destroy ¶
func (c *Camera) Destroy()
Destroy stops the camera and takes its preview away.
func (*Camera) SurfaceWebView ¶
SurfaceWebView gives package ui the view to show.