stuff-from-scratch/test/image/TestPngReader.cpp
2022-11-25 09:43:14 +00:00

29 lines
661 B
C++

#include "PngReader.h"
#include "BitStream.h"
#include "Image.h"
#include <iostream>
int main()
{
//const auto path = "/home/jmsgrogan/Downloads/test.png";
//const auto path = "/home/jmsgrogan/Downloads/index.png";
const auto path = "/home/jmsgrogan/code/MediaTool-build/bin/test.png";
File file(path);
std::cout << file.dumpBinary();
PngReader reader;
reader.setPath(path);
auto image = reader.read();
for(unsigned idx=0; idx<image->getWidth()*image->getBytesPerRow(); idx++)
{
std::cout << "Image val: " << idx << " | " << static_cast<int>(image->getDataRef()[idx]) << std::endl;
}
return 0;
}