diff options
author | Ben Burwell <ben@benburwell.com> | 2019-08-27 20:33:24 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-08-27 20:33:24 -0400 |
commit | 51c613d117309891666d01951899804b0a6cc7d0 (patch) | |
tree | b155de9fb25294249594dccfbe9d692ca2c14cb6 | |
parent | cc94370fd1aa334e6511aaf6ccdc0c5e727367f3 (diff) |
make bigger
-rw-r--r-- | main.go | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -29,7 +29,7 @@ func main() { } seed := hash(*username) - img := repeat(generateImage(seed)) + img := makeBigger(repeat(generateImage(seed))) str, err := encodeImage(img) if err != nil { fmt.Printf("%v\n", err) @@ -92,10 +92,16 @@ func repeat(img image.Image) image.Image { return newImg } -// func makeBigger(img image.Image) image.Image { -// newImg := image.NewNRGBA(image.Rect(0, 0, 200, 200)) -// for x := 0; x < 10; x++ { -// for y := 0; y < 10; y++ { -// } -// } -// } +func makeBigger(img image.Image) image.Image { + newImg := image.NewNRGBA(image.Rect(0, 0, 200, 200)) + for x := 0; x < 10; x++ { + for y := 0; y < 10; y++ { + for i := 0; i < 20; i++ { + for j := 0; j < 20; j++ { + newImg.Set(x*20+i, y*20+j, img.At(x, y)) + } + } + } + } + return newImg +} |