Documentation
¶
Overview ¶
Package bbox provides utilities for managing various types of bounding boxes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundingBox ¶
type BoundingBox struct {
// contains filtered or unexported fields
}
BoundingBox is a bounding box for a board, which provides a top-left and bottom-right.
func (*BoundingBox) BotRight ¶
func (b *BoundingBox) BotRight() *point.Point
BotRight point of the bounding box.
func (*BoundingBox) TopLeft ¶
func (b *BoundingBox) TopLeft() *point.Point
TopLeft point of the bounding box.
type CropBox ¶
type CropBox struct { BBox *BoundingBox OriginalSize int }
A CropBox is a bounding box that contains a strict subset of a board.
func CropBoxFromPreset ¶
func CropBoxFromPreset(p CroppingPreset, boardSize int) (*CropBox, error)
CropBoxFromPreset creates a cropping box from the original board size (typically 9, 13, 19). Note that the integer points in the crop box are 0 indexed, but originalSize is 1-indexed. In other words, we would typically expect the max ints to range from 9 to 19.
Following the SGF covention, we consider the topleft to be 0,0
type CroppingPreset ¶
type CroppingPreset int
CroppingPreset is a convenience enum for specifying a cropping direction.
const ( //TopLeft see below // X - // - - TopLeft CroppingPreset = iota //TopRight see below // - X // - - TopRight //BottomRight see below // - - // - X BottomRight //BottomLeft see below // - - // X - BottomLeft //Top see below // X X // - - Top //Left see below // X - // X - Left //Right see below // - X // - X Right //Bottom see below // - - // X X Bottom //All see below // X X // X X All )