Documentation ¶
Index ¶
- Variables
- type Canvas
- func (c *Canvas) AddForbiddenCharacter(char rune)
- func (c *Canvas) AddWeights(weights map[rune]float64)
- func (c *Canvas) ClearForbiddenCharacters()
- func (c *Canvas) GetAspectRatio() float64
- func (c *Canvas) GetForbiddenCharacters() []rune
- func (c *Canvas) GetGlyphDimensions() (width, height int)
- func (c *Canvas) GetImage() image.Image
- func (c *Canvas) GetProgress() float32
- func (c *Canvas) GetResult() string
- func (c *Canvas) GetResultBash() string
- func (c *Canvas) GetResultC() string
- func (c *Canvas) GetResultRGBABytes() []byte
- func (c *Canvas) GetResultRGBADimensions() (width, height int)
- func (c *Canvas) GetRuneLimits() (int, int)
- func (c *Canvas) IsForbiddenCharacter(char rune) bool
- func (c *Canvas) LoadFont(path string) error
- func (c *Canvas) LoadImage(path string) error
- func (c *Canvas) Paint()
- func (c *Canvas) RemoveForbiddenCharacter(char rune)
- func (c *Canvas) SetAspectRatio(ratio float64)
- func (c *Canvas) SetFont(data []byte) error
- func (c *Canvas) SetGlyphDimensions(width, height int)
- func (c *Canvas) SetHeight(height int)
- func (c *Canvas) SetImage(img image.Image)
- func (c *Canvas) SetRuneLimits(start, end int)
- func (c *Canvas) SetThreads(threads int)
- func (c *Canvas) SetWeights(weights map[rune]float64)
- func (c *Canvas) SetWidth(width int)
- func (c *Canvas) StartPainting()
- type Font
- type Glyph
- type Pixel
- type Task
- type TaskResult
- type Vec4
Constants ¶
This section is empty.
Variables ¶
var EmbeddedFonts embed.FS
var FiraMonoRegular = "assets/FiraMono-Regular.ttf"
Functions ¶
This section is empty.
Types ¶
type Canvas ¶
type Canvas struct { // Input and Rendering Configuration Font Font // Font used for rendering Image image.Image // Input image to be processed Width int // Output width in characters Height int // Output height in characters AspectRatio float64 // Aspect ratio for output GlyphWidth int // Width of each glyph GlyphHeight int // Height of each glyph RuneStart int // Starting Unicode code point for character selection RuneLimit int // Ending Unicode code point for character selection Threads int // Number of threads for parallel processing ForbiddenCharacters map[rune]struct{} // Characters to exclude from rendering Weights map[rune]float64 // Custom weights for character selection // Output Results Result string // Raw output string ResultC string // C-style string output ResultBash string // Bash command string output ResultRGBABytes []byte // RGBA byte slice of the rendered image ResultRGBAWidth int // Width of the RGBA output ResultRGBAHeight int // Height of the RGBA output // Internal State Progress float32 // Current progress of rendering (0.0 to 1.0) // contains filtered or unexported fields }
func (*Canvas) AddForbiddenCharacter ¶
AddForbiddenCharacter adds a character to the list of forbidden characters.
func (*Canvas) AddWeights ¶
AddWeights adds the provided weights to the existing weight map. If a character already has a weight, it will be updated with the new value.
func (*Canvas) ClearForbiddenCharacters ¶
func (c *Canvas) ClearForbiddenCharacters()
ClearForbiddenCharacters removes all characters from the list of forbidden characters.
func (*Canvas) GetAspectRatio ¶
GetAspectRatio returns the current aspect ratio.
func (*Canvas) GetForbiddenCharacters ¶
GetForbiddenCharacters returns a slice of all forbidden characters.
func (*Canvas) GetGlyphDimensions ¶
GetGlyphDimensions returns the current width and height of glyphs.
func (*Canvas) GetProgress ¶
GetProgress returns the current progress of the painting process.
func (*Canvas) GetResultBash ¶
GetResultBash returns the result as a Bash command string.
func (*Canvas) GetResultC ¶
GetResultC returns the result as a C-style string.
func (*Canvas) GetResultRGBABytes ¶
GetResultRGBABytes returns the result as RGBA bytes.
func (*Canvas) GetResultRGBADimensions ¶
GetResultRGBADimensions returns the width and height of the RGBA result.
func (*Canvas) GetRuneLimits ¶
GetRuneLimits returns the current start and end rune limits.
func (*Canvas) IsForbiddenCharacter ¶
IsForbiddenCharacter checks if a character is in the list of forbidden characters.
func (*Canvas) RemoveForbiddenCharacter ¶
RemoveForbiddenCharacter removes a character from the list of forbidden characters.
func (*Canvas) SetAspectRatio ¶
SetAspectRatio sets the aspect ratio for the output.
func (*Canvas) SetGlyphDimensions ¶
SetGlyphDimensions sets the width and height of glyphs.
func (*Canvas) SetRuneLimits ¶
SetRuneLimits sets the start and end rune limits for character selection.
func (*Canvas) SetThreads ¶
SetThreads sets the number of threads to use for rendering.
func (*Canvas) SetWeights ¶
SetWeights sets the weights for characters used in rendering.
func (*Canvas) StartPainting ¶
func (c *Canvas) StartPainting()
StartPainting begins the asynchronous painting process.