~ubuntu-branches/ubuntu/trusty/cuneiform/trusty

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rselstr/sources/src/chstr/addtocstr/puttocstr.cpp

  • 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:
63
63
 
64
64
/*----------------------------------------------------------------------------*/
65
65
 
66
 
//���������
 
66
//Настройки
67
67
 
68
68
 
69
69
int inf_let_h=10;
71
71
int min_let_h=2;
72
72
int inf_betw_str_h=10;
73
73
 
74
 
Int32 my_top;
75
 
Int32 my_left;
76
 
Int32 my_right;
77
 
Int32 my_bottom;
 
74
int32_t my_top;
 
75
int32_t my_left;
 
76
int32_t my_right;
 
77
int32_t my_bottom;
78
78
 
79
79
 
80
80
/*----------------------------------------------------------------------------*/
81
 
//���������
 
81
//Параметры
82
82
 
83
83
int     DPIX;
84
84
int     DPIY;
94
94
        return FALSE;
95
95
 
96
96
 
97
 
// LDPUMA_ConsoleN("�������������� CHSTR");
 
97
// LDPUMA_ConsoleN("Активизируется CHSTR");
98
98
 int TIME=clock();
99
99
 int code_strd=1;
100
 
 Int16* begx=NULL;
101
 
 Int16* movey=NULL;
 
100
 int16_t* begx=NULL;
 
101
 int16_t* movey=NULL;
102
102
 int* hi=NULL;
103
 
 Word8* flmovey=NULL;
 
103
 uchar* flmovey=NULL;
104
104
 
105
105
 MainWindowD=NULL;
106
 
 MainWindowD=LDPUMA_GetWindowHandle ("����������� ����� ���������");
 
106
 MainWindowD=LDPUMA_GetWindowHandle ("Изображение после разворота");
107
107
 if(!MainWindowD)
108
108
    MainWindowD=LDPUMA_GetWindowHandle ("Main");
109
109
 
122
122
 
123
123
 DPIX=info.DPIX;
124
124
 DPIY=info.DPIY;
125
 
 Word8 ImageName[CPAGE_MAXNAME];
126
 
// Word8 RotateImageName[CPAGE_MAXNAME];
 
125
 uchar ImageName[CPAGE_MAXNAME];
 
126
// uchar RotateImageName[CPAGE_MAXNAME];
127
127
 
128
128
 
129
129
 inf_str_h=inf_str_h*((int)(DPIY)+1)/300;
133
133
 min_let_w=min_let_w*((int)(DPIY)+1)/300;
134
134
 min_let_h=min_let_h*((int)(DPIY)+1)/300;
135
135
 
136
 
 Word8* pmaspold;
137
 
 Word8* pmasp;
138
 
 Word8 Data[1000];
 
136
 uchar* pmaspold;
 
137
 uchar* pmasp;
 
138
 uchar Data[1000];
139
139
 memset (Data, 0, sizeof (Data));
140
140
 
141
141
 
163
163
 
164
164
 InitPrepList(hCPage);
165
165
 
166
 
//�������� ���� �� ����������
 
166
//Основной цикл по фрагментам
167
167
 while(my_str!=NULL)
