BmpPP/Exec/main.cpp

22 lines
498 B
C++
Raw Normal View History

2022-03-05 16:15:00 +01:00
#include <BMP.h>
#include <iostream>
#include <BmpHeader.h>
#include <Eule/Math.h>
2022-03-05 16:15:00 +01:00
using namespace Leonetienne::BmpPP;
2022-03-06 20:16:54 +01:00
using namespace Leonetienne::Eule;
2022-03-05 16:15:00 +01:00
int main() {
2022-03-06 20:16:54 +01:00
// Draw gradient
BMP bmp(Vector2i(800, 600), Colormode::RGB);
2022-03-06 20:16:54 +01:00
for (std::size_t x = 0; x < bmp.GetDimensions().x; x++)
for (std::size_t y = 0; y < bmp.GetDimensions().y; y++)
bmp.SetPixel(Vector2i(x, y), (float)x / (float)bmp.GetDimensions().x * 255.0f);
2022-03-06 20:16:54 +01:00
bmp.Write("gradient.bmp");
2022-03-05 16:15:00 +01:00
return 0;
}