Continue work on png writer.

This commit is contained in:
James Grogan 2022-11-23 17:51:36 +00:00
parent 9c8faa534b
commit 86bc0d89f6
19 changed files with 225 additions and 19 deletions

View file

@ -13,6 +13,16 @@ int main()
auto slice = ByteUtils::getMBitsAtN(byte, 3, 3);
std::cout << "Slice is " << ByteUtils::toString(slice) << std::endl;
uint32_t input {12345678};
auto byte0 = ByteUtils::getByteN(input, 0);
auto byte1 = ByteUtils::getByteN(input, 1);
auto byte2 = ByteUtils::getByteN(input, 2);
auto byte3 = ByteUtils::getByteN(input, 3);
std::cout << "Byte0 is " << ByteUtils::toString(byte0) << std::endl;
std::cout << "Byte1 is " << ByteUtils::toString(byte1) << std::endl;
std::cout << "Byte2 is " << ByteUtils::toString(byte2) << std::endl;
std::cout << "Byte3 is " << ByteUtils::toString(byte3) << std::endl;
return 0;
}

View file

@ -1,7 +1,7 @@
#include "Image.h"
#include "PngWriter.h"
#include "File.h"
#include "BitStream.h"
#include "ImagePrimitives.h"
@ -24,5 +24,15 @@ int main()
writer.setPath("test.png");
writer.write(image);
File test_file("test.png");
test_file.SetAccessMode(File::AccessMode::Read);
test_file.Open(true);
while(auto byte = test_file.readNextByte())
{
std::cout << static_cast<unsigned>(*byte) << std::endl;
}
test_file.Close();
return 0;
}