Help us shape the future of Go! Take the 2026 Go Developer Survey

boundingbox

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cuts

func Cuts(rect image.Rectangle, n int) []int

Cuts returns an array of evenly spaced right positions for n positions within the given rectangle. N must be larger than 0.

func FromPoints

func FromPoints(points []image.Point) image.Rectangle

FromPoints converts the given points array to a rectangle.

func ToPoints

func ToPoints(rect image.Rectangle) []image.Point

ToPoints converts a rectangle to an array of two points, consisting of the top left point (rectangle.Min) and the bottom right point (rectangle.Max).

Types

type Split

type Split struct {
	Str string
	Cut int
}

Split represents (trimmed) words with their accoring right position in a rectangle.

func SplitTokens

func SplitTokens(rect image.Rectangle, str string) []Split

SplitTokens splits a given rectangle into an list of tokens and their approixmate right cuts. Whitespace between tokens is distributed between the tokens.

Jump to

Keyboard shortcuts

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