2
Copyright (c) 1993-2008, Cognitive Technologies
5
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
8
* ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
���� ����������� �� ��������� �����, ���� ������ ������� � �����������
11
* ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
������ ����������, ������������ ��� ���������������, ������ �����������
13
��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
����������� ����� �� ��������.
15
* �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
���� ������������ � �������� �������� ��������� �/��� �����������
17
���������, ���������� �� ���� ��, ��� ���������������� �����������
20
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
������������� ������, ��������� � �������������� ��� ���������� ����������
27
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
33
Redistribution and use in source and binary forms, with or without modification,
34
are permitted provided that the following conditions are met:
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.
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.
2
Copyright (c) 1993-2008, Cognitive Technologies
5
Разрешается повторное распространение и использование как в виде исходного кода,
6
так и в двоичной форме, с изменениями или без, при соблюдении следующих условий:
8
* При повторном распространении исходного кода должны оставаться указанное
9
выше уведомление об авторском праве, этот список условий и последующий
11
* При повторном распространении двоичного кода в документации и/или в
12
других материалах, поставляемых при распространении, должны сохраняться
13
указанная выше информация об авторском праве, этот список условий и
14
последующий отказ от гарантий.
15
* Ни название Cognitive Technologies, ни имена ее сотрудников не могут
16
быть использованы в качестве средства поддержки и/или продвижения
17
продуктов, основанных на этом ПО, без предварительного письменного
20
ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ ЛИЦАМИ "КАК
21
ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ,
22
ВКЛЮЧАЯ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ, НО НЕ
23
ОГРАНИЧИВАЯСЬ ИМИ. НИ ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО ДРУГОЕ ЛИЦО, КОТОРОЕ
24
МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, НИ В КОЕМ СЛУЧАЕ НЕ
25
НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, СПЕЦИАЛЬНЫЕ ИЛИ
26
ПОСЛЕДОВАВШИЕ УБЫТКИ, СВЯЗАННЫЕ С ИСПОЛЬЗОВАНИЕМ ИЛИ ПОНЕСЕННЫЕ ВСЛЕДСТВИЕ
27
НЕВОЗМОЖНОСТИ ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ ПОТЕРИ ДАННЫХ, ИЛИ ДАННЫЕ,
28
СТАВШИЕ НЕГОДНЫМИ, ИЛИ УБЫТКИ И/ИЛИ ПОТЕРИ ДОХОДОВ, ПОНЕСЕННЫЕ ИЗ-ЗА ДЕЙСТВИЙ
29
ТРЕТЬИХ ЛИЦ И/ИЛИ ОТКАЗА ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ,
30
НО НЕ ОГРАНИЧИВАЯСЬ ЭТИМИ СЛУЧАЯМИ), НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ДАЖЕ ЕСЛИ ТАКОЙ
31
ВЛАДЕЛЕЦ ИЛИ ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ И ПОТЕРЬ.
33
Redistribution and use in source and binary forms, with or without modification,
34
are permitted provided that the following conditions are met:
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.
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.
57
57
#ifndef H_cstrdef_h
58
58
#define H_cstrdef_h
60
60
#include "recdefs.h"
61
61
#include "ccomdefs.h"
63
62
#pragma pack (push,8)
64
63
#define DEBUG_MODE 1
104
101
#define CSTR_STR_NEGATIVE 0x00008000
105
102
#define CSTR_STR_UPDOWN 0x00010000
106
103
#define CSTR_STR_DOWNUP 0x00020000
107
#define CSTR_STR_END_POINTED 0x00040000//� ����� ������ ������� �����
108
#define CSTR_STR_BEGIN_POINTED 0x00080000//� ������ ������ ������� �����
110
Int16 bs1, bs2, bs3, bs4;
111
Int16 Nb1, Nb2, Nb3, Nb4;
112
Int16 Nbt, bsm, Ps, Psf;
113
Word8 VersionName[16] ; // Nick 20.02.2001 from 36 vto 16
114
Int16 tab_row; // Nick 20.02.2001
115
Int16 ref_father; // ��������� ������
116
Int16 ref_nSon; // Nick 22.05.2001
118
Word8 reserve[12]; // Nick 22.05.
124
Int16 l_hei, l_wid,erection;
135
Word8 cn_weight; // due to car numbers recognition
136
// align to 128 bytes
141
typedef struct strucCSTR_rast_attr{
142
Int16 row; // ideal row of cell
143
Int16 col; // ideal collumn of cell
145
Int16 h; // height of cell
146
Int16 w; // width of cell
148
Int8 bdiff; // local base line corrective displacement
149
Word8 difflg; // local correction flg
150
// baseline defined by cell:
104
#define CSTR_STR_END_POINTED 0x00040000//в конце строки имеются точки
105
#define CSTR_STR_BEGIN_POINTED 0x00080000//в начале строки имеются точки
106
int16_t bs1, bs2, bs3, bs4;
107
int16_t Nb1, Nb2, Nb3, Nb4;
108
int16_t Nbt, bsm, Ps, Psf;
109
uchar VersionName[16]; // Nick 20.02.2001 from 36 vto 16
110
int16_t tab_row; // Nick 20.02.2001
111
int16_t ref_father; // параметры формул
112
int16_t ref_nSon; // Nick 22.05.2001
114
uchar reserve[12]; // Nick 22.05.
115
int16_t pageSkew2048;
120
int16_t l_hei, l_wid, erection;
131
uchar cn_weight; // due to car numbers recognition
132
// align to 128 bytes
135
typedef struct strucCSTR_rast_attr {
136
int16_t row; // ideal row of cell
137
int16_t col; // ideal collumn of cell
139
int16_t h; // height of cell
140
int16_t w; // width of cell
142
char bdiff; // local base line corrective displacement
143
uchar difflg; // local correction flg
144
// baseline defined by cell:
151
145
#define CSTR_db_b1 1
152
146
#define CSTR_db_b2 2
153
147
#define CSTR_db_b3 4
215
209
#define CSTR_fp_str 32 // stright
216
210
#define CSTR_fp_undrln 64 // underlined
217
211
#define CSTR_fp_narrow 128 // user defined
218
Word8 dens; // BOX - calculated density
219
Word8 recsource; // who and how recognized
212
uchar dens; // BOX - calculated density
213
uchar recsource; // who and how recognized
220
214
#define CSTR_rs_ev 1 // events brought versions
221
215
#define CSTR_rs_BOX 2 // BOX done
222
216
#define CSTR_rs_BOXs 4 // BOX > "29500"
223
217
#define CSTR_rs_bitcmp 8 // bit compare takes versions
224
218
#define CSTR_rs_LEO 64 // LEO
225
Word8 bas_acc; // cell's relations with bases
219
uchar bas_acc; // cell's relations with bases
226
220
#define CSTR_ba_b1 1 // accepted to b1
227
221
#define CSTR_ba_b2 2 // accepted to b2
228
222
#define CSTR_ba_killed 4 // temporary: all versions killed by linear
229
223
#define CSTR_ba_penalty 8
230
224
#define CSTR_ba_chance 16 // one more chance for cut version
232
Int16 left; // left of main part (without accent)
233
Int16 right; // right of main part (without accent)
226
int16_t left; // left of main part (without accent)
227
int16_t right; // right of main part (without accent)
236
230
#define CSTR_shp_cap 1
237
231
#define CSTR_shp_stick 2
238
232
#define CSTR_shp_stb1 4
239
233
#define CSTR_shp_small 8
240
234
#define CSTR_shp_dbh 32
241
235
#define CSTR_shp_b1up 16
242
Word8 rus_eng_word; // information for RUS/ENG manipulations
236
uchar rus_eng_word; // information for RUS/ENG manipulations
243
237
#define CSTR_ruseng_no 0 // russian
244
238
#define CSTR_ruseng_rus 0 // russian
245
239
#define CSTR_ruseng_re 1 // russian or english
246
240
#define CSTR_ruseng_eng 2 // english
247
241
#define CSTR_ruseng_alt 3 // many alternates
248
Word8 broken_II; // II configuration
242
uchar broken_II; // II configuration
252
246
#define CSTR_erect_no 0 // really envelop
253
247
#define CSTR_erect_rot 1 // rotate image
254
248
#define CSTR_erect_rest 2 // restore after rotating
344
337
#define CSTR_fn_stop 0x00001000 // stop cell marked
345
338
#define CSTR_fn_space 0x00002000 // need convert to space ' '
346
339
#define CSTR_fn_taken 0x00004000 // was taken from dust
351
Word8 bottom_accent; // need save in Rbal
353
Word8 reserve[25] ; // for next special flags, aling to 128
357
typedef struct strucCSTR_cell{
358
CSTR_rast_attr attr ;
359
struct strucCSTR_cell * next ;
360
struct strucCSTR_cell * prev ;
361
struct strucCSTR_cell * dup ;
366
struct strucCSTR_cell * complist ;
369
struct strucCSTR_cell * prev_down ;
370
CCOM_USER_BLOCK * user_block ;
371
struct strucCSTR_cell * dupend ;
372
struct strucCSTR_cell * prev_up ;
373
struct strucCSTR_cell * next_up ;
374
struct strucCSTR_cell * next_down ;
344
uchar bottom_accent; // need save in Rbal
346
uchar reserve[25]; // for next special flags, aling to 128
349
typedef struct strucCSTR_cell {
351
struct strucCSTR_cell * next;
352
struct strucCSTR_cell * prev;
353
struct strucCSTR_cell * dup;
358
struct strucCSTR_cell * complist;
361
struct strucCSTR_cell * prev_down;
362
CCOM_USER_BLOCK * user_block;
363
struct strucCSTR_cell * dupend;
364
struct strucCSTR_cell * prev_up;
365
struct strucCSTR_cell * next_up;
366
struct strucCSTR_cell * next_down;
377
typedef struct _strucCSTR_head{
379
CCOM_handle container ;
380
Bool32 private_container ;
369
typedef struct _strucCSTR_head {
371
CCOM_handle container;
372
Bool32 private_container;
382
374
#define CSTR_LN_NO 0x00000000
383
375
#define CSTR_LN_FICT 0x00000001
390
struct _strucCSTR_head *prev, *next,*next_fragm_line;
381
struct _strucCSTR_head *prev, *next, *next_fragm_line;
394
384
#define CSTR_TYPE_IMAGE_NO 0 // no type
395
385
#define CSTR_TYPE_IMAGE_LP 1 // linerepresentation
396
386
#define CSTR_TYPE_IMAGE_RS 2 // RecRaster
397
387
#define CSTR_TYPE_IMAGE_RS1 3 // B/W bitmap aligned to 1 byte
399
388
#ifdef DEBUG_MODE
401
390
typedef struct strucCSTR_cell * CSTR_rast;
404
typedef Int32 CSTR_rast;
393
typedef int32_t CSTR_rast;
407
396
#define CSTR_ANSI_CHARSET 0