summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/arith.h
authorllornkcor <llornkcor>2002-07-01 23:24:08 (UTC)
committer llornkcor <llornkcor>2002-07-01 23:24:08 (UTC)
commit59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2 (patch) (unidiff)
treef148d4858859dac3b413e675c760acfdab24b8e6 /noncore/apps/opie-reader/arith.h
parentc08be8ae22dcc1bfb83cfdec807149b161d770f5 (diff)
downloadopie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.zip
opie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.tar.gz
opie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.tar.bz2
initial
Diffstat (limited to 'noncore/apps/opie-reader/arith.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/arith.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/arith.h b/noncore/apps/opie-reader/arith.h
new file mode 100644
index 0000000..19ca646
--- a/dev/null
+++ b/noncore/apps/opie-reader/arith.h
@@ -0,0 +1,43 @@
1/*
2 * Encodage & décodage arithmétique
3 */
4
5#ifndef ARITH_H
6
7#define ARITH_H
8
9#include "utypes.h"
10#include <stdio.h>
11
12class PPM_ReadBuf
13{
14 FILE *my_file_in;
15public:
16 PPM_ReadBuf(FILE* f) : my_file_in(f) {}
17 UINT readbuf(UCHAR *buf,UINT len)
18 {
19 UINT len1;
20 len1=fread(buf,1,len,my_file_in);
21 return len1;
22 }
23};
24
25class ArithClass
26{
27
28UCHAR *ainbuf;
29UCHAR *apinbuf,*aendinbuf;
30UINT ainbufsize;
31USHORT avalue,alow,ahigh;
32PPM_ReadBuf* areadbuf;
33UCHAR abitcnt;
34USHORT abitbuf;
35
36 public:
37void Arith_DecodeInit(PPM_ReadBuf* readbuf,UCHAR *buf,UINT bufsize);
38UINT Arith_DecodeVal(UINT size);
39void Arith_Decode(UINT min,UINT max,UINT size);
40void Arith_DecodeEnd(void);
41
42};
43#endif