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>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2022-11-23 15:41:33 +00:00
|
|
|
//const auto path = "/home/jmsgrogan/Downloads/test.png";
|
|
|
|
|
2022-11-24 17:43:31 +00:00
|
|
|
//const auto path = "/home/jmsgrogan/Downloads/index.png";
|
|
|
|
|
|
|
|
const auto path = "/home/jmsgrogan/code/MediaTool-build/bin/test.png";
|
2022-08-01 13:00:40 +00:00
|
|
|
|
2022-11-25 09:43:14 +00:00
|
|
|
File file(path);
|
|
|
|
std::cout << file.dumpBinary();
|
|
|
|
|
2022-08-01 13:00:40 +00:00
|
|
|
PngReader reader;
|
|
|
|
reader.setPath(path);
|
|
|
|
auto image = reader.read();
|
|
|
|
|
2022-11-25 09:43:14 +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;
|
|
|
|
}
|
|
|
|
|
2022-08-01 13:00:40 +00:00
|
|
|
return 0;
|
|
|
|
}
|