1
0
gotour-notes/genimage/go.go
2012-08-02 15:23:46 -06:00

27 lines
448 B
Go

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