mapasci

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVerticalMarginRows  = 2
	DefaultVerticalPaddingRows = DefaultVerticalMarginRows
)
View Source
const (
	DefaultAnimationFPS = 2
)

Variables

This section is empty.

Functions

func CharForLandFraction

func CharForLandFraction(fraction float64) (byte, error)

func RenderWorldASCII

func RenderWorldASCII(mask *LandMask, size int, supersample int, charAspect float64, marker *Marker) (string, error)

func RenderWorldASCIIWithOptions added in v0.1.1

func RenderWorldASCIIWithOptions(mask *LandMask, size int, supersample int, charAspect float64, marker *Marker, options *RenderOptions) (string, error)

func SampleLandValue

func SampleLandValue(mask *LandMask, lon float64, lat float64) (float64, error)

func StreamWorldASCIIAnimation added in v0.2.0

func StreamWorldASCIIAnimation(
	ctx context.Context,
	mask *LandMask,
	size int,
	supersample int,
	charAspect float64,
	marker *Marker,
	renderOpts *RenderOptions,
	animOpts *AnimationOptions,
	emit func(Frame) error,
) error

Types

type AnimationOptions added in v0.2.0

type AnimationOptions struct {
	FPS      int
	Style    AnimationStyle
	Duration time.Duration
}

type AnimationStyle added in v0.2.0

type AnimationStyle string
const (
	AnimationStylePulseColor AnimationStyle = "pulse-color"
	AnimationStyleBlink      AnimationStyle = "blink"
)

type Frame added in v0.2.0

type Frame struct {
	Text string
}

type LandMask

type LandMask struct {
	Width  int
	Height int
	Data   []float64
}

func LoadLandMask

func LoadLandMask(maskPath string) (*LandMask, error)

type Marker

type Marker struct {
	Lon        float64
	Lat        float64
	Center     rune
	Horizontal rune
	Vertical   rune
	ArmX       int
	ArmY       int
}

type RenderOptions added in v0.1.1

type RenderOptions struct {
	VerticalMarginRows  int
	VerticalPaddingRows int
	Frame               bool
	ColorMode           string
	MapColor            string
	FrameColor          string
	MarkerColor         string
	Viewport            *Viewport
}

type Viewport added in v0.3.0

type Viewport struct {
	MinLon float64
	MinLat float64
	MaxLon float64
	MaxLat float64
}

Jump to

Keyboard shortcuts

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