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

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/hhh/g2bw.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:
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:
72
72
  {
73
73
#endif
74
74
/*
75
 
        ���������.
76
 
1. ������ ���� ���������� �� ���������� ���������� �� ��������� ImageInfo.
77
 
2. ������ ������ ����������� (� ������) ����� ImageInfo->wImageWidth.
78
 
3. ������ ����������� �� ����������� ����������� �� ������� (ImageInfo->wImageWidth+7)/8 (��� �����!!!).
79
 
4. ����������� ���� ����������� ImageInfo->bFotoMetrics
80
 
5. fGetGreyBlock ����� ��� ���������: ����� ���� ���������� �����, ��������� ������, ����� ������������� �����
 
75
        ЗАМЕЧАНИЯ.
 
76
1. Работа трио базируется на информации получаемой из структуры ImageInfo.
 
77
2. Размер серого изображения (в байтах) равен ImageInfo->wImageWidth.
 
78
3. Размер получаемого чб изображения вычисляется по формуле (ImageInfo->wImageWidth+7)/8 (для целых!!!).
 
79
4. Учитывается флаг инверсности ImageInfo->bFotoMetrics
 
80
5. fGetGreyBlock имеет три параметра: адрес куда записывать серое, начальная строка, число запрашиваемых строк
81
81
*/
82
82
 
83
83
GBW_FUNC( Bool ) OpenBinarizator  (enum TBinEnum benum,
88
88
                  short int ImageInty   // 0 - "weak", 1- "normal", 2 -"dirty"
89
89
//#endif
90
90
                                           );
91
 
GBW_FUNC( Word16 ) Binarize  ( PWord8 lpBuff, Word16 Lth);
 
91
GBW_FUNC( uint16_t ) Binarize  ( puchar lpBuff, uint16_t Lth);
92
92
/*
93
 
        lpBuff - �����, ���� ������ �����-�����
94
 
        lth    - ����� ����
95
 
���������� 0, ���� ����������� ���������.
 
93
        lpBuff - адрес, куда писать черно-белое
 
94
        lth    - число байт
 
95
Возвращает 0, если изображение кончилось.
96
96
*/
97
97
GBW_FUNC( void )   CloseBinarizator (void);
98
98
 
99
99
#ifdef WIN32
100
100
        #include "windows.h"
101
101
/*
102
 
        �������������� ������ 8 ������� DIB ����������� � �.�. DIB.
103
 
        ���������:
104
 
                benum - ��� ����������� (�� ����)
105
 
                ImageInty - �������� ����������� (�� ����)
106
 
                hInMemory - handle ���������� ������ �� ����� DIB
107
 
        ���������� NULL � ������ ������ ��� handle ���������� ������ �� �.�. DIB.
108
 
        ��� ������������ ������ ���� ������� GlobalFree(<�.�. DIB>).
 
102
        Преобразование серого 8 битного DIB изображения в ч.б. DIB.
 
103
        параметры:
 
104
                benum - вид бинаризации (см выше)
 
105
                ImageInty - качество изображения (см выше)
 
106
                hInMemory - handle глобальной памяти на серый DIB
 
107
        Возврашает NULL в случае ошибки или handle глобальной памяти на ч.б. DIB.
 
108
        Для освобождения памяти надо вызвать GlobalFree(<ч.б. DIB>).
109
109
 
110
110
 
111
111
*/
114
114
GBW_FUNC( HGLOBAL ) GreyToMono(enum TBinEnum benum,short int ImageInty,HGLOBAL hInMemory);
115
115
GBW_FUNC( void    ) DestroyMono(HGLOBAL hInMemory);
116
116
 
117
 
GBW_FUNC(Word16)        Grey_open(enum TBinEnum benum,Word16 Width, Word16 Height);
118
 
GBW_FUNC(Word16)        Grey_to(PWord8 pTo);
119
 
GBW_FUNC(void)          Grey_from(PWord8 pFrom);
 
117
GBW_FUNC(uint16_t)      Grey_open(enum TBinEnum benum,uint16_t Width, uint16_t Height);
 
118
GBW_FUNC(uint16_t)      Grey_to(puchar pTo);
 
119
GBW_FUNC(void)          Grey_from(puchar pFrom);
120
120
GBW_FUNC(void)          Grey_close(void);
121
121
 
122
122
#ifndef DPITODPM