func main() { m := Image{} m.h = 50 m.w = 100 m.rgba = color.RGBA{1, 155, 255, 55} pic.ShowImage(m) }
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) }
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) }
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) }
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) } }
func main() { m := Image{width: 500, height: 500} pic.ShowImage(m) }
func main() { m := &Image{100, 100} pic.ShowImage(m) }
func main() { m := Image{200, 200} pic.ShowImage(m) }
func main() { m := Image{w: 100, h: 100} pic.ShowImage(m) }
func main() { m := &Image{50, 50, 200, 200, 100} pic.ShowImage(m) }
func main() { m := Image{10, 10} pic.ShowImage(&m) }
func main() { m := Image{255, 255, power} pic.ShowImage(m) }
func main() { m := Image{10, 10} // it passes 'm' directly so we need to use (i Image) in above interface declaration. pic.ShowImage(m) }
func main() { m := Image{image.Rect(0, 0, 255, 255)} pic.ShowImage(m) }
func main() { m := Image{100, 80} pic.ShowImage(m) }
func main() { img := Image{100, 200} pic.ShowImage(&img) }
func main() { m := NewImage(256, 256) pic.ShowImage(m) }
func main() { m := Image{256, 256} pic.ShowImage(m) }
func main() { m := Image{} pic.ShowImage(m) }
func main() { m := Image{32, 32, 128} pic.ShowImage(&m) }
func main() { pic.ShowImage(SampleImage(200, 200)) }
func main() { m := Image{128, 128} pic.ShowImage(m) }