// Corners returns the box as a set of corners.
960526
func (b Box) Corners() BoxCorners {
	return BoxCorners{
		TopLeft:     Point{b.Left, b.Top},
		TopRight:    Point{b.Right, b.Top},
		BottomRight: Point{b.Right, b.Bottom},
		BottomLeft:  Point{b.Left, b.Bottom},
	}
}
18275
func (box *Box) Join(other *Box) {
	box.Min = Min(&box.Min, &other.Min)
	box.Max = Max(&box.Max, &other.Max)
}
336750
func (t *FpdfTpl) Size() (corner PointType, size SizeType) {
	return t.corner, t.size
}
1023321
func BoundingBoxContains(lon, lat, minLon, minLat, maxLon, maxLat float64) bool {
	return compareGeo(lon, minLon) >= 0 && compareGeo(lon, maxLon) <= 0 &&
		compareGeo(lat, minLat) >= 0 && compareGeo(lat, maxLat) <= 0
}
604205
func (d Display) Bounds() Rectangle {
	return Rectangle{
		Position: Position{X: *d.o.Bounds.X, Y: *d.o.Bounds.Y},
		Size:     Size{Height: *d.o.Bounds.Height, Width: *d.o.Bounds.Width},
	}
}
641852
func (l *Line) Side(p *Point) int {
	val := (l.b[0]-l.a[0])*(p[1]-l.b[1]) - (l.b[1]-l.a[1])*(p[0]-l.b[0])

	if val < 0 {
		return 1 // right
	} else if val > 0 {
		return -1 // left
	}

	return 0 // collinear
}
191034
func (s *StyledBox) Draw(p *tui.Painter) {
	p.WithStyle(s.Style, func(p *tui.Painter) {
		s.Box.Draw(p)
	})
}
961705
func Box(src image.Image, radius float64) *image.RGBA {
	if radius <= 0 {
		return clone.AsRGBA(src)
	}

	length := int(math.Ceil(2*radius + 1))
	k := convolution.NewKernel(length, length)

	for x := 0; x < length; x++ {
		for y := 0; y < length; y++ {
			k.Matrix[y*length+x] = 1
		}
	}

	return convolution.Convolve(src, k.Normalized(), &convolution.Options{Bias: 0, Wrap: false, KeepAlpha: false})
}
246376
func (b *BoxLayout) Resize() {
	b.layout()

	// Now also let the children know we resized.
	for i := range b.cells {
		b.cells[i].widget.Resize()
	}
	b.PostEventWidgetResize(b)
}
1194454
func (box *Box) Intersects(other *Box) bool {
	d1 := box.Diagonal()
	d2 := other.Diagonal()
	sizes := Add(&d1, &d2)
	c1 := box.Center()
	c2 := other.Center()
	distCenters2 := Sub(&c1, &c2)
	distCenters2.Scale(2)
	distCenters2.Abs()
	return distCenters2[0] <= sizes[0] && distCenters2[1] <= sizes[1] && distCenters2[2] <= sizes[2]
}
613513
func geoBoundingBox(hash string) geoBox {
	bits := uint(5 * len(hash))
	inthash := base32encoding.decode(hash)
	return geoBoundingBoxIntWithPrecision(inthash, bits)
}
1060497
func (gp *GoPdf) Margins() (float64, float64, float64, float64) {
	return gp.PointsToUnits(gp.margins.Left),
		gp.PointsToUnits(gp.margins.Top),
		gp.PointsToUnits(gp.margins.Right),
		gp.PointsToUnits(gp.margins.Bottom)
}
813296
func (b *Box) Place(container *Box) {
	b.frame.X = container.inner.X
	b.frame.Y = container.inner.Y
}
794997
func (g *geom0) Bounds() *Bounds {
	return NewBounds(g.layout).extendFlatCoords(g.flatCoords, 0, len(g.flatCoords), g.stride)
}
630931
func (p *Polyline) Edge(i int) Edge {
	return Edge{(*p)[i], (*p)[i+1]}
}
231171
func RoundedBoxColor(renderer *sdl.Renderer, x1, y1, x2, y2, rad int32, color sdl.Color) bool {
	_x1 := C.Sint16(x1)
	_y1 := C.Sint16(y1)
	_x2 := C.Sint16(x2)
	_y2 := C.Sint16(y2)
	_rad := C.Sint16(rad)
	_color := C.Uint32(gfxColor(color))
	return C.roundedBoxColor((*C.SDL_Renderer)(unsafe.Pointer(renderer)), _x1, _y1, _x2, _y2, _rad, _color) == 0
}
1273205
func (c Collision) Bounds() coord.Bounds {
	return coord.JoinBounds(c.A.Bounds(), c.B.Bounds())
}