Documentation ¶
Index ¶
- Constants
- Variables
- func ColorInHex(hex string) color.Color
- func DisableCircle()
- func DisableRotate()
- func DisableRuler()
- func New(cfg *Config)
- func RandomString() []byte
- func SetBg(c color.Color)
- func SetFontDeviation(d int)
- func SetNoiseThreshold(p float64)
- func SetRotateDegree(d float64)
- func SetRotateDivideMat(dx, dy int)
- func SetRulerDeviation(d int)
- type CaptchaEncoder
- type Config
- type Encoder
Constants ¶
View Source
const ( DefaultSize float64 = 48 DefaultDPI float64 = 72 RegularFont = string(iota) MonoFont BoldFont MediumFont ItalicFont )
Variables ¶
View Source
var ( RulerColor = ColorInHex("0x456D7C") GridColor = ColorInHex("0xB9B6B6") CircleColor = ColorInHex("#728C7F") )
Functions ¶
func ColorInHex ¶
ColorInHex is a warpper helper to get color by Hex. Support Hex color format like "0xF8AA5D" or "#728C7F"
func DisableRotate ¶
func DisableRotate()
func SetFontDeviation ¶
func SetFontDeviation(d int)
func SetNoiseThreshold ¶
func SetNoiseThreshold(p float64)
func SetRotateDegree ¶
func SetRotateDegree(d float64)
SetRotateDegree restricts sub image rotate in range [-d, d], d should not greater than 8
func SetRotateDivideMat ¶
func SetRotateDivideMat(dx, dy int)
SetRotateDivideMat set the image divide matrix [y, x], default div matrix x=0, y=0 is [2, 4]
func SetRulerDeviation ¶
func SetRulerDeviation(d int)
Types ¶
type CaptchaEncoder ¶
type CaptchaEncoder struct {
// contains filtered or unexported fields
}
CaptchaEncoder encode image.Image into common pic format
Click to show internal directories.
Click to hide internal directories.