#include "ImageBitStream.h" ImageBitStream::ImageBitStream(Image* image) : BitStream(), mImage(image) { } bool ImageBitStream::isFinished() const { return mByteOffset == mImage->getDataRef().size(); } std::vector ImageBitStream::peekNextNBytes(unsigned n) const { return {}; } std::optional ImageBitStream::readNextByte() { mByteOffset++; if (isFinished() ) { return std::nullopt; } const auto val = mImage->getDataRef()[mByteOffset]; return val; } void ImageBitStream::writeByte(unsigned char data) { mByteOffset++; if (isFinished() ) { return; } mImage->setDataItem(mByteOffset, data); }