Documentation ¶
Index ¶
- Variables
- func New() (string, string, error)
- type Bilinear
- type BilinearSrc
- type Captcha
- func (c *Captcha) AddFont(path string) error
- func (c *Captcha) AddFontFromBytes(contents []byte) error
- func (c *Captcha) Create(num int, t StrType) (*Image, string, error)
- func (c *Captcha) CreateCustom(str string) (*Image, error)
- func (c *Captcha) SetBkgColor(colors ...color.Color)
- func (c *Captcha) SetDisturbance(d DisturbLevel)
- func (c *Captcha) SetFont(paths ...string) error
- func (c *Captcha) SetFrontColor(colors ...color.Color)
- func (c *Captcha) SetSize(w, h int)
- type DisturbLevel
- type Image
- func (img *Image) DrawCircle(xc, yc, r int, fill bool, c color.Color)
- func (img *Image) DrawLine(x1, y1, x2, y2 int, c color.Color)
- func (img *Image) DrawString(font *truetype.Font, c color.Color, str string, fontsize float64) error
- func (img *Image) FillBkg(c image.Image)
- func (img *Image) Rotate(angle float64) image.Image
- type StrType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
VERSION = "v1.0.1"
)
Functions ¶
Types ¶
type BilinearSrc ¶
type BilinearSrc struct {
// contains filtered or unexported fields
}
type Captcha ¶
type Captcha struct {
// contains filtered or unexported fields
}
func (*Captcha) AddFontFromBytes ¶
AddFontFromBytes allows to load font from slice of bytes, for example, load the font packed by https://github.com/jteeuwen/go-bindata
func (*Captcha) SetBkgColor ¶
func (*Captcha) SetDisturbance ¶
func (c *Captcha) SetDisturbance(d DisturbLevel)
func (*Captcha) SetFrontColor ¶
type DisturbLevel ¶
type DisturbLevel int
const ( NORMAL DisturbLevel = 4 MEDIUM DisturbLevel = 8 HIGH DisturbLevel = 16 )
type Image ¶
Image 图片
func (*Image) DrawCircle ¶
DrawCircle 画圆 xc,yc 圆心坐标 r 半径 fill是否填充颜色
func (*Image) DrawLine ¶
DrawLine 画直线 Bresenham算法(https://zh.wikipedia.org/zh-cn/布雷森漢姆直線演算法) x1,y1 起点 x2,y2终点
Click to show internal directories.
Click to hide internal directories.