Documentation ¶
Overview ¶
Package segment provides functions that draw a single segment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diagonal ¶
func Diagonal(bc *braille.Canvas, ar image.Rectangle, width int, dt DiagonalType, opts ...DiagonalOption) error
Diagonal draws a diagonal segment of the specified width filling the area.
Types ¶
type DiagonalOption ¶
type DiagonalOption interface {
// contains filtered or unexported methods
}
DiagonalOption is used to provide options.
func DiagonalCellOpts ¶
func DiagonalCellOpts(cOpts ...cell.Option) DiagonalOption
DiagonalCellOpts sets options on the cells that contain the diagonal segment. Cell options on a braille canvas can only be set on the entire cell, not per pixel.
type DiagonalType ¶
type DiagonalType int
DiagonalType determines the type of diagonal segment.
const ( // LeftToRight is a diagonal segment from top left to bottom right. LeftToRight DiagonalType // RightToLeft is a diagonal segment from top right to bottom left. RightToLeft )
func (DiagonalType) String ¶
func (dt DiagonalType) String() string
String implements fmt.Stringer()
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used to provide options.
func CellOpts ¶
CellOpts sets options on the cells that contain the segment. Cell options on a braille canvas can only be set on the entire cell, not per pixel.
func ReverseSlopes ¶
func ReverseSlopes() Option
ReverseSlopes if provided reverses the order in which slopes are drawn. This only has a visible effect when the horizontal segment has height of two or the vertical segment has width of two. Without this option segments with height / width of two look like this:
- | --- || |
With this option:
--- | - || |
func SkipSlopesLTE ¶
SkipSlopesLTE if provided instructs HV to not create slopes at the ends of a segment if the height of the horizontal or the width of the vertical segment is less or equal to the provided value.
Directories ¶
Path | Synopsis |
---|---|
Package testsegment provides helpers for tests that use the segment package.
|
Package testsegment provides helpers for tests that use the segment package. |