~ubuntu-branches/debian/experimental/cuneiform/experimental

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/evn32/src/struct.h

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk, libm.diff, swapbytes.diff
  • Date: 2010-09-14 15:53:54 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914155354-hhxaa13xmhb82e3e
Tags: 1.0.0+dfsg-1
* New upstream release (closes: #575419).
* New maintainer (closes: #543893).
* Document in README.source how to repackage upstream tarball.
* Update debian/copyright.
  + Document that the package is auto-buildable.
  + Document which files were stripped from the upstream tarball.
  + Convert to the DEP-5 format.
* Drop README.Debian, no longer needed.
* Rewrite debian/rules from scratch using dh.
  + Bump debhelper minimum version to 7.4.4 (for cmake support).
  + Turn on MAKE_VERBOSE_MAKEFILE.
  + Disable call to dh_makeshlibs to avoid creation of spurious
    calls to ldconfig in postrm/postinst.
  + Add get-orig-source target.
* Remove unused overrides.
* Link to GraphicsMagick rather than ImageMagick:
  + Build-depend on graphicsmagick-libmagick-dev-compat.
  + Add patch to properly initialize the library. [graphicsmagick.diff]    
* Bump standards version to 3.9.1 (no changes needed).
* Force upgrade of ocrodjvu to at least 0.4.2; earlier versions of ocrodjvu
  don't support this version of Cuneiform.
* List all the supported languages in the package description.
* Update the manual page.
  + Document --dotmatrix, --fax and --singlecolumn options.
  + Document all output formats.
  + Don't use hyphen as minus sign.
  + Fix a few formatting issues.
* Drop Vcs-* fields.
* Add watch file.
* Add patch from Dmitrijs Ledkovs to link the lao library with libm.
  [libm.diff]
* Add patch for a for a more portable function to swap byte order.
  [swapbytes.diff]
* Set Architecture to any; there's no good reason to limit it.
* Run rudimentary tests at build time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
Copyright (c) 1993-2008, Cognitive Technologies
3
 
All rights reserved.
4
 
 
5
 
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
 
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
7
 
 
8
 
      * ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
 
        ���� ����������� �� ��������� �����, ���� ������ ������� � �����������
10
 
        ����� �� ��������.
11
 
      * ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
 
        ������ ����������, ������������ ��� ���������������, ������ �����������
13
 
        ��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
 
        ����������� ����� �� ��������.
15
 
      * �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
 
        ���� ������������ � �������� �������� ��������� �/��� �����������
17
 
        ���������, ���������� �� ���� ��, ��� ���������������� �����������
18
 
        ����������.
19
 
 
20
 
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
 
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
 
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
 
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
 
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
 
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
 
������������� ������, ��������� � �������������� ��� ���������� ����������
27
 
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
 
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
 
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
 
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
 
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
32
 
 
33
 
Redistribution and use in source and binary forms, with or without modification,
34
 
are permitted provided that the following conditions are met:
35
 
 
36
 
    * Redistributions of source code must retain the above copyright notice,
37
 
      this list of conditions and the following disclaimer.
38
 
    * Redistributions in binary form must reproduce the above copyright notice,
39
 
      this list of conditions and the following disclaimer in the documentation
40
 
      and/or other materials provided with the distribution.
41
 
    * Neither the name of the Cognitive Technologies nor the names of its
42
 
      contributors may be used to endorse or promote products derived from this
43
 
      software without specific prior written permission.
44
 
 
45
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
46
 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47
 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
48
 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
49
 
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50
 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
51
 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
52
 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
53
 
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
54
 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55
 
*/
56
 
 
 
2
 Copyright (c) 1993-2008, Cognitive Technologies
 
3
 All rights reserved.
 
4
 
 
5
 Разрешается повторное распространение и использование как в виде исходного кода,
 
6
 так и в двоичной форме, с изменениями или без, при соблюдении следующих условий:
 
7
 
 
8
 * При повторном распространении исходного кода должны оставаться указанное
 
9
 выше уведомление об авторском праве, этот список условий и последующий
 
10
 отказ от гарантий.
 
11
 * При повторном распространении двоичного кода в документации и/или в
 
12
 других материалах, поставляемых при распространении, должны сохраняться
 
13
 указанная выше информация об авторском праве, этот список условий и
 
14
 последующий отказ от гарантий.
 
15
 * Ни название Cognitive Technologies, ни имена ее сотрудников не могут
 
16
 быть использованы в качестве средства поддержки и/или продвижения
 
17
 продуктов, основанных на этом ПО, без предварительного письменного
 
18
 разрешения.
 
19
 
 
20
 ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ ЛИЦАМИ "КАК
 
21
 ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ,
 
22
 ВКЛЮЧАЯ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ, НО НЕ
 
23
 ОГРАНИЧИВАЯСЬ ИМИ. НИ ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО ДРУГОЕ ЛИЦО, КОТОРОЕ
 
24
 МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, НИ В КОЕМ СЛУЧАЕ НЕ
 
25
 НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, СПЕЦИАЛЬНЫЕ ИЛИ
 
26
 ПОСЛЕДОВАВШИЕ УБЫТКИ, СВЯЗАННЫЕ С ИСПОЛЬЗОВАНИЕМ ИЛИ ПОНЕСЕННЫЕ ВСЛЕДСТВИЕ
 
27
 НЕВОЗМОЖНОСТИ ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ ПОТЕРИ ДАННЫХ, ИЛИ ДАННЫЕ,
 
28
 СТАВШИЕ НЕГОДНЫМИ, ИЛИ УБЫТКИ И/ИЛИ ПОТЕРИ ДОХОДОВ, ПОНЕСЕННЫЕ ИЗ-ЗА ДЕЙСТВИЙ
 
29
 ТРЕТЬИХ ЛИЦ И/ИЛИ ОТКАЗА ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ,
 
30
 НО НЕ ОГРАНИЧИВАЯСЬ ЭТИМИ СЛУЧАЯМИ), НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ДАЖЕ ЕСЛИ ТАКОЙ
 
31
 ВЛАДЕЛЕЦ ИЛИ ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ И ПОТЕРЬ.
 
32
 
 
33
 Redistribution and use in source and binary forms, with or without modification,
 
34
 are permitted provided that the following conditions are met:
 
35
 
 
36
 * Redistributions of source code must retain the above copyright notice,
 
37
 this list of conditions and the following disclaimer.
 
38
 * Redistributions in binary form must reproduce the above copyright notice,
 
39
 this list of conditions and the following disclaimer in the documentation
 
40
 and/or other materials provided with the distribution.
 
41
 * Neither the name of the Cognitive Technologies nor the names of its
 
42
 contributors may be used to endorse or promote products derived from this
 
43
 software without specific prior written permission.
 
44
 
 
45
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 
46
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
47
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
48
 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 
49
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
50
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
51
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
52
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
53
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
54
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
55
 */
57
56
 
58
57
#ifndef H_struct_h
59
58
#define H_struct_h
60
59
 
61
 
//#include "Tuner.H"
62
60
#include "recdefs.h"
63
61
#include "evndefs.h"
64
62
#include "minmax.h"
65
63
 
66
 
 
67
64
#ifdef  HUGE_IMAGE
68
 
        #define WORLD_MAX_HEIGHT        10000
69
 
        #define WORLD_MAX_WIDTH         10000    //7000
70
 
        #define WORLD_MAX_RESOLUTION    800
 
65
#define WORLD_MAX_HEIGHT        10000
 
66
#define WORLD_MAX_WIDTH         10000    //7000
 
67
#define WORLD_MAX_RESOLUTION    800
71
68
#else
72
 
        #define WORLD_MAX_HEIGHT        4096  // ordinary image
73
 
        #define WORLD_MAX_WIDTH         4096
74
 
        #define WORLD_MAX_RESOLUTION    400
 
69
#define WORLD_MAX_HEIGHT        4096  // ordinary image
 
70
#define WORLD_MAX_WIDTH         4096
 
71
#define WORLD_MAX_RESOLUTION    400
75
72
#endif
76
73
 
77
 
/*   Moved to evndefs.h - Paul 23.09.97
78
 
#define RASTER_MAX_HEIGHT       63
79
 
#define RASTER_MAX_WIDTH        128
80
 
*/
81
74
#define SMALL_SIZE              8
82
75
#define err_pnlet(c)  ((c))->nextl=((c))->prevl=(cell*)(0xffff0000);
83
 
// AL 900318
84
 
 
85
 
/*   Moved to evndefs.h - Paul 23.09.97
86
 
//-------------------- conectivity component ---------------------
87
 
 
88
 
struct mn_struc
89
 
 {
90
 
 void *mnfirstbox;              // address of the first box
91
 
 Int16 mncounter;     // number of living lines in the component
92
 
#define mnfree  mnfirstbox      // reference to next free main number
93
 
 Int16 mnupper;       // upper bound of component
94
 
 Int16 mnlower;       // lower bound of component
95
 
 Int16 mnboxcnt;      // number of boxes in component
96
 
#define usual_box_count 20      // heuristic of number of lines in a letter
97
 
#define great_box_count 200     // heuristic for number of boxes in a picture
98
 
 Word8 mnlines;                  // number of lines in the component
99
 
 Word8 mnbegs;             // number of free line begins
100
 
 Word8 mnends;                   // number of free line ends
101
 
 Word8 mnflag;                   // flag byte for main number
102
 
#define mnpicture 1             // component is a picture
103
 
 struct mn_struc *mnnext;       // address of next dead component
104
 
 };
105
 
typedef struct mn_struc MN;
106
 
*/
107
 
 
108
76
 
109
77
//------------------- The box has a header ----------------------
110
78
 
111
 
struct box_struct
112
 
 {
113
 
 struct box_struct *boxnext;    // chain address (zero if no next box)
114
 
 MN *               boxmain;    // component main number pointer
115
 
 Word16       boxptr;   // ptr to the empty place in the box
116
 
 Int16        boxleft;  // left boundary for line envelope
117
 
 Int16        boxright;   // right boundary for line envelope
118
 
 Int16        boxey;  // row of line end+1 ( if line ends within
119
 
                                //    box)
120
 
 Int16                boxel;  // length of the last segment (if line ends
121
 
                                //    within box)
122
 
 Int16              boxex;  // coordinate of last segment end (if line
123
 
                                //    ends within box)
124
 
 Word8         boxflag;  // byte for box attributes flags
125
 
 Word8       boxwf;  // working flag (for picture compress)
126
 
 Word16       boxresw;  // reserved word (for *4 arround)
127
 
 };
 
79
struct box_struct {
 
80
        struct box_struct *boxnext; // chain address (zero if no next box)
 
81
        MN * boxmain; // component main number pointer
 
82
        uint16_t boxptr; // ptr to the empty place in the box
 
83
        int16_t boxleft; // left boundary for line envelope
 
84
        int16_t boxright; // right boundary for line envelope
 
85
        int16_t boxey; // row of line end+1 ( if line ends within
 
86
        //    box)
 
87
        int16_t boxel; // length of the last segment (if line ends
 
88
        //    within box)
 
89
        int16_t boxex; // coordinate of last segment end (if line
 
90
        //    ends within box)
 
91
        uchar boxflag; // byte for box attributes flags
 
92
        uchar boxwf; // working flag (for picture compress)
 
93
        uint16_t boxresw; // reserved word (for *4 arround)
 
94
};
128
95
typedef struct box_struct BOX;
129
96
 
130
97
// Values of boxflag:
139
106
//      '00' - no information about begin/end in this box
140
107
#define BOXBEG          0x10    // line start not free
141
108
#define BOXEND          0x40    // line end not free
142
 
 
143
109
// BOX size
144
110
 
145
111
#define BOXHLTH (sizeof(BOX))   // the box header length
146
112
#define BOXSIZE (BOXHLTH+32*4)  // the length of box
147
113
#define BOXBOUNDARY (BOXSIZE-6) // the boundary control
148
 
 
149
 
struct ldescr_struct
150
 
 {
151
 
 Int16 y;   // y coord. of the first interval
152
 
 Int16 l;   // first interval length
153
 
 Int16 x;   // x coord. of the end of the first interval
154
 
 };
 
114
struct ldescr_struct {
 
115
        int16_t y; // y coord. of the first interval
 
116
        int16_t l; // first interval length
 
117
        int16_t x; // x coord. of the end of the first interval
 
118
};
155
119
typedef struct ldescr_struct LNSTRT;
156
120
 
157
 
struct box_interval
158
 
 {
159
 
 Int16 l;   // length of interval
160
 
 Int16 d;   // displacement of the end of the current interval relative
161
 
 };             //      to the previous
 
121
struct box_interval {
 
122
        int16_t l; // length of interval
 
123
        int16_t d; // displacement of the end of the current interval relative
 
124
}; //      to the previous
162
125
typedef struct box_interval BOXINT;
163
126
 
164
127
//-------------------- component in kit --------------------------
165
128
 
166
 
struct comp_struc
167
 
 {
168
 
 Word16 size;       // size of component in paragraphs >=3
169
 
 Int16 upper;   // upper boundary of component
170
 
 Int16 left;    // left boundary of component
171
 
 Int16 h;     // height of component
172
 
 Int16 w;           // width of component
173
 
 Word8 rw;               // raster width in bytes
174
 
 Word8 type;       // recognition type
 
129
struct comp_struc {
 
130
        uint16_t size; // size of component in paragraphs >=3
 
131
        int16_t upper; // upper boundary of component
 
132
        int16_t left; // left boundary of component
 
133
        int16_t h; // height of component
 
134
        int16_t w; // width of component
 
135
        uchar rw; // raster width in bytes
 
136
        uchar type; // recognition type
175
137
#define ch_perfect    1     // perfect type defined
176
138
#define ch_letter     2     // letter type
177
139
#define ch_dust       4     // dust type
180
142
#define ch_great     32     // great component
181
143
#define ch_merge     64     // merged components
182
144
#define ch_notltr   128     // not letter or punctuation
183
 
 Word8 cs;         // recognition case (see bellow)
184
 
 Word8 pidx;         // proportional index (ref.)
185
 
 Int16 nvers;   // number of alternative versions
186
 
 Int16 records;   // recognition records offset
187
 
 Int16 lines;   // ptr to line representation
188
 
 Int16 nl;    // number of lines
189
 
 Word8 begs;       // number of free begins
190
 
 Word8 ends;         // number of free ends
191
 
 Word8 reasno;           // proportional criteria messages
192
 
 Word8 large;    // large type
 
145
        uchar cs; // recognition case (see bellow)
 
146
        uchar pidx; // proportional index (ref.)
 
147
        int16_t nvers; // number of alternative versions
 
148
        int16_t records; // recognition records offset
 
149
        int16_t lines; // ptr to line representation
 
150
        int16_t nl; // number of lines
 
151
        uchar begs; // number of free begins
 
152
        uchar ends; // number of free ends
 
153
        uchar reasno; // proportional criteria messages
 
154
        uchar large; // large type
193
155
#define ch_underlined   1       // component was underlined
194
156
#define ch_taken        2       // taken to line at dust_ini
195
 
 Word8 scale;      // scale of the component
196
 
// union {
197
 
// Word8 stairs[4];                // bit_map for stairs_vector components
198
 
 struct comp_struc * next;
199
 
//       };
200
 
 };
 
157
        uchar scale; // scale of the component
 
158
        // union {
 
159
        // uchar stairs[4];                // bit_map for stairs_vector components
 
160
        struct comp_struc * next;
 
161
        //       };
 
162
};
201
163
typedef struct comp_struc c_comp;
202
164
 
203
165
//----------------------- cell ----------------------------------
204
166
 
205
167
#define VERS_IN_CELL 16 // Vald. 06-04-94
206
 
 
207
 
struct vers_struct      // versions with probabilities
208
 
 {
209
 
 Word8 let;    // character
210
 
 Word8 prob;   // probability
211
 
 };
 
168
struct vers_struct // versions with probabilities
 
169
{
 
170
        uchar let; // character
 
171
        uchar prob; // probability
 
172
};
212
173
typedef struct vers_struct version;
213
174
 
214
175
//-------------------- line representation ----------------------
219
180
//      After last line zero word
220
181
 
221
182
//      line header
222
 
struct ln_head
223
 
 {
224
 
 Int16 lth; // length of one line representation
225
 
 Int16 h;   // height of line
226
 
 Int16 row; // relative row of line start
227
 
 Word16 flg;  // flags of free beg and free end
 
183
struct ln_head {
 
184
        int16_t lth; // length of one line representation
 
185
        int16_t h; // height of line
 
186
        int16_t row; // relative row of line start
 
187
        uint16_t flg; // flags of free beg and free end
228
188
#define l_fbeg          0x20
229
189
#define l_fend          0x80
230
190
#define l_cbeg          0x02
231
191
#define l_cend          0x08
232
 
 };
 
192
};
233
193
typedef struct ln_head lnhead;
234
194
 
235
195
//      one interval
236
 
struct int_s
237
 
 {
238
 
 Word8 l;//Int16 l;  // length of interval
239
 
 Word8 e;//Int16 e;  // end of interval coordinates
240
 
 };
 
196
struct int_s {
 
197
        uchar l;//int16_t l;  // length of interval
 
198
        uchar e;//int16_t e;  // end of interval coordinates
 
199
};
241
200
typedef struct int_s interval;
242
201
 
243
 
struct large_int_s
244
 
 {
245
 
 Word16 l;  // length of interval
246
 
 Word16 e;  // end of interval coordinates
247
 
 };
 
202
struct large_int_s {
 
203
        uint16_t l; // length of interval
 
204
        uint16_t e; // end of interval coordinates
 
205
};
248
206
typedef struct large_int_s large_interval;
249
207
 
250
 
 
251
 
 
252
 
 
253
208
#endif
254
209
 
255