34 lines
605 B
C++
34 lines
605 B
C++
#pragma once
|
|
|
|
#include "BitStream.h"
|
|
|
|
#include "Image.h"
|
|
|
|
#include <cstdint>
|
|
|
|
class ImageBitStream : public BitStream
|
|
{
|
|
public:
|
|
ImageBitStream(Image* image);
|
|
|
|
bool isFinished() const override;
|
|
|
|
std::vector<uint8_t> peekNextNBytes(std::size_t n) const override;
|
|
|
|
std::optional<uint8_t> readNextByte() override;
|
|
|
|
void writeByte(uint8_t data, bool checkOverflow = true) override;
|
|
|
|
void writeBytes(const std::vector<uint8_t>&) override
|
|
{
|
|
|
|
}
|
|
|
|
unsigned getBytesPerScanline() const
|
|
{
|
|
return mImage->getBytesPerRow();
|
|
}
|
|
|
|
private:
|
|
Image* mImage{nullptr};
|
|
};
|