1 Star 0 Fork 43

leastsoft / go验证码合集包

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
imagefiltermanager.go 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
shirdon 提交于 2019-07-07 16:26 . 优化提交
//++++++++++++++++++++++++++++++++++++++++
//Fighting for great,share generate value!
//Build the best soft by golang,let's go!
//++++++++++++++++++++++++++++++++++++++++
//Author:ShirDon <http://www.shirdon.com>
//Email:hcbsts@163.com; 823923263@qq.com
//++++++++++++++++++++++++++++++++++++++++
package captchas_with_go
//ImageFilterManager
type ImageFilterManager struct {
filters []ImageFilter
}
func init() {
RegisterImageFilter(IMAGE_FILTER_NOISE_LINE, imageFilterNoiseLineCreator)
RegisterImageFilter(IMAGE_FILTER_NOISE_POINT, imageFilterNoisePointCreator)
RegisterImageFilter(IMAGE_FILTER_STRIKE, imageFilterStrikeCreator)
}
func CreateImageFilterManager() *ImageFilterManager {
ret := new(ImageFilterManager)
ret.filters = []ImageFilter{}
return ret
}
func (manager *ImageFilterManager) AddFilter(filter ImageFilter) {
manager.filters = append(manager.filters, filter)
}
func (manager *ImageFilterManager) GetFilters() []ImageFilter {
return manager.filters
}
func CreateImageFilterManagerByConfig(config *FilterConfig) *ImageFilterManager {
mgr := new(ImageFilterManager)
mgr.filters = []ImageFilter{}
for _, cfgId := range config.Filters {
creator, has := imageFilterCreators[cfgId]
if !has {
continue
}
cfgGroup, has := config.GetGroup(cfgId)
if !has {
continue
}
mgr.AddFilter(creator(cfgGroup))
}
return mgr
}
Go
1
https://gitee.com/leastsoft/captchas_with_go.git
git@gitee.com:leastsoft/captchas_with_go.git
leastsoft
captchas_with_go
go验证码合集包
master

搜索帮助