Documentation ¶
Index ¶
- Constants
- type Captcha
- type Options
- func (opts *Options) CreateImage() (*Captcha, error)
- func (opts *Options) SetBackgroundColor(backgroundColor color.Color)
- func (opts *Options) SetBorderColor(borderColor color.Color)
- func (opts *Options) SetCaptchaTextLength(length int) error
- func (opts *Options) SetCharacterList(chars string) error
- func (opts *Options) SetDimensions(width, height int) error
- func (opts *Options) SetFontDPI(dpi float64) error
- func (opts *Options) SetFontScale(scale float64) error
- func (opts *Options) SetFontsFromData(fontsData ...[]byte) error
- func (opts *Options) SetFontsFromPath(paths ...string) error
- func (opts *Options) SetNoiseDensity(dot, rect, text float64)
Constants ¶
const DefaultCharsList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
DefaultCharsList defines default list of chars for a captcha image.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options manage captcha generation details.
func NewOptions ¶
NewOptions creates new CAPTCHA options object with default values.
func (*Options) CreateImage ¶
CreateImage creates new captcha image with specified text.
func (*Options) SetBackgroundColor ¶
SetBackgroundColor sets captcha image's background color.
func (*Options) SetBorderColor ¶
SetBorderColor sets captcha image's border color.
func (*Options) SetCaptchaTextLength ¶
SetCaptchaTextLength sets amount of characters, text lentgh, for a captcha image.
func (*Options) SetCharacterList ¶
SetCharacterList sets available characters for a captcha image.
func (*Options) SetDimensions ¶
SetDimensions sets captcha image widtg and height.
func (*Options) SetFontDPI ¶
SetFontDPI sets DPI (dots per inch) for a font.
func (*Options) SetFontScale ¶
SetFontScale sets scale of a font.
func (*Options) SetFontsFromData ¶
SetFontsFromData sets font from bytes slice.
func (*Options) SetFontsFromPath ¶
SetFontsFromPath sets font from font file.
func (*Options) SetNoiseDensity ¶
SetNoiseDensity sets density between noise elements.