address

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	// Convert converts the x/y/color pixel value into an IPv6 address.
	Convert(x, y int, c color.Color) netip.Addr
}

Generator represents a pixel to IPv6 address generator.

func NewLegacy

func NewLegacy(prefix string, options GeneratorOpts) Generator

NewLegacy returns a configured Legacy Generator.

type GeneratorOpts

type GeneratorOpts struct {
	// Color mode to use.
	ColorMode string

	// Pixel offsets.
	Offset image.Point

	// Canvas size
	CanvasSize image.Point
}

GeneratorOpts contains the options for initializing a generator.

type Legacy

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

Legacy implements the original IPv6 Christmas tree LED screen format. The pixel format for this is: <prefix>:<x>:<y>:<r>:<g>:<b>, with x/y in decimal and r/g/b in hexadecimal.

func (*Legacy) Convert

func (l *Legacy) Convert(x, y int, c color.Color) netip.Addr

Convert converts the x/y/color pixel value into an IPv6 address.

type RGBA

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

RGBA represents a generic RGBA generator. The pixel format for this is <prefix>:<x>:<y>:<c><c>:<c><c>, where c can be the R, G, B or A value.

func NewRGBA

func NewRGBA(prefix string, opts GeneratorOpts) (*RGBA, error)

NewRGBA returns an RGBA generator for the given prefix and mode. The mode is decoded into the color order, eg: "rgba".

func (*RGBA) Convert

func (n *RGBA) Convert(x, y int, c color.Color) netip.Addr

Convert converts the x/y/color pixel value into an IPv6 address.

type Tree

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

Tree implements the Generator for the simple IPv6 Christmas tree. The pixel format of this is <prefix>:<r>:<g>:<b> (in hex). Note that there is no x/y information.

func NewTree

func NewTree(prefix string) (Tree, error)

NewTree returns a Tree Generator for the given prefix.

func (Tree) Convert

func (t Tree) Convert(_, _ int, c color.Color) netip.Addr

Convert converts the x/y/color pixel value into an IPv6 address.

Jump to

Keyboard shortcuts

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