Last change
on this file was
2,
checked in by oldcode, 24 years ago
|
Initial revision
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.2 KB
|
Line | |
---|
1 | |
---|
2 | |
---|
3 | #ifndef _ALI_PATHMAP_INC_ |
---|
4 | #define _ALI_PATHMAP_INC_ |
---|
5 | |
---|
6 | #include "ali_tarray.hxx" |
---|
7 | |
---|
8 | #define ALI_UNDEF 0x00 |
---|
9 | #define ALI_LEFT 0x01 |
---|
10 | #define ALI_DIAG 0x02 |
---|
11 | #define ALI_UP 0x04 |
---|
12 | #define ALI_LUP 0x08 |
---|
13 | |
---|
14 | /* |
---|
15 | * Structure for a long up pointer (a multi gap) |
---|
16 | */ |
---|
17 | struct ali_pathmap_up_pointer { |
---|
18 | unsigned long start; |
---|
19 | unsigned char operation; |
---|
20 | }; |
---|
21 | |
---|
22 | class ALI_PATHMAP { |
---|
23 | unsigned long width, height; |
---|
24 | unsigned long height_real; |
---|
25 | unsigned char **pathmap; |
---|
26 | ALI_TARRAY<ali_pathmap_up_pointer> ****up_pointers; |
---|
27 | unsigned char **optimized; |
---|
28 | |
---|
29 | public: |
---|
30 | |
---|
31 | ALI_PATHMAP(unsigned long width, unsigned long height); |
---|
32 | ~ALI_PATHMAP(void); |
---|
33 | |
---|
34 | void set(unsigned long x, unsigned long y, unsigned char val, |
---|
35 | ALI_TARRAY<ali_pathmap_up_pointer> *up_pointer = 0); |
---|
36 | void get(unsigned long x, unsigned long y, unsigned char *val, |
---|
37 | ALI_TARRAY<ali_pathmap_up_pointer> **up_pointer); |
---|
38 | unsigned char get_value(unsigned long x, unsigned long y) { |
---|
39 | if (x >= width || y >= height) |
---|
40 | ali_fatal_error("Out of range","ALI_PATHMAP::get_value()"); |
---|
41 | if (y & 0x01) |
---|
42 | return (*pathmap)[x*height_real + y/2] & 0x0f; |
---|
43 | else |
---|
44 | return (*pathmap)[x*height_real + y/2] >> 4; |
---|
45 | } |
---|
46 | void optimize(unsigned long x); |
---|
47 | void print(void); |
---|
48 | }; |
---|
49 | |
---|
50 | #endif |
---|
51 | |
---|
52 | |
---|
Note: See
TracBrowser
for help on using the repository browser.