Ai
9 Star 110 Fork 23

子安/FireShotGo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
filters.go 930 Bytes
一键复制 编辑 原始数据 按行查看 历史
子安 提交于 2021-09-24 21:24 +08:00 . 添加截图应用fyne实现
package filters
import (
"image"
"image/color"
)
// Vec2 if a vector of 2 float64s, X and Y.
type Vec2 [2]float64
func (v Vec2) X() float64 { return v[0] }
func (v Vec2) Y() float64 { return v[1] }
type filterImage struct {
source image.Image
atFn func(x, y int, under color.Color) color.Color
}
// ColorModel returns the Image's color model.
func (f *filterImage) ColorModel() color.Model { return f.source.ColorModel() }
// Bounds returns the domain for which At can return non-zero color.
// The bounds do not necessarily contain the point (0, 0).
func (f *filterImage) Bounds() image.Rectangle { return f.source.Bounds() }
// At returns the color of the pixel at (x, y).
// At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid.
// At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.
func (f *filterImage) At(x, y int) color.Color {
return f.atFn(x, y, f.source.At(x, y))
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/andrewgithub/FireShotGo.git
git@gitee.com:andrewgithub/FireShotGo.git
andrewgithub
FireShotGo
FireShotGo
v1.0.12

搜索帮助