Tesseract  3.02
tesseract-ocr/wordrec/gradechop.h
Go to the documentation of this file.
00001 /* -*-C-*-
00002  ********************************************************************************
00003  *
00004  * File:        gradechop.h  (Formerly gradechop.h)
00005  * Description:
00006  * Author:       Mark Seaman, SW Productivity
00007  * Created:      Fri Oct 16 14:37:00 1987
00008  * Modified:     Tue Jul  9 16:40:39 1991 (Mark Seaman) marks@hpgrlt
00009  * Language:     C
00010  * Package:      N/A
00011  * Status:       Reusable Software Component
00012  *
00013  * (c) Copyright 1987, Hewlett-Packard Company.
00014  ** Licensed under the Apache License, Version 2.0 (the "License");
00015  ** you may not use this file except in compliance with the License.
00016  ** You may obtain a copy of the License at
00017  ** http://www.apache.org/licenses/LICENSE-2.0
00018  ** Unless required by applicable law or agreed to in writing, software
00019  ** distributed under the License is distributed on an "AS IS" BASIS,
00020  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00021  ** See the License for the specific language governing permissions and
00022  ** limitations under the License.
00023  *
00024  *********************************************************************************/
00025 
00026 #ifndef GRADECHOP_H
00027 #define GRADECHOP_H
00028 
00029 /*----------------------------------------------------------------------
00030               I n c l u d e s
00031 ----------------------------------------------------------------------*/
00032 #include "seam.h"
00033 #include "ndminx.h"
00034 
00035 /*----------------------------------------------------------------------
00036               T y p e s
00037 ----------------------------------------------------------------------*/
00038 typedef inT16 BOUNDS_RECT[4];
00039 
00040 /*----------------------------------------------------------------------
00041               M a c r o s
00042 ----------------------------------------------------------------------*/
00043 /**********************************************************************
00044  * partial_split_priority
00045  *
00046  * Assign a priority to this split based on the features that it has.
00047  * Grade it according to the different rating schemes and return the
00048  * value of its goodness.
00049  **********************************************************************/
00050 
00051 #define partial_split_priority(split)  \
00052 (grade_split_length   (split) +      \
00053         grade_sharpness      (split))       \
00054 
00055 
00056 /**********************************************************************
00057  * split_bounds_overlap
00058  *
00059  * Check to see if this split might overlap with this outline.  Return
00060  * TRUE if there is a positive overlap in the bounding boxes of the two.
00061  **********************************************************************/
00062 
00063 #define split_bounds_overlap(split,outline)  \
00064 (outline->topleft.x  <= MAX (split->point1->pos.x,split->point2->pos.x) && \
00065         outline->botright.x >= MIN (split->point1->pos.x,split->point2->pos.x) && \
00066         outline->botright.y <= MAX (split->point1->pos.y,split->point2->pos.y) && \
00067         outline->topleft.y  >= MIN (split->point1->pos.y,split->point2->pos.y))
00068 
00069 #endif