source: trunk/indexers/mg/src/images/marklist.h@ 3745

Last change on this file since 3745 was 3745, checked in by mdewsnip, 21 years ago

Addition of MG package for search and retrieval

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
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
30typedef 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 }
48marktype;
49
50
51typedef struct marklisttype *marklistptr;
52typedef struct marklisttype
53 {
54 marktype data;
55 marklistptr next;
56 }
57marklisttype;
58
59
60void marktype_dump (marktype d);
61marktype marktype_copy (marktype d);
62
63float marktype_density (marktype d);
64void marktype_calc_centroid (marktype * b);
65void marktype_calc_features (marktype * d, char str[]);
66void marktype_adj_bound (marktype * m);
67
68void marklist_average (marklistptr list, marktype * avgmark);
69void marklist_setnull (marklistptr * list);
70marklistptr marklist_add (marklistptr * list, marktype m);
71marklistptr marklist_addcopy (marklistptr * list, marktype m);
72int marklist_length (marklistptr list);
73void marklist_dump (marklistptr list);
74marklistptr marklist_getat (marklistptr list, int pos, marktype * d);
75void marklist_free (marklistptr * list);
76int marklist_removeat (marklistptr * list, int pos);
77marklistptr marklist_next (marklistptr list);
78
79void write_library_mark (FILE * fp, marktype d);
80int read_library_mark (FILE * fp, marktype * d);
81int 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 */
92typedef struct elem *elemptr;
93typedef struct elem
94 {
95 int num;
96 int pos;
97 int freq;
98 elemptr next;
99 }
100elem;
101
102typedef struct elemlist
103 {
104 elemptr head;
105 int tot;
106 }
107elemlist;
108
109void elem_add (elemlist * list, int num);
110void elem_free (elemlist * list);
111int elem_find (elemlist * list, int n, int *p, int *f, int *t);
112int elem_getrange (elemlist * list, int range, int *num);
113
114#endif
Note: See TracBrowser for help on using the repository browser.