Skip to content
Newer
Older
100644 107 lines (53 sloc) 4.52 KB
da1d2dd @Flameeyes Add missing license headers to files.
authored Oct 11, 2011
1 /*
2 * This file is part of Unpaper.
3 *
4 * Copyright © 2005-2007 Jens Gulden
5 * Copyright © 2011-2011 Diego Elio Pettenò
6 *
7 * Unpaper is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, version 2 of the License.
10 *
11 * Unpaper is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
53796e5 @Flameeyes build: split unpaper.c into several files.
authored Oct 8, 2011
19
20 /****************************************************************************
21 * image processing functions *
22 ****************************************************************************/
23
24
25 /* --- deskewing ---------------------------------------------------------- */
26
27 double detectRotation(int deskewScanEdges, int deskewScanRange, float deskewScanStep, int deskewScanSize, float deskewScanDepth, float deskewScanDeviation, int left, int top, int right, int bottom, struct IMAGE* image);
28
29 void rotate(double radians, struct IMAGE* source, struct IMAGE* target);
30
31 void convertToQPixels(struct IMAGE* image, struct IMAGE* qpixelImage);
32
33 void convertFromQPixels(struct IMAGE* qpixelImage, struct IMAGE* image);
34
35
36 /* --- stretching / resizing / shifting ------------------------------------ */
37
38
39 void stretch(int w, int h, struct IMAGE* image);
40
41 void resize(int w, int h, struct IMAGE* image);
42
43 void shift(int shiftX, int shiftY, struct IMAGE* image);
44
45
46 /* --- mask-detection ----------------------------------------------------- */
47
48
49 int detectMasks(int mask[MAX_MASKS][EDGES_COUNT], bool maskValid[MAX_MASKS], int point[MAX_POINTS][COORDINATES_COUNT], int pointCount, int maskScanDirections, int maskScanSize[DIRECTIONS_COUNT], int maskScanDepth[DIRECTIONS_COUNT], int maskScanStep[DIRECTIONS_COUNT], float maskScanThreshold[DIRECTIONS_COUNT], int maskScanMinimum[DIMENSIONS_COUNT], int maskScanMaximum[DIMENSIONS_COUNT], struct IMAGE* image);
50
51 void applyMasks(int mask[MAX_MASKS][EDGES_COUNT], int maskCount, int maskColor, struct IMAGE* image);
52
53
54 /* --- wiping ------------------------------------------------------------- */
55
56
57 void applyWipes(int area[MAX_MASKS][EDGES_COUNT], int areaCount, int wipeColor, struct IMAGE* image);
58
59
60 /* --- mirroring ---------------------------------------------------------- */
61
62
63 void mirror(int directions, struct IMAGE* image);
64
65
66 /* --- flip-rotating ------------------------------------------------------ */
67
68
69 void flipRotate(int direction, struct IMAGE* image);
70
71
72 /* --- blackfilter -------------------------------------------------------- */
73
74
75 void blackfilter(int blackfilterScanDirections, int blackfilterScanSize[DIRECTIONS_COUNT], int blackfilterScanDepth[DIRECTIONS_COUNT], int blackfilterScanStep[DIRECTIONS_COUNT], float blackfilterScanThreshold, int blackfilterExclude[MAX_MASKS][EDGES_COUNT], int blackfilterExcludeCount, int blackfilterIntensity, float blackThreshold, struct IMAGE* image);
76
77
78 /* --- noisefilter -------------------------------------------------------- */
79
80
81 int noisefilter(int intensity, float whiteThreshold, struct IMAGE* image);
82
83
84 /* --- blurfilter --------------------------------------------------------- */
85
86 int blurfilter(int blurfilterScanSize[DIRECTIONS_COUNT], int blurfilterScanStep[DIRECTIONS_COUNT], float blurfilterIntensity, float whiteThreshold, struct IMAGE* image);
87
88
89 /* --- grayfilter --------------------------------------------------------- */
90
91
92 int grayfilter(int grayfilterScanSize[DIRECTIONS_COUNT], int grayfilterScanStep[DIRECTIONS_COUNT], float grayfilterThreshold, float blackThreshold, struct IMAGE* image);
93
94
95 /* --- border-detection --------------------------------------------------- */
96
97
98 void centerMask(int centerX, int centerY, int left, int top, int right, int bottom, struct IMAGE* image);
99
100 void alignMask(int mask[EDGES_COUNT], int outside[EDGES_COUNT], int direction, int margin[DIRECTIONS_COUNT], struct IMAGE* image);
101
102 void detectBorder(int border[EDGES_COUNT], int borderScanDirections, int borderScanSize[DIRECTIONS_COUNT], int borderScanStep[DIRECTIONS_COUNT], int borderScanThreshold[DIRECTIONS_COUNT], float blackThreshold, int outsideMask[EDGES_COUNT], struct IMAGE* image);
103
104 void borderToMask(int border[EDGES_COUNT], int mask[EDGES_COUNT], struct IMAGE* image);
105
106 void applyBorder(int border[EDGES_COUNT], int borderColor, struct IMAGE* image);
Something went wrong with that request. Please try again.