Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AsciiResult ¶
func ConvertImage ¶
func ConvertImage(img image.Image, cfg ConvertConfig) (*AsciiResult, error)
func (*AsciiResult) ToANSI ¶
func (r *AsciiResult) ToANSI() string
func (*AsciiResult) ToHTML ¶
func (r *AsciiResult) ToHTML() string
func (*AsciiResult) ToMarkdown ¶
func (r *AsciiResult) ToMarkdown() string
func (*AsciiResult) ToMarkdownColored ¶
func (r *AsciiResult) ToMarkdownColored() string
func (*AsciiResult) ToPlainText ¶
func (r *AsciiResult) ToPlainText() string
type ConvertConfig ¶
type ConvertConfig struct {
// Scale factor for output (0.01–1.0)
Resolution float64
// Contrast adjustment (0.1–3.0)
Contrast float64
// Brightness adjustment (0.1–3.0)
Brightness float64
// Invert the character mapping
Inverted bool
// Use colored output
Colored bool
// Dithering algorithm to use
Dithering DitheringStrategy
// Character set to use
Charset CharSet
// Custom charter ramp (if Charset is Custom)
CustomRamp string
}
ConvertConfig mirrors your Rust struct
func DefaultConfig ¶
func DefaultConfig() ConvertConfig
func (ConvertConfig) Validate ¶
func (c ConvertConfig) Validate() error
type DitheringStrategy ¶
type DitheringStrategy int
const ( DitheringNone DitheringStrategy = iota DitheringFloydSteinberg DitheringAtkinson DitheringRiemersma DitheringOrdered2x2 DitheringOrdered4x4 DitheringThreshold )
func (DitheringStrategy) Apply ¶
func (d DitheringStrategy) Apply(gray []float64, width, height, levels int)
Click to show internal directories.
Click to hide internal directories.