SANEI 1.3.1.72-4c77c
sanei_magic.h
Go to the documentation of this file.
1/* sane - Scanner Access Now Easy.
2
3 Copyright (C) 2009 m. allan noah
4
5 This file is part of the SANE package.
6
7 SANE is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 SANE is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with sane; see the file COPYING.
19 If not, see <https://www.gnu.org/licenses/>.
20
21 As a special exception, the authors of SANE give permission for
22 additional uses of the libraries contained in this release of SANE.
23
24 The exception is that, if you link a SANE library with other files
25 to produce an executable, this does not by itself cause the
26 resulting executable to be covered by the GNU General Public
27 License. Your use of that executable is in no way restricted on
28 account of linking the SANE library code into it.
29
30 This exception does not, however, invalidate any other reasons why
31 the executable file might be covered by the GNU General Public
32 License.
33
34 If you submit changes to SANE to the maintainers to be included in
35 a subsequent release, you agree by submitting the changes that
36 those changes may be distributed with this exception intact.
37
38 If you write modifications of your own for SANE, it is your choice
39 whether to permit this exception to apply to your modifications.
40 If you do not wish that, delete this exception notice.
41*/
42
57#ifndef SANEI_MAGIC_H
58#define SANEI_MAGIC_H
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
68extern void sanei_magic_init( void );
69
80extern SANE_Status
81sanei_magic_despeck (SANE_Parameters * params, SANE_Byte * buffer,
82 SANE_Int diam);
83
100extern SANE_Status
101sanei_magic_findSkew(SANE_Parameters * params, SANE_Byte * buffer,
102 int dpiX, int dpiY, int * centerX, int * centerY, double * finSlope);
103
118extern SANE_Status
119sanei_magic_rotate (SANE_Parameters * params, SANE_Byte * buffer,
120 int centerX, int centerY, double slope, int bg_color);
121
138extern SANE_Status
139sanei_magic_findEdges(SANE_Parameters * params, SANE_Byte * buffer,
140 int dpiX, int dpiY, int * top, int * bot, int * left, int * right);
141
156extern SANE_Status
157sanei_magic_crop(SANE_Parameters * params, SANE_Byte * buffer,
158 int top, int bot, int left, int right);
159
172extern SANE_Status
173sanei_magic_isBlank(SANE_Parameters * params, SANE_Byte * buffer,
174 double thresh);
175
190extern SANE_Status
191sanei_magic_isBlank2(SANE_Parameters * params, SANE_Byte * buffer,
192 int dpiX, int dpiY, double thresh);
193
207extern SANE_Status
208sanei_magic_findTurn(SANE_Parameters * params, SANE_Byte * buffer,
209 int dpiX, int dpiY, int * angle);
210
222extern SANE_Status
223sanei_magic_turn(SANE_Parameters * params, SANE_Byte * buffer,
224 int angle);
225
226#ifdef __cplusplus
227} // extern "C"
228#endif
229
230#endif /* SANEI_MAGIC_H */
void sanei_magic_init(void)
Initialize sanei_magic.
SANE_Status sanei_magic_findEdges(SANE_Parameters *params, SANE_Byte *buffer, int dpiX, int dpiY, int *top, int *bot, int *left, int *right)
Find the edges of the media inside the image, parallel to image edges.
SANE_Status sanei_magic_isBlank2(SANE_Parameters *params, SANE_Byte *buffer, int dpiX, int dpiY, double thresh)
Determine if image is blank, enhanced version.
SANE_Status sanei_magic_crop(SANE_Parameters *params, SANE_Byte *buffer, int top, int bot, int left, int right)
Crop the image, parallel to image edges.
SANE_Status sanei_magic_isBlank(SANE_Parameters *params, SANE_Byte *buffer, double thresh)
Determine if image is blank.
SANE_Status sanei_magic_despeck(SANE_Parameters *params, SANE_Byte *buffer, SANE_Int diam)
Update the image buffer, replacing dots with surrounding background color.
SANE_Status sanei_magic_turn(SANE_Parameters *params, SANE_Byte *buffer, int angle)
Coarse image rotation (90 degree increments)
SANE_Status sanei_magic_rotate(SANE_Parameters *params, SANE_Byte *buffer, int centerX, int centerY, double slope, int bg_color)
Correct the skew of the media inside the image, via simple rotation.
SANE_Status sanei_magic_findSkew(SANE_Parameters *params, SANE_Byte *buffer, int dpiX, int dpiY, int *centerX, int *centerY, double *finSlope)
Find the skew of the media inside the image, via edge detection.
SANE_Status sanei_magic_findTurn(SANE_Parameters *params, SANE_Byte *buffer, int dpiX, int dpiY, int *angle)
Determine coarse image rotation (90 degree increments)