geo

package
v0.0.0-...-4ede3f3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-2-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Each

func Each(b Box, f func(Pos))

func Find

func Find(b Box, f func(Pos) bool) bool

Types

type Box

type Box struct {
	Pos
	Dim
}

func MakeBox

func MakeBox(x, y, w, h int) Box

func UnitBox

func UnitBox(p Pos) Box

func (Box) BoxDim

func (b Box) BoxDim() Dim

func (Box) BoxIdx

func (b Box) BoxIdx(p Pos) int

func (Box) Crop

func (b Box) Crop(o Box) Box

func (Box) End

func (b Box) End() Pos

func (Box) Grow

func (b Box) Grow(o Box) Box

func (Box) In

func (b Box) In(o Box) bool

type Dim

type Dim struct {
	W int `json:"w"`
	H int `json:"h"`
}

func (Dim) Empty

func (p Dim) Empty() bool

type Pos

type Pos struct {
	X int `json:"x"`
	Y int `json:"y"`
}

func (Pos) Add

func (p Pos) Add(x, y int) Pos

func (Pos) In

func (p Pos) In(b Box) bool

func (Pos) Max

func (p Pos) Max(o Pos) Pos

func (Pos) Min

func (p Pos) Min(o Pos) Pos

func (Pos) Sub

func (p Pos) Sub(x, y int) Pos

Jump to

Keyboard shortcuts

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