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

43 lines
996 B
C++
Raw Permalink 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-12-01 10:52:48 +00:00
#include "TestUtils.h"
2022-11-23 15:41:33 +00:00
2022-08-01 13:00:40 +00:00
#include "Image.h"
#include <iostream>
2022-11-29 18:00:19 +00:00
#include "TestFramework.h"
TEST_CASE(TestThirdPartyPng, "image")
2022-08-01 13:00:40 +00:00
{
2022-12-01 10:52:48 +00:00
const auto path = TestUtils::getTestDataDir() / "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;
//}
}
2022-11-29 18:00:19 +00:00
TEST_CASE(TestFxedCodePng, "image")
2022-11-28 10:16:04 +00:00
{
2022-12-01 10:52:48 +00:00
const auto path = TestUtils::getTestDataDir() / "test_fixed.png";
2022-11-28 10:16:04 +00:00
//File file(path);
//std::cout << file.dumpBinary();
PngReader reader;
reader.setPath(path);
auto image = reader.read();
}