image

package
v0.0.0-...-ab0a638 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: EUPL-1.2 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedFile = errors.New("unsupported file type")

ErrUnsupportedFile is returned when the given file is not supported.

Functions

This section is empty.

Types

type GIF

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

GIF is a Generator that generates the pixels from a GIF image file.

func NewGIF

func NewGIF(r io.Reader, options pixel.GeneratorOptions) (GIF, error)

NewGIF initialises a GIF from the given image file, with the given parameters.

func (GIF) Generate

func (g GIF) Generate(ctx context.Context, n int, ch chan<- []packet.Packet)

type Image

type Image struct {
	pixel.Buffer
}

Image represents a generic static image. It implements pixel.Generator.

func NewImageGenerator

func NewImageGenerator(img image.Image, options pixel.GeneratorOptions) Image

NewImageGenerator returns a Generator for the given image and offsets. The pixel order can be randomized.

func NewPNG

func NewPNG(r io.Reader, options pixel.GeneratorOptions) (Image, error)

NewPNG initialises an Image from a PNG data stream.

type Updater

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

Updater implements a pixel.Generator that updates an image from a given source.

func FromFile

func FromFile(path string, options pixel.GeneratorOptions) (*Updater, error)

FromFile returns an Updater that refreshes from a given file.

func FromWeb

func FromWeb(uri string, options pixel.GeneratorOptions) (*Updater, error)

FromWeb returns an Updater that refreshes from a given URL.

func NewGetter

func NewGetter(interval time.Duration, get func() (pixel.Generator, error)) (*Updater, error)

NewGetter returns a Updater that updates the image based on the given function. The source is not refreshed when the given interval is zero.

func (*Updater) Generate

func (w *Updater) Generate(ctx context.Context, n int, ch chan<- []packet.Packet)

Jump to

Keyboard shortcuts

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