grids

package
v0.0.0-...-02623f6 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Grid

func Grid(spec GridSpec, width, height, padding int) *image.NRGBA

Types

type Fit

type Fit int
const (
	Approximate Fit = iota
	Exact
	AtLeast
	AtMost
	LargerThan
	SmallerThan
)

func (Fit) String

func (f Fit) String() string

type GridSpec

type GridSpec interface {
	Colour() color.NRGBA
	Overlay() bool
	Border(bounds image.Rectangle, padding int) *image.Rectangle
	VLines(bounds image.Rectangle, padding int) []int
	HLines(bounds image.Rectangle, padding int) []int
}

func NewNoGrid

func NewNoGrid() GridSpec

type NoGrid

type NoGrid struct {
}

func (NoGrid) Border

func (g NoGrid) Border(bounds image.Rectangle, padding int) *image.Rectangle

func (NoGrid) Colour

func (g NoGrid) Colour() color.NRGBA

func (NoGrid) HLines

func (g NoGrid) HLines(bounds image.Rectangle, padding int) []int

func (NoGrid) Overlay

func (g NoGrid) Overlay() bool

func (NoGrid) VLines

func (g NoGrid) VLines(bounds image.Rectangle, padding int) []int

type RectangularGrid

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

func NewRectangularGrid

func NewRectangularGrid(colour color.NRGBA, width, height uint, fit Fit, overlay bool) RectangularGrid

func (RectangularGrid) Border

func (g RectangularGrid) Border(bounds image.Rectangle, padding int) *image.Rectangle

func (RectangularGrid) Colour

func (g RectangularGrid) Colour() color.NRGBA

func (RectangularGrid) HLines

func (g RectangularGrid) HLines(bounds image.Rectangle, padding int) []int

func (RectangularGrid) Overlay

func (g RectangularGrid) Overlay() bool

func (RectangularGrid) VLines

func (g RectangularGrid) VLines(bounds image.Rectangle, padding int) []int

type SquareGrid

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

func NewSquareGrid

func NewSquareGrid(colour color.NRGBA, size uint, fit Fit, overlay bool) SquareGrid

func (SquareGrid) Border

func (g SquareGrid) Border(bounds image.Rectangle, padding int) *image.Rectangle

func (SquareGrid) Colour

func (g SquareGrid) Colour() color.NRGBA

func (SquareGrid) HLines

func (g SquareGrid) HLines(bounds image.Rectangle, padding int) []int

func (SquareGrid) Overlay

func (g SquareGrid) Overlay() bool

func (SquareGrid) VLines

func (g SquareGrid) VLines(bounds image.Rectangle, padding int) []int

Jump to

Keyboard shortcuts

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