1 | /**************************************************************************
|
---|
2 | *
|
---|
3 | * marklist.h -- Functions managing the list of marks
|
---|
4 | * Copyright (C) 1994 Stuart Inglis
|
---|
5 | *
|
---|
6 | * This program is free software; you can redistribute it and/or modify
|
---|
7 | * it under the terms of the GNU General Public License as published by
|
---|
8 | * the Free Software Foundation; either version 2 of the License, or
|
---|
9 | * (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This program is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | * GNU General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU General Public License
|
---|
17 | * along with this program; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
19 | *
|
---|
20 | * $Id: marklist.h 3745 2003-02-20 21:20:24Z mdewsnip $
|
---|
21 | *
|
---|
22 | **************************************************************************/
|
---|
23 |
|
---|
24 | #ifndef __MARKLIST_H
|
---|
25 | #define __MARKLIST_H
|
---|
26 |
|
---|
27 | #include "sysfuncs.h"
|
---|
28 | #include "basictypes.h"
|
---|
29 |
|
---|
30 | typedef struct
|
---|
31 | {
|
---|
32 | int symnum;
|
---|
33 | int xpos, ypos;
|
---|
34 | int w, h;
|
---|
35 | int xcen, ycen;
|
---|
36 | int xoffset, yoffset;
|
---|
37 | char name[10];
|
---|
38 | Pixel **bitmap;
|
---|
39 |
|
---|
40 | int xcen1, ycen1;
|
---|
41 | int xcen2, ycen2;
|
---|
42 | int xcen3, ycen3;
|
---|
43 | int xcen4, ycen4;
|
---|
44 | int set;
|
---|
45 | int h_runs;
|
---|
46 | int v_runs;
|
---|
47 | }
|
---|
48 | marktype;
|
---|
49 |
|
---|
50 |
|
---|
51 | typedef struct marklisttype *marklistptr;
|
---|
52 | typedef struct marklisttype
|
---|
53 | {
|
---|
54 | marktype data;
|
---|
55 | marklistptr next;
|
---|
56 | }
|
---|
57 | marklisttype;
|
---|
58 |
|
---|
59 |
|
---|
60 | void marktype_dump (marktype d);
|
---|
61 | marktype marktype_copy (marktype d);
|
---|
62 |
|
---|
63 | float marktype_density (marktype d);
|
---|
64 | void marktype_calc_centroid (marktype * b);
|
---|
65 | void marktype_calc_features (marktype * d, char str[]);
|
---|
66 | void marktype_adj_bound (marktype * m);
|
---|
67 |
|
---|
68 | void marklist_average (marklistptr list, marktype * avgmark);
|
---|
69 | void marklist_setnull (marklistptr * list);
|
---|
70 | marklistptr marklist_add (marklistptr * list, marktype m);
|
---|
71 | marklistptr marklist_addcopy (marklistptr * list, marktype m);
|
---|
72 | int marklist_length (marklistptr list);
|
---|
73 | void marklist_dump (marklistptr list);
|
---|
74 | marklistptr marklist_getat (marklistptr list, int pos, marktype * d);
|
---|
75 | void marklist_free (marklistptr * list);
|
---|
76 | int marklist_removeat (marklistptr * list, int pos);
|
---|
77 | marklistptr marklist_next (marklistptr list);
|
---|
78 |
|
---|
79 | void write_library_mark (FILE * fp, marktype d);
|
---|
80 | int read_library_mark (FILE * fp, marktype * d);
|
---|
81 | int read_library (char libraryname[], marklistptr * library);
|
---|
82 |
|
---|
83 |
|
---|
84 |
|
---|
85 |
|
---|
86 |
|
---|
87 |
|
---|
88 | /*
|
---|
89 | The 'elem' structure is an ordered linked list, with fields corresponding
|
---|
90 | directly to the arithmetic coding routines.
|
---|
91 | */
|
---|
92 | typedef struct elem *elemptr;
|
---|
93 | typedef struct elem
|
---|
94 | {
|
---|
95 | int num;
|
---|
96 | int pos;
|
---|
97 | int freq;
|
---|
98 | elemptr next;
|
---|
99 | }
|
---|
100 | elem;
|
---|
101 |
|
---|
102 | typedef struct elemlist
|
---|
103 | {
|
---|
104 | elemptr head;
|
---|
105 | int tot;
|
---|
106 | }
|
---|
107 | elemlist;
|
---|
108 |
|
---|
109 | void elem_add (elemlist * list, int num);
|
---|
110 | void elem_free (elemlist * list);
|
---|
111 | int elem_find (elemlist * list, int n, int *p, int *f, int *t);
|
---|
112 | int elem_getrange (elemlist * list, int range, int *num);
|
---|
113 |
|
---|
114 | #endif
|
---|