2022-03-05 16:15:00 +01:00
|
|
|
#include <BMP.h>
|
2022-03-05 19:30:41 +01:00
|
|
|
#include <iostream>
|
|
|
|
#include <BmpHeader.h>
|
2022-03-05 16:15:00 +01:00
|
|
|
|
|
|
|
using namespace Leonetienne::BmpPP;
|
|
|
|
|
|
|
|
int main() {
|
2022-03-05 19:30:41 +01:00
|
|
|
|
2022-03-06 13:32:01 +01:00
|
|
|
/*
|
2022-03-05 19:30:41 +01:00
|
|
|
BMP bmp({800, 600}, Colormode::RGB);
|
|
|
|
|
|
|
|
for (int x = 0; x < 800; x++)
|
|
|
|
for (int y = 0; y < 600; y++) {
|
|
|
|
|
|
|
|
bmp.SetPixel({x, y},
|
|
|
|
(std::uint8_t)( ((double)x / 800.0) * 255.0),
|
|
|
|
(std::uint8_t)((1.0 - ((double)x / 800.0)) * 255.0),
|
|
|
|
(std::uint8_t)((1.0 - ((double)y / 800.0)) * 255.0),
|
|
|
|
255
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-03-06 12:08:26 +01:00
|
|
|
bmp.Write("write.bmp");
|
2022-03-06 13:32:01 +01:00
|
|
|
*/
|
|
|
|
|
2022-03-06 13:46:03 +01:00
|
|
|
BMP bmp("basea_gradient.bmp");
|
2022-03-06 13:32:01 +01:00
|
|
|
|
2022-03-06 13:46:03 +01:00
|
|
|
BMP newBmp = bmp.MirrorHorizontally();
|
|
|
|
//BMP newBmp = bmp.MirrorVertically();
|
2022-03-06 13:32:01 +01:00
|
|
|
|
2022-03-06 13:46:03 +01:00
|
|
|
if(!newBmp.Write("basea_gradient_flipped_hor.bmp"))
|
2022-03-06 13:32:01 +01:00
|
|
|
std::cerr << "What the hell" << std::endl;
|
2022-03-06 12:08:26 +01:00
|
|
|
|
|
|
|
/*
|
2022-03-05 22:00:57 +01:00
|
|
|
|
|
|
|
BMP bmp;
|
|
|
|
|
|
|
|
if (!bmp.Read("test.bmp"))
|
|
|
|
std::cerr << "Failed to read" << std::endl;
|
|
|
|
|
|
|
|
std::cout << (bmp.GetColormode() == Colormode::RGB) << std::endl;
|
|
|
|
|
|
|
|
if (!bmp.Write("testwrite.bmp"))
|
|
|
|
std::cerr << "What the hell" << std::endl;
|
|
|
|
|
2022-03-06 12:08:26 +01:00
|
|
|
*/
|
2022-03-05 16:15:00 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|