00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include "rle.h"
00033
00034
00035
00036
00037 #ifdef __cplusplus
00038 #ifndef c_plusplus
00039 #define c_plusplus
00040 #endif
00041 extern "C" {
00042 #endif
00043
00044
00045 #ifdef c_plusplus
00046 #define ARB_ARGS ...
00047 #else
00048 #define ARB_ARGS
00049 #endif
00050
00051 typedef int rle_fn( ARB_ARGS );
00052
00053 struct rle_dispatch_tab {
00054 CONST_DECL char *magic;
00055 rle_fn *setup,
00056 *skipBlankLines,
00057 *setColor,
00058 *skipPixels,
00059 *newScanLine,
00060 *putdat,
00061 *putrn,
00062 *blockHook,
00063
00064 *putEof;
00065 };
00066
00067 extern struct rle_dispatch_tab rle_DTable[];
00068
00069
00070
00071
00072
00073
00074
00075
00076 #define rle_magic (rle_DTable[(int)the_hdr->dispatch].magic)
00077 #define Setup() (*rle_DTable[(int)the_hdr->dispatch].setup)(the_hdr)
00078 #define SkipBlankLines(n) (*rle_DTable[(int)the_hdr->dispatch].skipBlankLines)(n, the_hdr)
00079 #define SetColor(c) (*rle_DTable[(int)the_hdr->dispatch].setColor)(c, the_hdr)
00080 #define SkipPixels(n, l, r) (*rle_DTable[(int)the_hdr->dispatch].skipPixels)(n,l,r, the_hdr)
00081 #define NewScanLine(flag) (*rle_DTable[(int)the_hdr->dispatch].newScanLine)(flag, the_hdr)
00082 #define putdata(buf, len) (*rle_DTable[(int)the_hdr->dispatch].putdat)(buf, len, the_hdr)
00083 #define putrun(val, len, f) (*rle_DTable[(int)the_hdr->dispatch].putrn)(val,len,f, the_hdr)
00084 #define BlockHook() (*rle_DTable[(int)the_hdr->dispatch].blockHook)(the_hdr)
00085 #define PutEof() (*rle_DTable[(int)the_hdr->dispatch].putEof)(the_hdr)
00086
00087
00088
00089
00090 #define DATA 0
00091 #define RUN1 1
00092 #define RUN2 2
00093 #define RUN3 3
00094 #define RUN4 4
00095 #define RUN5 5
00096 #define RUN6 6
00097 #define RUN7 7
00098 #define INRUN -1
00099
00100 #ifdef __cplusplus
00101 }
00102 #endif
00103