Versions in this module Expand all Collapse all v2 v2.0.2 Nov 22, 2024 Changes in this version + var EmptyBackgroundImageErr = errors.New("no background image") + var GenerateDataErr = errors.New("generate data failed") + var GraphImageErr = errors.New("graph image is incorrect") + var ImageTypeErr = errors.New("tile image must be is image.Image type") + var MaskImageTypeErr = errors.New("tile shadow image must be is image.Image type") + var ShadowImageTypeErr = errors.New("tile shadow image must be is image.Image type") v2.0.2-pre.1 Nov 22, 2024 v2.0.1 Aug 22, 2024 v2.0.1-beta.1 Aug 22, 2024 v2.0.0 Jun 22, 2024 Changes in this version + const Version + func CheckPoint(sx, sy, dx, dy, padding int64) bool + type Block struct + Angle int + Height int + TileX int + TileY int + Width int + X int + Y int + type Builder interface + Clear func() + Make func() Captcha + MakeWithRegion func() Captcha + SetOptions func(opts ...Option) + SetResources func(resources ...Resource) + func NewBuilder(opts ...Option) Builder + type CaptData struct + func (c CaptData) GetData() *Block + func (c CaptData) GetMasterImage() imagedata.JPEGImageData + func (c CaptData) GetTileImage() imagedata.PNGImageData + type Captcha interface + Generate func() (CaptchaData, error) + GetOptions func() *Options + type CaptchaData interface + GetData func() *Block + GetMasterImage func() imagedata.JPEGImageData + GetTileImage func() imagedata.PNGImageData + type DeadZoneDirectionType int + const DeadZoneDirectionTypeBottom + const DeadZoneDirectionTypeLeft + const DeadZoneDirectionTypeRight + const DeadZoneDirectionTypeTop + type DrawBlock struct + Angle int + Block *Block + Height int + Image image.Image + Width int + X int + Y int + type DrawImage interface + DrawWithNRGBA func(params *DrawImageParams) (img image.Image, bgImg image.Image, err error) + DrawWithTemplate func(params *DrawTplImageParams) (image.Image, error) + func NewDrawImage() DrawImage + type DrawImageParams struct + Alpha float32 + Background image.Image + CaptchaDrawBlocks []*DrawBlock + Height int + Width int + type DrawTplImageParams struct + Alpha float32 + Background image.Image + CaptchaDrawBlock *DrawBlock + Height int + MaskImage image.Image + Width int + X int + Y int + type GraphImage struct + MaskImage image.Image + OverlayImage image.Image + ShadowImage image.Image + type Mode int + const ModeBasic + const ModeRegion + type Option func(*Options) + func WithEnableGraphVerticalRandom(val bool) Option + func WithGenGraphNumber(val int) Option + func WithImageAlpha(val float32) Option + func WithImageSize(val option.Size) Option + func WithRangeDeadZoneDirections(val []DeadZoneDirectionType) Option + func WithRangeGraphAnglePos(vals []option.RangeVal) Option + func WithRangeGraphSize(val option.RangeVal) Option + type Options struct + func NewOptions() *Options + func (o *Options) GetImageAlpha() float32 + func (o *Options) GetImageSize() *option.Size + func (o *Options) GetRangeDeadZoneDirections() []DeadZoneDirectionType + func (o *Options) GetRangeGraphAnglePos() []*option.RangeVal + func (o *Options) GetRangeGraphSize() *option.RangeVal + type Resource func(*Resources) + func WithBackgrounds(images []image.Image) Resource + func WithGraphImages(images []*GraphImage) Resource + type Resources struct + func NewResources() *Resources v2.0.0-beta.2 Jun 7, 2024 v2.0.0-beta.1 Jun 1, 2024