Grok  7.6.6
IBitIO.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2021 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 
29  virtual ~IBitIO() {
30  }
31 
36  virtual size_t numbytes()=0;
37 
43  virtual bool write(uint32_t v, uint32_t n)= 0;
49  virtual void read(uint32_t *bits, uint32_t n)= 0;
54  virtual bool flush()= 0;
58  virtual void inalign()= 0;
59 
60 };
61 
62 }
63 
Bit input/output.
Definition: IBitIO.h:25
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 void inalign()=0
Passes the ending bits (coming from flushing)
virtual size_t numbytes()=0
Number of bytes written.
virtual ~IBitIO()
Definition: IBitIO.h:29
Copyright (C) 2016-2021 Grok Image Compression Inc.
Definition: BitIO.cpp:23