32 lines
640 B
C++
32 lines
640 B
C++
#pragma once
|
|
|
|
#include "BitStream.h"
|
|
|
|
#include "Image.h"
|
|
|
|
class ImageBitStream : public BitStream
|
|
{
|
|
public:
|
|
ImageBitStream(Image<unsigned char>* 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> data) override
|
|
{
|
|
|
|
}
|
|
|
|
unsigned getBytesPerScanline() const
|
|
{
|
|
return mImage->getBytesPerRow();
|
|
}
|
|
|
|
private:
|
|
Image<unsigned char>* mImage{nullptr};
|
|
};
|