stuff-from-scratch/test/image/TestPngReader.cpp

48 lines
995 B
C++
Raw Normal View History

2022-08-01 13:00:40 +00:00
#include "PngReader.h"
2022-11-23 15:41:33 +00:00
#include "BitStream.h"
2022-08-01 13:00:40 +00:00
#include "Image.h"
#include <iostream>
2022-11-28 10:16:04 +00:00
void testThirdParty()
2022-08-01 13:00:40 +00:00
{
2022-11-28 18:05:39 +00:00
const auto path = "/home/jmsgrogan/Downloads/test.png";
2022-11-23 15:41:33 +00:00
2022-11-28 18:05:39 +00:00
//const auto path = "/home/jmsgrogan/Downloads/index.png";
2022-11-24 17:43:31 +00:00
2022-11-28 10:16:04 +00:00
//const auto path = "/home/jmsgrogan/code/MediaTool-build/bin/test.png";
2022-08-01 13:00:40 +00:00
2022-11-28 10:16:04 +00:00
//File file(path);
//std::cout << file.dumpBinary();
2022-11-25 09:43:14 +00:00
2022-08-01 13:00:40 +00:00
PngReader reader;
reader.setPath(path);
auto image = reader.read();
2022-11-28 10:16:04 +00:00
//for(unsigned idx=0; idx<image->getWidth()*image->getBytesPerRow(); idx++)
//{
// std::cout << "Image val: " << idx << " | " << static_cast<int>(image->getDataRef()[idx]) << std::endl;
//}
}
void testFixedCode()
{
const auto path = "/home/jmsgrogan/code/MediaTool-build/bin/test_fixed.png";
//File file(path);
//std::cout << file.dumpBinary();
PngReader reader;
reader.setPath(path);
auto image = reader.read();
}
int main()
{
testThirdParty();
//testFixedCode();
2022-11-25 09:43:14 +00:00
2022-08-01 13:00:40 +00:00
return 0;
}