screenutils

package
v0.0.0-...-880055c Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildColorGradient

func BuildColorGradient(startColor, endColor screen.Color, steps int) []screen.Color

func BuildColorGradientMatrix

func BuildColorGradientMatrix(topLeft, topRight, bottomLeft, bottomRight screen.Color, vertSteps, horizSteps int) [][]screen.Color

func ColorToColorful

func ColorToColorful(color screen.Color) colorful.Color

func DrawColorFrame

func DrawColorFrame(o screen.ColorSetter, row, col, height, width int, color screen.Color)

func DrawColorGradientFrame

func DrawColorGradientFrame(colorsetter screen.ColorSetter, row, col, height, width int, topLeft, topRight, bottomLeft, bottomRight screen.Color)

func DrawColorGradientsMatrix

func DrawColorGradientsMatrix(colorcanvas screen.ColorSetter, row, col, height, width int, topLeft, topRight, bottomLeft, bottomRight screen.Color)

func DrawColorPattern

func DrawColorPattern(row, col int, colorPattern string, colorsetter screen.ColorSetter, decodeColor func(string) screen.Color)

func DrawFrame

func DrawFrame(o screen.RuneSetter, row, col, height, width int, patternIndex int)

func DrawHorizontalLine

func DrawHorizontalLine(runes screen.RuneSetter, foreground screen.ColorSetter, background screen.ColorSetter, row, col, width int, ru rune, fcolor screen.Color, bcolor screen.Color)

func DrawRawString

func DrawRawString(s string, row, col int, runesetter screen.RuneSetter) int

func DrawRuneFrame

func DrawRuneFrame(o screen.RuneSetter, row, col, height, width int, ru rune)

func DrawShadow

func DrawShadow(screenbuffer *screen.Buffer, stencil *screen.Stencil, position screen.Coordinates, rowOffset, colOffset int, shadowDensity uint8)

DrawShadow paint a shadow directly to the screenBuffer

func DrawStyledString

func DrawStyledString(row, col int, text string, canvas ICanvas, defaultStyle screen.Style, decodeColor func(string) screen.Color) int

func FillRectangle

func FillRectangle(runes screen.RuneSetter, foreground screen.ColorSetter, background screen.ColorSetter, row, col, height, width int, ru rune, fcolor screen.Color, bcolor screen.Color)

func GetStyledStringLen

func GetStyledStringLen(text string) int

Types

type BoxPattern

type BoxPattern struct {
	TopLeftCorner     rune
	TopBorder         rune
	TopRightCorner    rune
	LeftBorder        rune
	RightBorder       rune
	BottomLeftCorner  rune
	BottomBorder      rune
	BottomRightCorner rune
}

type ChromaticFilter

type ChromaticFilter struct {
	*screen.Size
	*screen.FColorCanvas
	*screen.BColorCanvas
	*screen.Stencil
}

ChromaticFilter

func NewChromaticFilter

func NewChromaticFilter(stencil *screen.Stencil, color screen.Color) *ChromaticFilter

func (*ChromaticFilter) Clear

func (o *ChromaticFilter) Clear()

func (*ChromaticFilter) Height

func (o *ChromaticFilter) Height() int

func (*ChromaticFilter) Render

func (o *ChromaticFilter) Render(b *screen.Buffer, stencil *screen.Stencil, position screen.Coordinates, offset screen.Coordinates)

func (*ChromaticFilter) Resize

func (o *ChromaticFilter) Resize(height int, width int)

func (*ChromaticFilter) SetHeight

func (o *ChromaticFilter) SetHeight(height int)

func (*ChromaticFilter) SetWidth

func (o *ChromaticFilter) SetWidth(width int)

func (*ChromaticFilter) Width

func (o *ChromaticFilter) Width() int

type ComboCanvas

ComboCanvas is a Combined Canvas Type 1.

func NewComboCanvas

func NewComboCanvas(height int, width int) *ComboCanvas

func (*ComboCanvas) Clear

func (o *ComboCanvas) Clear()

func (*ComboCanvas) GetBColorCanvas

func (o *ComboCanvas) GetBColorCanvas() *screen.BColorCanvas

func (*ComboCanvas) GetEmphasisCanvas

func (o *ComboCanvas) GetEmphasisCanvas() *screen.EmphasisCanvas

func (*ComboCanvas) GetFColorCanvas

func (o *ComboCanvas) GetFColorCanvas() *screen.FColorCanvas

func (*ComboCanvas) GetOrigins

func (o *ComboCanvas) GetOrigins() screen.Coordinates

func (*ComboCanvas) GetRuneCanvas

func (o *ComboCanvas) GetRuneCanvas() *screen.RuneCanvas
func (o *ComboCanvas) GetCanvas() (*screen.RuneCanvas, *screen.FColorCanvas, *screen.BColorCanvas, *screen.EmphasisCanvas) {
	return o.RuneCanvas, o.FColorCanvas, o.BColorCanvas, o.EmphasisCanvas
}

func (*ComboCanvas) GetStencil

func (o *ComboCanvas) GetStencil() *screen.Stencil

func (*ComboCanvas) Height

func (o *ComboCanvas) Height() int

func (*ComboCanvas) Render

func (o *ComboCanvas) Render(b *screen.Buffer, stencil *screen.Stencil, position screen.Coordinates, offset screen.Coordinates)

func (*ComboCanvas) Resize

func (o *ComboCanvas) Resize(height int, width int)

func (*ComboCanvas) SetDefaults

func (o *ComboCanvas) SetDefaults(r rune, style screen.Style)

func (*ComboCanvas) SetHeight

func (o *ComboCanvas) SetHeight(height int)

func (*ComboCanvas) SetWidth

func (o *ComboCanvas) SetWidth(width int)

func (*ComboCanvas) String

func (o *ComboCanvas) String() string

func (*ComboCanvas) Width

func (o *ComboCanvas) Width() int

type ConsoleImage

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

TODO Add error management, w,h=0 (input or calculated), Image=nil, ...

func NewConsoleImage

func NewConsoleImage(img image.Image, height, width int) *ConsoleImage

func (*ConsoleImage) Draw

func (o *ConsoleImage) Draw(runes screen.RuneSetter, foreground screen.ColorSetter, background screen.ColorSetter, row, col int)

func (*ConsoleImage) DrawOnCells

func (o *ConsoleImage) DrawOnCells(colorground screen.ColorSetter, row, col int)

func (*ConsoleImage) DrawOnCellsWithAlpha

func (o *ConsoleImage) DrawOnCellsWithAlpha(colorground screen.ColorSetter, row, col int, alpha uint8)

func (*ConsoleImage) DrawWithAlpha

func (o *ConsoleImage) DrawWithAlpha(runes screen.RuneSetter, foreground screen.ColorSetter, background screen.ColorSetter, row, col int, alpha uint8)

func (*ConsoleImage) Resize

func (o *ConsoleImage) Resize(wantedHeight, wantedWidth int) (int, int)

type ICanvas

type ICanvas interface {
	SetDefaults(rune, screen.Style)
	Clear()
	GetRuneCanvas() *screen.RuneCanvas
	GetFColorCanvas() *screen.FColorCanvas
	GetBColorCanvas() *screen.BColorCanvas
	GetEmphasisCanvas() *screen.EmphasisCanvas
	GetStencil() *screen.Stencil
	GetOrigins() screen.Coordinates
}

Jump to

Keyboard shortcuts

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