#pragma once

#include "BitStream.h"

#include "Image.h"

class ImageBitStream : public BitStream
{
public:
    ImageBitStream(Image* image);

    bool isFinished() const override;

    std::vector<unsigned char> peekNextNBytes(unsigned n) const override;

    std::optional<unsigned char> readNextByte() override;

    void writeByte(unsigned char data, bool checkOverflow = true) override;

    void writeBytes(const std::vector<unsigned char>) override
    {

    }

    unsigned getBytesPerScanline() const
    {
        return mImage->getBytesPerRow();
    }

private:
    Image* mImage{nullptr};
};