168
168
 {
169
169
  begx=NULL;
229
229
   int w=Rc.right-Rc.left+1;
230
230
   int h=Rc.bottom-Rc.top+1;
231
231
   pmasp=NULL;
232
 
   if(!(pmasp= new Word8[w*h/8+w+h]))
 
232
   if(!(pmasp= new uchar[w*h/8+w+h]))
233
233
   {
234
234
   // GF: killed memory leak on 2004.01.29
235
235
         DelStrMas(&pRc); pRc = NULL;
343
343
  Rect16* pN = NULL;
344
344
  CCOM_comp** pC;
345
345
  int nN=0;
346
 
  BOOL nomem=FALSE;
 
346
  Bool nomem=FALSE;
347
347
 
348
348
  int i;
349
349
 
350
 
  for(int i2=nRc-1;i2>=0;i2--)//���� �� ���-�� ����� � ���������
 
350
  for(int i2=nRc-1;i2>=0;i2--)//цикл по кол-ву строк в фрагменте
351
351
  {
352
352
   if(my_str->vertical==2)
353
353
           i=nRc-1-i2;
390
390
           continue;
391
391
 
392
392
   //for filter
393
 
   my_top=(Int32)Rc.top;
394
 
   my_bottom=(Int32)Rc.bottom;
395
 
   my_left=(Int32)Rc.left;
396
 
   my_right=(Int32)Rc.right;
 
393
   my_top=(int32_t)Rc.top;
 
394
   my_bottom=(int32_t)Rc.bottom;
 
395
   my_left=(int32_t)Rc.left;
 
396
   my_right=(int32_t)Rc.right;
397
397
 
398
398
   pcomp = CCOM_GetFirst(hStrCCOM,Filter);
399
399
 
486
486
   if(!j)
487
487
          continue;
488
488
 
489
 
//���������� � CSTR:
 
489
//Заполнение в CSTR:
490
490
 
491
491
   string=CSTR_NewLine(max_str,0,-1);
492
492
   if(string==NULL)
504
504
   scale=GetStrScale(pN,nN,my_str->vertical);
505
505
   if(CSTR_GetLineAttr(string,&attr))
506
506
   {
507
 
        attr.scale=(Word8)(scale);
 
507
        attr.scale=(uchar)(scale);
508
508
    attr.incline=skew;
509
509
    attr.fragment=my_str->m_num_frag;
510
510
        if(my_str->vertical)
603
603
        CSTR_DelRaster(rast);
604
604
        else
605
605
        {
606
 
            rast->env->scale=(Word8)(scale);
 
606
            rast->env->scale=(uchar)(scale);
607
607
        }
608
608
 
609
609
   }
627
627
  }
628
628
 
629
629
 
630
 
// ���������� �����
 
630
// Прорисовка строк
631
631
  if(!fl_rotate)
632
632
  {
633
633
   if(nRc>0)
691
691
 
692
692
 
693
693
 
694
 
BOOL StrGetRaster(Handle hCPage,Word8* ImageName,Rect16 N,CCOM_comp* comp,RecRaster* rec,BOOL vert,BOOL neg,int scale)
 
694
Bool StrGetRaster(Handle hCPage,uchar* ImageName,Rect16 N,CCOM_comp* comp,RecRaster* rec,Bool vert,Bool neg,int scale)
695
695
{
696
 
        //Andrey - 05.03.2003 - � ��������� RecRaster ������, ��� REC_MAX_RASTER_SIZE, �� ������
 
696
        //Andrey - 05.03.2003 - в структуру RecRaster больше, чем REC_MAX_RASTER_SIZE, не влезет
697
697
        if (comp->h*REC_GW_WORD8(((comp->w + (1<<comp->scale) - 1)>>comp->scale)) > REC_MAX_RASTER_SIZE)
698
698
                return FALSE;
699
699
 
700
700
 int i,j,k;
701
 
// Word8 Data[1000];
702
 
 Word8 bytep;
 
701
// uchar Data[1000];
 
702
 uchar bytep;
703
703
 int h=N.bottom-N.top+1;
704
704
 int w=N.right-N.left+1;
705
705
 int bytewide=(w)/8;
708
708
 int vbytewide=(h)/8;
709
709
 if( ((h)%8) != 0)
710
710
         vbytewide++;
711
 
 Word8 pmasp[REC_MAX_RASTER_SIZE];
 
711
 uchar pmasp[REC_MAX_RASTER_SIZE];
712
712
 for(i=REC_MAX_RASTER_SIZE-1;i>=0;i--)
713
713
         pmasp[i]=0;
714
714
/* memset (Data, 0, sizeof (Data));
875
875
}
876
876
 
877
877
 
878
 
void StrAr2(Word8* pmasp,int h,int w)
 
878
void StrAr2(uchar* pmasp,int h,int w)
879
879
{
880
880
 int i,j;
881
 
 Word8 bytep;
 
881
 uchar bytep;
882
882
 int newh=h/2;
883
883
 int neww=w/2;
884
884
 int newbytewide=(neww)/8;
940
940
}
941
941
 
942
942
 
943
 
BOOL MyRotateImage(Word8* ImageName,Word8* RotateImageName,int skew,Rect16* Rc,BOOL vertical,int code,MATRIX* rot,MATRIX* unrot)
 
943
Bool MyRotateImage(uchar* ImageName,uchar* RotateImageName,int skew,Rect16* Rc,Bool vertical,int code,MATRIX* rot,MATRIX* unrot)
944
944
{
945
945
 int w;
946
946
 int own_skew=skew;
947
947
 int time;
948
 
 Word32 use_marg;
 
948
 uint32_t use_marg;
949
949
 if(vertical)
950
950
         w=Rc->bottom-Rc->top+1;
951
951
 else
971
971
         return FALSE;
972
972
 }
973
973
 LDPUMA_ConsoleN("Time rotate=%d",clock()-time);
974
 
 Int32 x;
975
 
 Int32 y;
 
974
 int32_t x;
 
975
 int32_t y;
976
976
 RIMAGE_RotatePoint(RotateImageName,Rc->left,Rc->top,&x,&y);
977
 
 Rc->left=(Int16)(x);
978
 
 Rc->top=(Int16)(y);
 
977
 Rc->left=(int16_t)(x);
 
978
 Rc->top=(int16_t)(y);
979
979
 RIMAGE_RotatePoint(RotateImageName,Rc->right,Rc->bottom,&x,&y);
980
 
 Rc->right=(Int16)(x);
981
 
 Rc->bottom=(Int16)(y);
 
980
 Rc->right=(int16_t)(x);
 
981
 Rc->bottom=(int16_t)(y);
982
982
 
983
983
 return TRUE;
984
984
}
985
985
 
986
 
void InitRotateImageName(Word8* RotateImageName,Word8* ImageName)
 
986
void InitRotateImageName(uchar* RotateImageName,uchar* ImageName)
987
987
{
988
988
        for(int i=0;i<CPAGE_MAXNAME;i++)
989
989
                RotateImageName[i]=ImageName[i];
990
990
}
991
991
 
992
 
void InitRotateImageName(Word8* RotateImageName,int code)
 
992
void InitRotateImageName(uchar* RotateImageName,int code)
993
993
{
994
994
        RotateImageName[0]='C';
995
995
        RotateImageName[1]='H';
1026
1026
        RotateImageName[num]='\0';
1027
1027
}
1028
1028
 
1029
 
void GetRasterRect(Word8* UnRotateImageName,Rect16 N,Rect16* Rc,CSTR_attr* attr,BOOL fl_rotate)
 
1029
void GetRasterRect(uchar* UnRotateImageName,Rect16 N,Rect16* Rc,CSTR_attr* attr,Bool fl_rotate)
1030
1030
{
1031
1031
 int top;
1032
1032
 int bottom;
1033
1033
 
1034
1034
 if(fl_rotate)
1035
1035
 {
1036
 
         Int32 x;
1037
 
         Int32 y;
 
1036
         int32_t x;
 
1037
         int32_t y;
1038
1038
  RIMAGE_RotatePoint(UnRotateImageName,N.left,N.top,&x,&y);
1039
 
  Rc->top=(Int16)(y);
1040
 
  Rc->left=(Int16)(x);
 
1039
  Rc->top=(int16_t)(y);
 
1040
  Rc->left=(int16_t)(x);
1041
1041
  RIMAGE_RotatePoint(UnRotateImageName,N.right,N.bottom,&x,&y);
1042
 
  Rc->right=(Int16)(x);
1043
 
  Rc->bottom=(Int16)(y);
 
1042
  Rc->right=(int16_t)(x);
 
1043
  Rc->bottom=(int16_t)(y);
1044
1044
 }
1045
1045
 else
1046
1046
 {
1070
1070
}
1071
1071
 
1072
1072
 
1073
 
int GetStrScale(Rect16* pRc,int nRc,BOOL vertical)
 
1073
int GetStrScale(Rect16* pRc,int nRc,Bool vertical)
1074
1074
{
1075
1075
        int max_scale=0;
1076
1076
        int now_scale=0;
1088
1088
 return max_scale;
1089
1089
}
1090
1090
 
1091
 
BOOL InitRotateMas(Rect16 Rc,Int16** ppbegx,Int16** ppmovey,Word8** ppflmovey)
 
1091
Bool InitRotateMas(Rect16 Rc,int16_t** ppbegx,int16_t** ppmovey,uchar** ppflmovey)
1092
1092
{
1093
1093
        int w=Rc.right-Rc.left+1;
1094
1094
        int h=Rc.bottom-Rc.top+1;
1095
 
        if(!( (*ppbegx)=new Int16[h+1]))
 
1095
        if(!( (*ppbegx)=new int16_t[h+1]))
1096
1096
                return FALSE;
1097
 
        if(!( (*ppmovey)=new Int16[w+1]))
 
1097
        if(!( (*ppmovey)=new int16_t[w+1]))
1098
1098
        {
1099
1099
                delete[] (*ppbegx);
1100
1100
                (*ppbegx)=NULL;
1101
1101
                return FALSE;
1102
1102
        }
1103
 
        if(!( (*ppflmovey)=new Word8[w+1]))
 
1103
        if(!( (*ppflmovey)=new uchar[w+1]))
1104
1104
        {
1105
1105
                delete[] (*ppbegx);
1106
1106
                (*ppbegx)=NULL;
1111
1111
        return TRUE;
1112
1112
}
1113
1113
 
1114
 
BOOL InitRotateMas(int** pphi,int n)
 
1114
Bool InitRotateMas(int** pphi,int n)
1115
1115
{
1116
1116
        if(!( (*pphi)=new int[n]))
1117
1117
                return FALSE;
1119
1119
            return TRUE;
1120
1120
}
1121
1121
 
1122
 
void DeleteRotateMas(Int16* pbegx,Int16* pmovey,Word8* pflmovey,int* phi)
 
1122
void DeleteRotateMas(int16_t* pbegx,int16_t* pmovey,uchar* pflmovey,int* phi)
1123
1123
{
1124
1124
        delete[] pbegx;
1125
1125
        pbegx=NULL;