Grok  9.7.5
IBitIO.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2022 Grok Image Compression Inc.
3  *
4  * This source code is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License, version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This source code is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 #pragma once
17 
18 #include <cstdint>
19 
20 namespace grk
21 {
25 class IBitIO
26 {
27  public:
28  virtual ~IBitIO() {}
29 
34  virtual size_t numBytes() = 0;
35 
41  virtual bool write(uint32_t v, uint32_t n) = 0;
47  virtual void read(uint32_t* bits, uint32_t n) = 0;
52  virtual bool flush() = 0;
56  virtual void inalign() = 0;
57 };
58 
59 } // namespace grk
Bit input/output.
Definition: IBitIO.h:26
virtual bool flush()=0
Flush bits.
virtual bool write(uint32_t v, uint32_t n)=0
Write bits.
virtual void read(uint32_t *bits, uint32_t n)=0
Read bits.
virtual size_t numBytes()=0
Number of bytes written.
virtual void inalign()=0
Passes the ending bits (coming from flushing)
virtual ~IBitIO()
Definition: IBitIO.h:28
Copyright (C) 2016-2022 Grok Image Compression Inc.
Definition: ICacheable.h:20
const vfloat64m1_t v
Definition: rvv-inl.h:1656