~ubuntu-branches/ubuntu/precise/cuneiform/precise

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/dif/src/stick.h

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk, c-assert.diff, slovenian-slv.diff
  • Date: 2011-01-26 21:53:07 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110126215307-62x61mcesr607qb7
Tags: 1.0.0+dfsg-2
* Upload to unstable.
* Explicitly build-depend on pkg-config. Thanks to Stefano Rivera for the
  bug report.
* Add Vcs-* fields.
* Use the standard C assert() macro, rather than custom Cuneiform one.
  [c-assert.diff]
* Pass CFLAGS, CXXFLAGS and LDFLAGS (get from dpkg-buildflags) to cmake
  (closes: #608345). Thanks to Sami Liedes for the bug report.
  + Build depend on dpkg-dev (>= 1.15.7).
* Pass --parallel to dh.
  + Bump debhelper minimum version to 7.4.10.
* Update debian/copyright to the latest DEP-5 version.
* Bump year in debian/copyright.
* Explicitly link to GraphicsMagick (rather than via the ImageMagick
  compatibility layer).
* Don't ship /usr/lib/cuneiform/*.so symlinks. These libraries are
  considered private, at least until #598616 is fixed.
* Rename some private variables in debian/rules to make them lowercase.
* Update patch headers.
* Provide proper ‘build-arch’ and ‘build-indep’ targets in debian/rules.
* Document input format in the manual page (closes: #572061). Thanks to
  Janusz S. Bień for the bug report.
* Use ‘slv’ (rather than ‘slo’) as language code for Slovenian.
  [slovenian-slv.diff]
* Fix package description: Slovenian is supported, Slovak is not.
* Improve documentation of the language (-l) option (closes: #602512).
  Thanks to Jari Aalto for the bug report.
* Install reasons file for vrms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 1993-2008, Cognitive Technologies
3
3
All rights reserved.
4
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
 
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
 
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
32
 
33
33
Redistribution and use in source and binary forms, with or without modification,
34
34
are permitted provided that the following conditions are met:
64
64
#define LIMIT_CENTER     LIMIT_HEIGHT*3
65
65
#define LIMIT_OF_ANGLES  8
66
66
/*----------------------------------------------------------------------*/
67
 
typedef struct { Int16 row,  /* row in c_comp */
 
67
typedef struct { int16_t row,  /* row in c_comp */
68
68
                     col,  /* column * 2  */
69
69
                     len;  /* length      */
70
70
                } center_interval;
71
71
/*----------------------------------------------------------------------*/
72
72
typedef struct                                          // l->xxx, r->xxx;
73
73
        {
74
 
  Word8
 
74
  uchar
75
75
                mount[5],   /* max flag in any zone. 0 - no flag        */
76
76
                conc[5],    /* max concave in any zone. 0 - no concave  */
77
77
                m_pos[5],   /* position of max flag in zone. 0-if no flag */
95
95
/*----------------------------------------------------------------------*/
96
96
typedef struct                                                  // s->xxx;
97
97
        {
98
 
  Int16     height,   // height of c_comp
 
98
  int16_t     height,   // height of c_comp
99
99
                width ,         // width  of c_comp
100
100
                base_2,         // second base line
101
101
                base_3,         // third  base line
102
102
                base_2mk,       // MK EDITION of SECOND,
103
103
                base_3mk,       // THIRD,
104
104
                base_4mk;       // and FOURTH base lines        03.01.1994
105
 
  Word8
 
105
  uchar
106
106
                l_f_symptom,    // special signums for letter 'f'
107
107
                r_f_symptom,    // l:0,1,2,3 ; r : 0,1,2
108
108
                t_TOP,          // t^ or t~;
111
111
                lll_nose_1,     // MK: FLAT VERT part of NOSE >= 3
112
112
                dis_slash,      // diskrim letter '/'
113
113
                dis_left_brace, dis_right_brace,        // dis '(',')'
114
 
//////          dis_OxBA,       // diskrim � for his head
115
 
                dis_0xBA,       // diskrim � for his head
 
114
//////          dis_OxBA,       // diskrim є for his head
 
115
                dis_0xBA,       // diskrim є for his head
116
116
                neck,           // sign neck overlay base line 2
117
117
                T_config,       // similar 'T' (for Y-diskrim)
118
118
//////          Y_config,       // similar 'Y' (for T-diskrim)
134
134
                up_dot_H,       // Hight of DOT (0 - NO DOT !)
135
135
    down_nose_1, // special for 1 : nose belong central zone
136
136
    up_dot_W; // Width of DOT
137
 
  Int8
 
137
  char
138
138
                inc_num,        // 10.12.1993 (from inc_num_EEM)
139
139
                up_dot_dCOL;    // Displacement of DOT (use col)
140
 
  Word8    num_lines;      /* Number of with none single interval  */
141
 
  Int16 incline;  /* Normal tg(stick)*2048 + line_incline */
 
140
  uchar    num_lines;      /* Number of with none single interval  */
 
141
  int16_t incline;  /* Normal tg(stick)*2048 + line_incline */
142
142
        } STICK_SIGNUMS;        // auxiliary information for
143
143
                                // stick diskrimination
144
144
/*----------------------------------------------------------------------*/
145
145
typedef struct
146
146
        {
147
 
  Int16 tg;             /* tg = tangens*2048  */
148
 
  Int16 num;      /* 15.11.1993 MK NEW  */
149
 
  Int16 inc[256];       /* table of inc       */
 
147
  int16_t tg;             /* tg = tangens*2048  */
 
148
  int16_t num;      /* 15.11.1993 MK NEW  */
 
149
  int16_t inc[256];       /* table of inc       */
150
150
        } INC_BASE;         /* base tables of inc */
151
151
/*----------------------------------------------------------------------*/
152
152
#define ADD_PROB(c) (c->nvers ? (c->vers[0].prob - 4) : 254 )
153
153
 
154
154
struct ln_head
155
155
 {
156
 
 Int16  lth; // length of one line representation
157
 
 Int16  h;   // height of line
158
 
 Int16  row; // relative row of line start
159
 
 Word16 flg;  // flags of free beg and free end
 
156
 int16_t  lth; // length of one line representation
 
157
 int16_t  h;   // height of line
 
158
 int16_t  row; // relative row of line start
 
159
 uint16_t flg;  // flags of free beg and free end
160
160
#define l_fbeg          0x20
161
161
#define l_fend          0x80
162
162
#define l_cbeg          0x02
166
166
 
167
167
struct int_s
168
168
 {
169
 
 Word8 l;  // length of interval
170
 
 Word8 e;  // end of interval coordinates
 
169
 uchar l;  // length of interval
 
170
 uchar e;  // end of interval coordinates
171
171
 };
172
172
typedef struct int_s interval;
173
173
 
174
174
#define DIS_CENTER_FLAG(U,i,width,inc,t1,t2)             \
175
 
  { Int16 t,dist=1;                                  \
 
175
  { int16_t t,dist=1;                                  \
176
176
        t = U->mount[i];                                 \
177
177
        if( U->mount[0]>width || U->mount[4]>width )     \
178
178
                dist++;                                  \
197
197
 
198
198
#define DIS_DIFFERENT_SERIFS(L,R,i,dist,wid,tab)      \
199
199
        {                                             \
200
 
        Int16 t,m;                                      \
 
200
        int16_t t,m;                                      \
201
201
        t =  abs(L->mount[i]-R->mount[i]) ;           \
202
202
        m =  MIN(L->mount[i],R->mount[i]) ;           \
203
203
        if( t>MAX(((wid)>>1),dist) || m==0 )          \
206
206
 
207
207
#define DIS_DIFFERENT_SERIFS(L,R,i,dist,wid,tab)      \
208
208
        {                                             \
209
 
        Int16 t,m;                                      \
 
209
        int16_t t,m;                                      \
210
210
        t =  abs(L->mount[i]-R->mount[i]) ;           \
211
211
        m =  MIN(L->mount[i],R->mount[i]) ;           \
212
212
        if( t>MAX(((wid)>>1),dist) || m==0 )          \
247
247
                }
248
248
 
249
249
#define DIS_CENTER_CONC(U,i,inc,t1,t2)              \
250
 
        { Int16 t,m;                                  \
 
250
        { int16_t t,m;                                  \
251
251
        m = ((U->up_serif==0)&&(U->down_serif==0)); \
252
252
        t = U->conc[i];                             \
253
253
        if( t>1 )                                   \
297
297
 
298
298
#define DIS_CURVE(L,R,i,lev,tab)                   \
299
299
        {                                          \
300
 
        Int16 ll,rr;                                 \
 
300
        int16_t ll,rr;                                 \
301
301
        ll=L->mount[i]; rr=R->conc[i];             \
302
302
        if( ll>lev && rr>lev && (ll>0||rr>0) )     \
303
303
                dis += (ll+rr)*(tab);              \
316
316
#define LF 80   /* long central flag    */
317
317
#define NF 12   /* small central flag   */
318
318
#define MD  4   /* min dis value        */
319
 
#define SI 20   /* similar  �           */
 
319
#define SI 20   /* similar  є           */
320
320
#define BP 80   /* bad proportions      */
321
321
#define ST 80   /* similar  't'         */
322
322
#define BR 40   /* similar  braces      */
323
 
#define BR_i 0  /* similar  braces for case letter 'i' with point {�} */
 
323
#define BR_i 0  /* similar  braces for case letter 'i' with point {ш} */
324
324
#define DB 70   /* auxiliary beam       */
325
325
#endif
326
326