image

package
v0.0.0-...-560f132 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package image provides a simple wrapper to [go-staticmaps] for rendering images of track data. [go-staticmaps]: https://pkg.go.dev/github.com/flopp/go-staticmap

Index

Constants

This section is empty.

Variables

View Source
var (
	// Red represents the color Red.
	Red = color.RGBA{R: 255, A: 0xff}

	// Green represents the color Green.
	Green = color.RGBA{G: 255, A: 0xff}

	// Blue represents the color Blue.
	Blue = color.RGBA{B: 255, A: 0xff}
)

Functions

This section is empty.

Types

type Image

type Image struct {
	*sm.Context // Embedded to provide flexibility.
	// contains filtered or unexported fields
}

Image represents an track session which can render an image.

func New

func New(width, height int, options ...Option) *Image

New returns a new Image.

func (*Image) AddPath

func (i *Image) AddPath(positions []s2.LatLng, c color.Color)

AddPath add a path represented by positions with color c to the image.

func (*Image) Provider

func (i *Image) Provider(title string)

Provider sets the provider title.

func (*Image) Render

func (i *Image) Render(file string) (err error)

Render renders the image to file.

func (*Image) Reset

func (i *Image) Reset(width, height int)

Reset resets the image context.

func (*Image) Start

func (i *Image) Start(lat1, lon1, lat2, lon2 float64)

Start adds the start line to image.

type Option

type Option func(*Image)

Option is a option to a Image.

func Weight

func Weight(weight float64) Option

Weight sets the for the paths rendered. Default: 2.

type Render

type Render func(w io.Writer, img image.Image) error

Render is function which writes a image img to w.

Jump to

Keyboard shortcuts

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