1
0

fixed error with image generation

This commit is contained in:
Stephen M. McQuay 2012-08-02 15:04:07 -06:00
parent e99ca5c8fa
commit bdc7a5c44a
2 changed files with 5 additions and 7 deletions

View File

@ -7,15 +7,13 @@ import (
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++ {
for j := 0; j < dy; j++ {
result[j] = make([]uint8, dx)
for i := 0; i < dx; i++ {
ii = uint8(i)
jj = uint8(j)
result[i][j] = ii ^ jj
result[j][i] = ii ^ jj
}
}
return result

View File

@ -15,7 +15,7 @@ import (
func CalculateImage(f func(int, int) [][]uint8) image.Image {
const (
dx = 256
dy = 256
dy = 1024
)
data := f(dx, dy)
m := image.NewNRGBA(image.Rect(0, 0, dx, dy))