代码拉取完成,页面将自动刷新
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))
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。