fotos

package
v0.0.0-...-cd3e5cb Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Countdown

func Countdown(t time.Duration)

func CountdownTime

func CountdownTime() time.Duration

func Device

func Device() string

func ImageUpdater

func ImageUpdater(f func(string, *Image))

func License

func License() string

func Msgs

func Msgs(name string) string

func Panic

func Panic(msg string)

func Path

func Path(path ...string) string

func RegisterCam

func RegisterCam(name string, c Camera)

func RegisterUI

func RegisterUI(name string, ui UserInterface)

func Run

func Run()

func RunUI

func RunUI()

func Runner

func Runner(r func())

func SaveDir

func SaveDir() string

func ShowImage

func ShowImage(i *Image)

func ShowMsg

func ShowMsg(msg string)

func TakePicture

func TakePicture()

Types

type Camera

type Camera interface {
	Ready(in time.Duration) // gets called a few seconds before picture is taken
	TakePicture() (*Image, error)
}

func GetCam

func GetCam() Camera

type Config

type Config map[string]string

func Conf

func Conf() Config

type Image

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

Image can either contain a []byte with JPEG data or a image.Image which can both be semlessly converted between

func ImageFromBytes

func ImageFromBytes(b []byte) *Image

func ImageFromImage

func ImageFromImage(i image.Image) *Image

func (*Image) Bytes

func (i *Image) Bytes() []byte

func (*Image) Image

func (i *Image) Image() image.Image

type UserInterface

type UserInterface interface {
	Countdown(i time.Duration) // should wait i seconds and display countdown
	ShowImage(*Image)          // should down a image as result
	ShowMsg(string)            // should show a message string
	SetStatus(string)          // should set a (almost) always visible status string

	Run() // start ui
}

func GetUI

func GetUI() UserInterface

Jump to

Keyboard shortcuts

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