encode

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebPKMin                 = 0
	WebPKMax                 = 0
	DefaultScreenDelayMillis = 50
	DefaultMaxAgeSeconds     = 0 // 0 => no max age, cache forever!
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageFilter

type ImageFilter func(image.Image) (image.Image, error)

type Screens

type Screens struct {
	MaxAge            int32
	ShowFullAnimation bool
	// contains filtered or unexported fields
}

func ScreensFromImages

func ScreensFromImages(images ...image.Image) *Screens

func ScreensFromRoots

func ScreensFromRoots(roots []render.Root) *Screens

func (*Screens) EncodeGIF

func (s *Screens) EncodeGIF(maxDuration int, filters ...ImageFilter) ([]byte, error)

Renders a screen to GIF. Optionally pass filters for postprocessing each individual frame.

func (*Screens) EncodeWebP

func (s *Screens) EncodeWebP(maxDuration int, filters ...ImageFilter) ([]byte, error)

Renders a screen to WebP. Optionally pass filters for postprocessing each individual frame.

func (*Screens) Hash added in v0.6.2

func (s *Screens) Hash() ([]byte, error)

Hash returns a hash of the render roots for this screen. This can be used for testing whether two render trees are exactly equivalent, without having to do the actual rendering.

Jump to

Keyboard shortcuts

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