1
0
gotour-notes/genimage/go.go
2012-08-01 09:13:46 -06:00

29 lines
460 B
Go

package main
import (
"learning/pic"
"flag"
)
func Pic(dx, dy int) [][]uint8 {
result := make([][]uint8, dy)
for i := 0; i < dx; i++ {
result[i] = make([]uint8, dx)
}
var ii, jj uint8
for i := 0; i < dy; i++ {
for j := 0; j < dy; j++ {
ii = uint8(i)
jj = uint8(j)
result[i][j] = ii ^ jj
}
}
return result
}
func main() {
flag.Parse()
image := pic.CalculateImage(Pic)
pic.SaveImage(flag.Arg(0), image)
}