Пример #1
0
func (t *LazyImage) At(x, y int) image.Color {
	t.lastPos += 1
	//pos:=x+y*t.TheBounds.Dx()
	if x == y && x%100 == 0 {
		print(t.lastPos)
		print(" _ ")
		print(x)
		print(", ")
		print(y, "\n")
		//t.lastPos=pos
	}
	c := new(image.NRGBAColor)
	c.R = uint8((y/1 + x/2) % 256)
	c.A = 255
	return c
}
Пример #2
0
func MakeColorizer(ft *floatTable.FloatTable) func(cell []float32) image.NRGBAColor {
	maxv := float64(0.0)
	for _, t := range ft.Data {
		maxv = math.Fmax(maxv, float64(t))
	}

	println(maxv)
	maxv = math.Log2(maxv / fill)
	return func(cell []float32) image.NRGBAColor {
		c := new(image.NRGBAColor)
		c.R = col(float64(cell[0]), maxv)
		c.G = col(float64(cell[1]), maxv)
		c.B = col(float64(cell[2]), maxv)
		c.A = 255
		return *c
	}
}