pixel

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize = 1024

BufferSize is the default buffer size for a set of IPv6 messages.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer []packet.Packet

Buffer is a Generator that produces the packets from the given buffer.

func (Buffer) Generate

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

Generate implements pixel.Generator.

type Generator

type Generator interface {
	// Generate pushes the generation result `n` times to the given channel `ch`.
	// The given channel is not closed afterward, and may be used again.
	Generate(ctx context.Context, n int, ch chan<- []packet.Packet)
}

Generator represents an IPv6 message generator.

type GeneratorOptions

type GeneratorOptions struct {
	packet.Creator

	// Generator to use for generating destination addresses.
	Generator address.Generator

	// Randomize the pixel order.
	Randomize bool

	// Number of times to repeat frames when the file is animated.
	RepeatFrame int

	// Skip transparent pixels
	SkipTransparent bool

	// Interval on which to refresh the image.
	ReloadInterval time.Duration
}

GeneratorOptions contains the options for initializing a Generator.

type Stream

type Stream struct {
	// Size contains the number of pixels to iterate over.
	Size int

	// Gen contains a function that generates a single packet.
	Gen func(i int) packet.Packet
}

Stream is a Generator that generates pixels based on a given function. Generated results are buffered in memory.

func (Stream) Generate

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

Generate implements Generator.

Jump to

Keyboard shortcuts

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