Documentation
¶
Overview ¶
Package mosaic provides a unicode image renderer. Copied from https://github.com/charmbracelet/x/tree/main/mosaic and adapted for Runal usage. RenderCells method has been added to retrieve blocks instead of rendering them directly.
Index ¶
- func Render(img image.Image, width int, height int) string
- type Cell
- type Mosaic
- func (m Mosaic) Dither(dither bool) Mosaic
- func (m Mosaic) Height(height int) Mosaic
- func (m Mosaic) IgnoreBlockSymbols(fgOnly bool) Mosaic
- func (m Mosaic) InvertColors(invertColors bool) Mosaic
- func (m *Mosaic) Render(img image.Image) string
- func (m *Mosaic) RenderCells(img image.Image) [][]Cell
- func (m Mosaic) Scale(scale int) Mosaic
- func (m Mosaic) Symbol(symbol Symbol) Mosaic
- func (m Mosaic) Threshold(threshold int) Mosaic
- func (m Mosaic) Width(width int) Mosaic
- type Symbol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mosaic ¶
type Mosaic struct {
// contains filtered or unexported fields
}
Mosaic represents a Unicode image renderer.
Example:
```go
art := mosaic.New().Width(100). // Limit to 100 cells
Scale(mosaic.Fit). // Fit to width
Render()
```
func (Mosaic) Height ¶
Height sets the maximum height the image can have. Defaults to the image height.
func (Mosaic) IgnoreBlockSymbols ¶
IgnoreBlockSymbols set UseFgBgOnly on Mosaic.
func (Mosaic) InvertColors ¶
InvertColors whether to invert the colors of the mosaic image.
func (*Mosaic) RenderCells ¶
RenderCells renders the image to [][]Cell.
Click to show internal directories.
Click to hide internal directories.