Example #1
0
File: 60.go Project: rei-m/go-tour
func main() {
	m := Image{}
	m.h = 50
	m.w = 100
	m.rgba = color.RGBA{1, 155, 255, 55}
	pic.ShowImage(m)
}
Example #2
0
func main() {
	m := Image{
		128,
		128,
		func(x, y int) (val uint8) { return uint8(4 * (x + y)) },
		func(x, y int) (val uint8) { return uint8(x) },
		func(x, y int) (val uint8) { return uint8(y) },
	}
	pic.ShowImage(m)
}
Example #3
0
func main() {
	m := Image{w: 1024, h: 1024, model: color.RGBAModel}
	m.px = make([][]uint8, m.w)
	for y := 0; y < m.w; y++ {
		m.px[y] = make([]uint8, m.h)
		for x := 0; x < m.h; x++ {
			m.px[y][x] = uint8(x + y)
		}
	}
	pic.ShowImage(&m)
}
Example #4
0
func main() {
	rand.Seed(time.Now().Unix())

	x, y := 100, 100
	img := make([][]Pixel, x)
	for i := 0; i < x; i++ {
		img[i] = make([]Pixel, y)
		for j := 0; j < y; j++ {
			img[i][j] = Pixel{uint8(rand.Intn(255)),
				uint8(rand.Intn(255)),
				uint8(rand.Intn(255)),
				255}
		}
	}
	m := Image{x, y, img}
	pic.ShowImage(m)
}
Example #5
0
func main() {
	_, trace := getHeader("/home/taysom/tau/tau.pj/go.t/tour.d/a-meta")
	dy := divup(maxblock(trace), dx)
	m := Image{image.Rect(0, 0, dx, dy), make([][dx]bool, dy)}
	for _, t := range trace {
		for j := 0; j < int(t.Count); j++ {
			block := int(t.Block) + j
			y := block / dx
			x := block % dx
			m.Used[y][x] = true
		}
	}
	if false {
		pic.ShowImage(m)
	} else {
		fmt.Println(dx, dy)
	}
}
Example #6
0
func main() {
	m := Image{width: 500, height: 500}
	pic.ShowImage(m)
}
Example #7
0
func main() {
	m := &Image{100, 100}
	pic.ShowImage(m)
}
Example #8
0
func main() {
	m := Image{200, 200}
	pic.ShowImage(m)
}
Example #9
0
func main() {
	m := Image{w: 100, h: 100}
	pic.ShowImage(m)
}
Example #10
0
func main() {
	m := &Image{50, 50, 200, 200, 100}
	pic.ShowImage(m)
}
Example #11
0
func main() {
	m := Image{10, 10}
	pic.ShowImage(&m)
}
Example #12
0
func main() {
	m := Image{255, 255, power}
	pic.ShowImage(m)
}
Example #13
0
func main() {
	m := Image{10, 10}
	// it passes 'm' directly so we need to use (i Image) in above interface declaration.
	pic.ShowImage(m)
}
Example #14
0
File: image.go Project: taysom/tau
func main() {
	m := Image{image.Rect(0, 0, 255, 255)}
	pic.ShowImage(m)
}
Example #15
0
func main() {
	m := Image{100, 80}
	pic.ShowImage(m)
}
Example #16
0
func main() {
	img := Image{100, 200}
	pic.ShowImage(&img)
}
Example #17
0
func main() {
	m := NewImage(256, 256)
	pic.ShowImage(m)
}
Example #18
0
func main() {
	m := Image{256, 256}
	pic.ShowImage(m)
}
Example #19
0
func main() {
	m := Image{}
	pic.ShowImage(m)
}
Example #20
0
func main() {
	m := Image{32, 32, 128}
	pic.ShowImage(&m)
}
Example #21
0
func main() {
	pic.ShowImage(SampleImage(200, 200))
}
Example #22
0
func main() {
	m := Image{128, 128}
	pic.ShowImage(m)
}