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

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rpic/sources/rpic.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:
156
156
////////////////////////////////////////////////////////////////////////////////
157
157
Bool32 LastCheck(Handle hCCOM, Handle hCCOM_big,Handle hCPAGE)
158
158
{
159
 
        Word32 i,j;
 
159
        uint32_t i,j;
160
160
        CCOM_comp pic;
161
161
        CCOM_comp * comp;
162
 
        Word16 pLocalHystogram[MaxHeightOfLetter];
163
 
        Word32 nLocalComps;
164
 
        Word32 MaxLocal, nMaxLocal;
165
 
        Word32 Result1, Result2;
 
162
        uint16_t pLocalHystogram[MaxHeightOfLetter];
 
163
        uint32_t nLocalComps;
 
164
        uint32_t MaxLocal, nMaxLocal;
 
165
        uint32_t Result1, Result2;
166
166
 
167
167
        for(i=0; i<nPics; i++)
168
168
        {
290
290
 
291
291
 
292
292
////////////////////////////////////////////////////////////////////////////////
293
 
Bool32 DeleteFromPics(Word32 position)
 
293
Bool32 DeleteFromPics(uint32_t position)
294
294
{
295
295
        /*
296
 
        Word32 i;
 
296
        uint32_t i;
297
297
 
298
298
        for(i=position;i<nPics-1;i++)
299
299
        {
309
309
////////////////////////////////////////////////////////////////////////////////
310
310
 
311
311
////////////////////////////////////////////////////////////////////////////////
312
 
Bool32 MyFiltrateIn (Int32 upper, Int32 left, Int32 w, Int32 h)
 
312
Bool32 MyFiltrateIn (int32_t upper, int32_t left, int32_t w, int32_t h)
313
313
{
314
314
        if( (upper<=my_upper) ||
315
315
                (left<=my_left) ||
360
360
        CCOM_comp common;
361
361
        PAGEINFO                        pInfo;
362
362
        POLY_ block;
363
 
        Word32 i,j;
 
363
        uint32_t i,j;
364
364
 
365
365
        Rect16 rect;
366
 
        Word32 key;
367
 
        Word32 color;
368
 
        Word32 tmp_comp=0;
 
366
        uint32_t key;
 
367
        uint32_t color;
 
368
        uint32_t tmp_comp=0;
369
369
 
370
370
        Handle MainWindowD=NULL;
371
 
    MainWindowD=LDPUMA_GetWindowHandle ("����������� ����� ���������");
 
371
    MainWindowD=LDPUMA_GetWindowHandle ("Изображение после разворота");
372
372
    if(!MainWindowD)
373
373
       MainWindowD=LDPUMA_GetWindowHandle ("Main");
374
374
 
400
400
 
401
401
        if((pInfo.Angle == 90)||(pInfo.Angle == 270))
402
402
        {
403
 
                Word32 tmp;
 
403
                uint32_t tmp;
404
404
                tmp = pInfo.Width;
405
405
                pInfo.Width = pInfo.Height;
406
406
                pInfo.Height = tmp;
500
500
 
501
501
        if(!LDPUMA_Skip(hShowAllCancelledGreat))
502
502
        {
503
 
                LDPUMA_Console("RPIC_���������� ������� ���������� \n");
 
503
                LDPUMA_Console("RPIC_Отмененные большие компоненты \n");
504
504
                LDPUMA_WaitUserInput(hShowAllCancelledGreat, MainWindowD);
505
505
                LDPUMA_DeleteRects(MainWindowD, key);
506
506
        }
589
589
                        rect.bottom = pPics[i].upper + pPics[i].h;
590
590
                        LDPUMA_DrawRect(MainWindowD, &rect, 0, color, 2, key);
591
591
                }
592
 
                LDPUMA_Console("RPIC_��������������� ������� ���������� \n");
 
592
                LDPUMA_Console("RPIC_Рассматриваемые большие компоненты \n");
593
593
                LDPUMA_WaitUserInput(hShowAllGreat,MainWindowD);
594
594
                LDPUMA_DeleteRects(MainWindowD, key);
595
595
        }
596
596
 
597
597
        //sprintf(tmp_str, "Amount of 'letters' on the first step %i (nComps)\n", nComps);
598
598
        //LDPUMA_FPuts(logFile_comp,tmp_str);
599
 
        //sprintf(tmp_str, "  <2 � �������� = %d \n", page_count++);
 
599
        //sprintf(tmp_str, "  <2 Н Страница = %d \n", page_count++);
600
600
        //LDPUMA_FPuts(resFile_comp,tmp_str);
601
601
 
602
602
        //char* str;
603
603
        //str = LDPUMA_GetFileName(NULL);
604
604
 
605
 
        LDPUMA_FPuts(resFile_comp, "  <2 � �������� =");
 
605
        LDPUMA_FPuts(resFile_comp, "  <2 Н Страница =");
606
606
        LDPUMA_FPuts(resFile_comp, file_name);
607
607
        LDPUMA_FPuts(resFile_comp, " \n");
608
 
        //LDPUMA_FPuts(resFile_comp, "  <2 � �������� \n");
609
 
        LDPUMA_FPuts(resFile_comp, "  <3 � ���������� \n");
610
 
        sprintf(tmp_str, "  <4 � ����� ���������� ����� \n", nComps);
 
608
        //LDPUMA_FPuts(resFile_comp, "  <2 Н Страница \n");
 
609
        LDPUMA_FPuts(resFile_comp, "  <3 Н Компоненты \n");
 
610
        sprintf(tmp_str, "  <4 П Перед выделением линий \n", nComps);
611
611
        LDPUMA_FPuts(resFile_comp,tmp_str);
612
 
        sprintf(tmp_str, "  <4 � %d \n", nComps);
 
612
        sprintf(tmp_str, "  <4 Р %d \n", nComps);
613
613
        LDPUMA_FPuts(resFile_comp, tmp_str);
614
614
        sprintf(tmp_str, "Amount of pictures on the before first step %i (nPics)\n", nPics);
615
615
        LDPUMA_FPuts(logFile_comp,tmp_str);
716
716
 
717
717
        LastCheck( hCCOM,hCCOM_big, hCPAGE);
718
718
 
719
 
        LDPUMA_FPuts(resFile_pict, "  <2 � �������� =");
 
719
        LDPUMA_FPuts(resFile_pict, "  <2 Н Страница =");
720
720
        LDPUMA_FPuts(resFile_pict, file_name);
721
721
        LDPUMA_FPuts(resFile_pict, " \n");
722
 
        LDPUMA_FPuts(resFile_pict, "  <3 � �������� \n");
723
 
        LDPUMA_FPuts(resFile_pict, "  <4 � ����� ������� ������� \n");
724
 
        sprintf(tmp_str, "  <4 � %d %d %d \n", nPics,0 ,0);
 
722
        LDPUMA_FPuts(resFile_pict, "  <3 Н Картинки \n");
 
723
        LDPUMA_FPuts(resFile_pict, "  <4 Н После первого прохода \n");
 
724
        sprintf(tmp_str, "  <4 Р %d %d %d \n", nPics,0 ,0);
725
725
        LDPUMA_FPuts(resFile_pict, tmp_str);
726
726
 
727
 
        Int32 min_image_width = (Int32)(100*((double)(pInfo.DPIX + 1)/300));
728
 
        Int32 min_image_height = (Int32)(100*((double)(pInfo.DPIY + 1)/300));
 
727
        int32_t min_image_width = (int32_t)(100*((double)(pInfo.DPIX + 1)/300));
 
728
        int32_t min_image_height = (int32_t)(100*((double)(pInfo.DPIY + 1)/300));
729
729
 
730
730
        for(i=0;i<nPics;i++)
731
731
        {
733
733
                {
734
734
                        continue;
735
735
                }
736
 
                block.com.type = TYPE_TEXT;//�����, ��������, �������;
737
 
                block.com.number = 0;//���������� �����
 
736
                block.com.type = TYPE_TEXT;//Текст, Картинка, Таблица;
 
737
                block.com.number = 0;//порядковый номер
738
738
                block.com.Color = 0;
739
739
                block.com.count = 4;
740
740
                block.com.Flags = 0;
748
748
                block.com.Vertex[3].y = pPics[i].upper + pPics[i].h;
749
749
                block.alphabet = 0;
750
750
 
751
 
                sprintf(tmp_str, "  <4 � 1 %4d %4d %4d %4d %d \n",
 
751
                sprintf(tmp_str, "  <4 О 1 %4d %4d %4d %4d %d \n",
752
752
                        pPics[i].left, pPics[i].upper, pPics[i].left + pPics[i].w, pPics[i].upper, pPics[i].h);
753
753
                LDPUMA_FPuts(resFile_pict,tmp_str);
754
754
 
763
763
        }
764
764
 
765
765
 
766
 
        LDPUMA_FPuts(resFile_pict, "  <4 � ����� ������� ������� \n");
 
766
        LDPUMA_FPuts(resFile_pict, "  <4 К После первого прохода \n");
767
767
        sprintf(tmp_str, "Amount of comps on the first step %i (tmp_comp) \n", tmp_comp);
768
768
        LDPUMA_FPuts(logFile_comp,tmp_str);
769
769
        sprintf(tmp_str, "Amount of pictures on the first step %i (nPics) \n", nPics);
793
793
         {
794
794
          nPics++;
795
795
          CPAGE_GetBlockData(hCPAGE,h,TYPE_IMAGE, &block, sizeof(block));
796
 
       rect.left =(Int16)(block.com.Vertex[0].x);
797
 
           rect.top =(Int16)(block.com.Vertex[0].y);
798
 
           rect.right =(Int16)(block.com.Vertex[1].x);
799
 
           rect.bottom =(Int16)(block.com.Vertex[2].y);
 
796
       rect.left =(int16_t)(block.com.Vertex[0].x);
 
797
           rect.top =(int16_t)(block.com.Vertex[0].y);
 
798
           rect.right =(int16_t)(block.com.Vertex[1].x);
 
799
           rect.bottom =(int16_t)(block.com.Vertex[2].y);
800
800
          LDPUMA_DrawRect(MainWindowD, &rect, 0, color, 2, key);
801
801
         }
802
802
         if(nPics)
803
803
         {
804
 
                LDPUMA_Console("RPIC_�������� ����� ������� ������� \n");
 
804
                LDPUMA_Console("RPIC_Картинки после первого прохода \n");
805
805
                LDPUMA_WaitUserInput(hShowFirstAttempt, MainWindowD);
806
806
                LDPUMA_DeleteRects(MainWindowD, key);
807
807
         }
817
817
         {
818
818
          nPics++;
819
819
          CPAGE_GetBlockData(hCPAGE,h,POSSIBLE_PICTURES, &block, sizeof(block));
820
 
       rect.left =(Int16)(block.com.Vertex[0].x);
821
 
           rect.top =(Int16)(block.com.Vertex[0].y);
822
 
           rect.right =(Int16)(block.com.Vertex[1].x);
823
 
           rect.bottom =(Int16)(block.com.Vertex[2].y);
 
820
       rect.left =(int16_t)(block.com.Vertex[0].x);
 
821
           rect.top =(int16_t)(block.com.Vertex[0].y);
 
822
           rect.right =(int16_t)(block.com.Vertex[1].x);
 
823
           rect.bottom =(int16_t)(block.com.Vertex[2].y);
824
824
          LDPUMA_DrawRect(MainWindowD, &rect, 0, color, 2, key);
825
825
         }
826
826
         if(nPics)
827
827
         {
828
 
                LDPUMA_Console("RPIC_����������� �������� ����� ������� ������� \n");
 
828
                LDPUMA_Console("RPIC_Неуверенные картинки после первого прохода \n");
829
829
                LDPUMA_WaitUserInput(hShowPossiblePics, MainWindowD);
830
830
                LDPUMA_DeleteRects(MainWindowD, key);
831
831
         }
851
851
         }
852
852
         if(nPics)
853
853
         {
854
 
                LDPUMA_Console("RPIC_������� \n");
 
854
                LDPUMA_Console("RPIC_Буквицы \n");
855
855
                LDPUMA_WaitUserInput(hShowBigLetters, MainWindowD);
856
856
                LDPUMA_DeleteRects(MainWindowD, key);
857
857
         }