IBitIO.h
Go to the documentation of this file.
/*
* Copyright (C) 2016-2023 Grok Image Compression Inc.
*
* This source code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <cstdint>
namespace grk
{
class IBitIO
{
public:
virtual ~IBitIO() {}
virtual size_t numBytes() = 0;
virtual bool write(uint32_t v, uint32_t n) = 0;
virtual bool write(uint32_t v) = 0;
virtual void read(uint32_t* bits, uint8_t n) = 0;
virtual uint8_t read(void) = 0;
virtual bool flush() = 0;
virtual void inalign() = 0;
};
} // namespace grk
grk::IBitIO
Bit input/output.
Definition IBitIO.h:26
grk::IBitIO::flush
virtual bool flush()=0
Flush bits.
grk::IBitIO::write
virtual bool write(uint32_t v, uint32_t n)=0
Write bits.
grk::IBitIO::numBytes
virtual size_t numBytes()=0
Number of bytes written.
grk::IBitIO::read
virtual void read(uint32_t *bits, uint8_t n)=0
Read bits.
grk::IBitIO::inalign
virtual void inalign()=0
Passes the ending bits (coming from flushing)
grk::IBitIO::read
virtual uint8_t read(void)=0
Read bit.
grk::IBitIO::write
virtual bool write(uint32_t v)=0
grk::IBitIO::~IBitIO
virtual ~IBitIO()
Definition IBitIO.h:28
grk
Copyright (C) 2016-2023 Grok Image Compression Inc.
Definition ICacheable.h:20
grk::grk_read
void grk_read(const uint8_t *buffer, TYPE *value, uint32_t numBytes)
Definition BufferedStream.h:239