diff options
| author | Martin Lehoux <martin@lehoux.net> | 2020-04-04 13:28:28 -0700 |
|---|---|---|
| committer | Martin Lehoux <martin@lehoux.net> | 2020-04-04 13:28:28 -0700 |
| commit | 3276ff864a4048a05ad3f0b34953ce937be1500c (patch) | |
| tree | 71ed492b63a133166ae221b2df16e79f9f5fd610 /main.go | |
feat - Save frame to file
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -0,0 +1,18 @@ +package main + +const HEIGHT = 100 +const WIDTH = 200 + +func main() { + frame := Frame{} + for x := 0; x < HEIGHT; x++ { + for y := 0; y < WIDTH; y++ { + frame[HEIGHT-1-x][y] = Pixel{ + r: 255 * y / WIDTH, + g: 255 * x / HEIGHT, + b: 255 * 0.2, + } + } + } + frame.Save("img.ppm") +} |
