func main() { /* Choose the color function by changing the closure below * Interesting functions include x^y, x*y and (x+y)/2 */ m := Image{257, 257, func(x, y int) uint8 { return uint8(x * y) }} pic.ShowImage(m) }
func main() { m := Image{width: 200, height: 200} m.Initialize() m.Draw() pic.ShowImage(&m) //fmt.Println(m.image) }
func ExerciseImages() { m := Image{ W: 100, H: 100, } pic.ShowImage(m) }
func main() { m := Image{} m.x = 0 m.y = 0 m.w = 100 m.h = 100 pic.ShowImage(m) }
func main() { m := Image{ 256, 256, func(x, y int) uint8 { return uint8((x + y) / 2) }, } pic.ShowImage(m) }
func main() { m := &Image{ x: 100, y: 200, r: 255, g: 128, b: 128, a: 255, } pic.ShowImage(m) }
func main() { haha := make([][]byte, 100) for i := range haha { haha[i] = make([]byte, 100) } for i := range haha { for j := range haha[i] { haha[i][j] = byte(i * j * i) } } m := Image{100, 100, haha} pic.ShowImage(m) }
func main() { m := Image{256, 256} pic.ShowImage(m) }
func imageTester() { m := image.NewRGBA(image.Rect(0, 0, 100, 100)) fmt.Println("Bounds = ", m.Bounds()) fmt.Println(m.At(0, 0).RGBA()) pic.ShowImage(m) }
func main() { m := Image{100, 200, 200} pic.ShowImage(&m) }
func main() { m := Image{200, 200, 255} pic.ShowImage(&m) }
func TestImage2(t *testing.T) { m := Image{100, 100} pic.ShowImage(m) }
func main() { m := Image{Pic(100, 100)} pic.ShowImage(m) }
func main() { m := Image{50, 80, 120} pic.ShowImage(&m) }
func main() { //sq := func(x, y, w, h int) int { return x * y } pic.ShowImage(&Image{500, 500, mandelbrot}) }
func main() { m := Image{100, 100} pic.ShowImage(m) }
func main() { pic.ShowImage(&Image{}) }
func main() { m := Image{255, 255} pic.ShowImage(m) }
func main() { m := Image{128, 128} pic.ShowImage(m) }
func main() { m := Image{W: 100, H: 100} pic.ShowImage(m) }
func testImages() { m := Image{W: 100, H: 100} pic.ShowImage(m) }
func main() { i := NewImage(255, 255, func(a, b int) uint8 { return uint8((a^b)/1 + (a + b)) }) // Need the one so you don't divide by zero pic.ShowImage(i) }
func main() { m := &Image{10, 20} pic.ShowImage(m) }
func main() { m := Image{} pic.ShowImage(m) }
func main() { m := Image{250, 70} pic.ShowImage(m) }