summaryrefslogtreecommitdiff
path: root/main_image_output.cpp
blob: 10301daf002d44ba511e0ad2992b5ae722a37ccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//
// Created by Keuin on 2022/4/11.
//

#include <iostream>
#include "bitmap.h"

// write a test .PPM image
int main() {
    bitmap8b image{256, 256};
    pixel8b p{};
    for (int x = 0; x < 256; ++x) {
        for (int y = 0; y < 256; ++y) {
            p.r = x;
            p.b = y;
            image.set(x, y, p);
        }
    }
    image.write_plain_ppm(std::cout);
}