1 Star 0 Fork 2

赵六 / vcodereader

forked from JesusSlim / vcodereader 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
line_info.go 655 Bytes
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
JesusSlim 提交于 2016-05-06 23:53 . V 1.0
package vcodereader
//干扰线
type LineInfo struct {
from *Xy
points []*Xy
}
func (l *LineInfo) GetRoot() *Xy {
return l.from
}
func (l *LineInfo) GetPoints() []*Xy {
return l.points
}
func (l *LineInfo) LenPoints() int {
return len(l.points)
}
func (l *LineInfo) PointExist(x, y int) bool {
for _, xy := range l.points {
if xy.x == x && xy.y == y {
return true
}
}
return false
}
func (l *LineInfo) Copy() *LineInfo {
copy := NewLineInfo(l.from)
for _, p := range l.points {
copy.points = append(copy.points, p)
}
return copy
}
func NewLineInfo(xy *Xy) *LineInfo {
return &LineInfo{
from: xy,
points: []*Xy{},
}
}
Go
1
https://gitee.com/zhaoLiuliu/vcodereader.git
git@gitee.com:zhaoLiuliu/vcodereader.git
zhaoLiuliu
vcodereader
vcodereader
master

搜索帮助