frame

package
v0.0.0-...-934acc1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

package frame wraps raw webcam frames as an image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FourCCToPixelFormat

func FourCCToPixelFormat(f FourCC) (webcam.PixelFormat, error)

FourCCToPixelFormat converts the four character string to a v4l2 PixelFormat.

func GetFramer

func GetFramer(format FourCC, w, h, stride, size int) (func([]byte, func()) (Frame, error), error)

GetFramer returns a function that wraps the frame for this format.

func RegisterFramer

func RegisterFramer(format FourCC, factory func(int, int, int, int) func([]byte, func()) (Frame, error))

RegisterFramer registers a framer factory for a format. Note that only one handler can be registered for any single format.

Types

type FourCC

type FourCC string

func PixelFormatToFourCC

func PixelFormatToFourCC(pf webcam.PixelFormat) FourCC

PixelFormatToFourCC converts the v4l2 PixelFormat to a FourCC.

type Frame

type Frame interface {
	image.Image
	Release()
}

Release is called when the frame is no longer in use. The implementation may set a finalizer on the frame as a precaution in case Release is not called (which would cause a kernel resource leak).

Jump to

Keyboard shortcuts

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