Documentation
¶
Index ¶
- type Builder
- func (b *Builder) Build() *Generator
- func (b *Builder) WithAlphaThreshold(threshold int) *Builder
- func (b *Builder) WithAlphaValue(value byte) *Builder
- func (b *Builder) WithCharSet(charset CharSet) *Builder
- func (b *Builder) WithGammaCorrection(correction float32) *Builder
- func (b *Builder) WithInput() *InputBuilder
- type CharSet
- type Generator
- type InputBuilder
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶ added in v0.2.0
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶ added in v0.2.0
func NewBuilder() *Builder
NewBuilder will create a builder style construct, which provides you with a default Generator. The builder 'object' provides convenience functions for specifying generator properties, e.g. what character set to use for the ascii generation, and what input image to use.
func (*Builder) WithAlphaThreshold ¶ added in v0.2.2
func (*Builder) WithAlphaValue ¶ added in v0.2.2
func (*Builder) WithCharSet ¶ added in v0.2.0
func (*Builder) WithGammaCorrection ¶ added in v0.2.2
func (*Builder) WithInput ¶ added in v0.2.0
func (b *Builder) WithInput() *InputBuilder
type Generator ¶ added in v0.2.1
type Generator struct {
// contains filtered or unexported fields
}
Generator provides parameters for generating ascii output. The alphaThreshold specifies what threshold should be used to return a replacement alphaValue. Charset specifies what characters to be used for the ascii conversion. These should be ordered from 'darker' to 'lighter' values - ex. [' ', '.', '*', '@'], for a 'natural' look, but you can experiment with this range, for various artistic expressions!! The more characters used, the more nuances the ascii image will gain. img holds the image to be used an input for the ascii generation.
type InputBuilder ¶ added in v0.2.0
type InputBuilder struct {
Builder
}
func (*InputBuilder) Image ¶ added in v0.2.0
func (b *InputBuilder) Image(image image.Image) *InputBuilder