Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gradechop.h
Go to the documentation of this file.
1 /* -*-C-*-
2 ********************************************************************************
3 *
4 * File: gradechop.h (Formerly gradechop.h)
5 * Description:
6 * Author: Mark Seaman, SW Productivity
7 * Created: Fri Oct 16 14:37:00 1987
8 * Modified: Tue Jul 9 16:40:39 1991 (Mark Seaman) marks@hpgrlt
9 * Language: C
10 * Package: N/A
11 * Status: Reusable Software Component
12 *
13 * (c) Copyright 1987, Hewlett-Packard Company.
14 ** Licensed under the Apache License, Version 2.0 (the "License");
15 ** you may not use this file except in compliance with the License.
16 ** You may obtain a copy of the License at
17 ** http://www.apache.org/licenses/LICENSE-2.0
18 ** Unless required by applicable law or agreed to in writing, software
19 ** distributed under the License is distributed on an "AS IS" BASIS,
20 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 ** See the License for the specific language governing permissions and
22 ** limitations under the License.
23 *
24 *********************************************************************************/
25
26 #ifndef GRADECHOP_H
27 #define GRADECHOP_H
28
29 /*----------------------------------------------------------------------
30 I n c l u d e s
31 ----------------------------------------------------------------------*/
32 #include "seam.h"
33 #include "ndminx.h"
34
35 /*----------------------------------------------------------------------
36 T y p e s
37 ----------------------------------------------------------------------*/
38 typedef inT16 BOUNDS_RECT[4];
39
40 /*----------------------------------------------------------------------
41 M a c r o s
42 ----------------------------------------------------------------------*/
43 /**********************************************************************
44 * partial_split_priority
45 *
46 * Assign a priority to this split based on the features that it has.
47 * Grade it according to the different rating schemes and return the
48 * value of its goodness.
49 **********************************************************************/
50
51 #define partial_split_priority(split) \
52 (grade_split_length (split) + \
53 grade_sharpness (split)) \
54
55
56 /**********************************************************************
57 * split_bounds_overlap
58 *
59 * Check to see if this split might overlap with this outline. Return
60 * TRUE if there is a positive overlap in the bounding boxes of the two.
61 **********************************************************************/
62
63 #define split_bounds_overlap(split,outline) \
64 (outline->topleft.x <= MAX (split->point1->pos.x,split->point2->pos.x) && \
65 outline->botright.x >= MIN (split->point1->pos.x,split->point2->pos.x) && \
66 outline->botright.y <= MAX (split->point1->pos.y,split->point2->pos.y) && \
67 outline->topleft.y >= MIN (split->point1->pos.y,split->point2->pos.y))
68
69 #endif