Small png cleaning.
This commit is contained in:
parent
86bc0d89f6
commit
59cc910d58
6 changed files with 83 additions and 74 deletions
|
@ -19,6 +19,14 @@ unsigned char BitStream::getCurrentByte()
|
|||
return mCurrentByte;
|
||||
}
|
||||
|
||||
void BitStream::write(uint32_t data)
|
||||
{
|
||||
unsigned num_bytes = sizeof(uint32_t);
|
||||
for(unsigned idx=0; idx<num_bytes;idx++)
|
||||
{
|
||||
writeByte(ByteUtils::getByteN(data, idx));
|
||||
}
|
||||
}
|
||||
|
||||
int BitStream::getCurrentByteOffset() const
|
||||
{
|
||||
|
|
|
@ -27,6 +27,8 @@ public:
|
|||
|
||||
virtual void writeByte(unsigned char data) = 0;
|
||||
|
||||
void write(uint32_t data);
|
||||
|
||||
virtual void writeBytes(const std::vector<unsigned char> data) = 0;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -27,6 +27,12 @@ public:
|
|||
return mBuffer;
|
||||
}
|
||||
|
||||
void resetOffsets()
|
||||
{
|
||||
mByteOffset = 0;
|
||||
mBitOffset = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<unsigned char> mBuffer;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue