osdata

package
v0.0.0-...-88a5242 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistanceToPixels

func DistanceToPixels(t ImageTile, d osgrid.Distance) int

Convenience function for a common operation. Will only give correct results if d is a multiple of t.Precision()!

Types

type Cache

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

func NewCache

func NewCache(nslots int) *Cache

func (*Cache) Allocate

func (c *Cache) Allocate(tile Tile)

func (*Cache) DumpStats

func (c *Cache) DumpStats() string

func (*Cache) Read

func (c *Cache) Read(ref osgrid.GridRef) (Tile, bool)

type Database

type Database interface {
	GetTile(osgrid.GridRef) (Tile, error)
	Precision() osgrid.Distance
}

type Float64Database

type Float64Database interface {
	Database
	GetFloat64(osgrid.GridRef) (float64, error)
	GetFloat64Tile(osgrid.GridRef) (Float64Tile, error)
}

type Float64Tile

type Float64Tile interface {
	Tile
	GetFloat64(osgrid.GridRef) (float64, error)
}

type ImageDatabase

type ImageDatabase interface {
	Database
	GetImageTile(osgrid.GridRef) (ImageTile, error)
}

type ImageTile

type ImageTile interface {
	Tile
	GetImage() image.Image
	// Number of pixels per Precision()
	PixelPrecision() int
	GetPixelCoord(ref osgrid.GridRef) (int, int, error)
}

type Tile

type Tile interface {
	Width() osgrid.Distance
	Height() osgrid.Distance
	Precision() osgrid.Distance

	BottomLeft() osgrid.GridRef
	String() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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