satdump/src-testing/main.cpp

36 lines
1.1 KiB
C++
Raw Normal View History

/**********************************************************************
2022-03-20 20:56:32 +01:00
* This file is used for testing random stuff without running the
* whole of SatDump, which comes in handy for debugging individual
* elements before putting them all together in modules...
2022-03-20 20:56:32 +01:00
*
* If you are an user, ignore this file which will not be built by
* default, and if you're a developper in need of doing stuff here...
* Go ahead!
2022-03-20 20:56:32 +01:00
*
* Don't judge the code you might see in there! :)
**********************************************************************/
2022-03-28 11:51:13 +02:00
#include "logger.h"
#include "common/image/image.h"
2022-05-03 17:00:43 +02:00
int main(int argc, char *argv[])
2022-04-22 19:58:53 +02:00
{
2022-05-03 17:00:43 +02:00
initLogger();
2022-04-22 19:58:53 +02:00
2022-05-03 17:00:43 +02:00
image::Image<uint16_t> img1, img2;
img1.load_png(argv[1]);
img2.load_png(argv[2]);
2022-04-22 19:58:53 +02:00
2022-05-03 17:00:43 +02:00
image::Image<uint16_t> img(img1.width() * 2, img2.height(), 1);
2022-04-22 19:58:53 +02:00
2022-05-03 17:00:43 +02:00
for (int i = 0; i < img1.height(); i++)
2022-04-22 19:58:53 +02:00
{
2022-05-03 17:00:43 +02:00
for (int y = 0; y < img1.width(); y++)
2022-04-22 19:58:53 +02:00
{
2022-05-03 17:00:43 +02:00
img[i * img.width() + y * 2 + 0] = img1[i * img1.width() + y];
img[i * img.width() + y * 2 + 1] = img2[i * img2.width() + y];
2022-04-22 19:58:53 +02:00
}
}
2022-05-03 17:00:43 +02:00
img.save_png(argv[3]);
}