Tesseract  3.02
tesseract-ocr/ccstruct/split.h
Go to the documentation of this file.
00001 /* -*-C-*-
00002  ********************************************************************************
00003  *
00004  * File:        split.h  (Formerly split.h)
00005  * Description:
00006  * Author:       Mark Seaman, SW Productivity
00007  * Created:      Fri Oct 16 14:37:00 1987
00008  * Modified:     Mon May 13 10:49:23 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 #ifndef SPLIT_H
00026 #define SPLIT_H
00027 
00028 /*----------------------------------------------------------------------
00029               I n c l u d e s
00030 ----------------------------------------------------------------------*/
00031 #include "blobs.h"
00032 #include "oldlist.h"
00033 
00034 /*----------------------------------------------------------------------
00035               T y p e s
00036 ----------------------------------------------------------------------*/
00037 typedef struct split_record
00038 {                                /*  SPLIT  */
00039   EDGEPT *point1;
00040   EDGEPT *point2;
00041 } SPLIT;
00042 
00043 typedef LIST SPLITS;             /*  SPLITS  */
00044 
00045 /*----------------------------------------------------------------------
00046               V a r i a b l e s
00047 ----------------------------------------------------------------------*/
00048 
00049 extern BOOL_VAR_H(wordrec_display_splits, 0, "Display splits");
00050 
00051 /*----------------------------------------------------------------------
00052               M a c r o s
00053 ----------------------------------------------------------------------*/
00054 /**********************************************************************
00055  * clone_split
00056  *
00057  * Create a new split record and set the contents equal to the contents
00058  * of this record.
00059  **********************************************************************/
00060 
00061 #define clone_split(dest,source)                               \
00062 if (source)                                                  \
00063         (dest) = new_split ((source)->point1, (source)->point2);  \
00064 else                                                         \
00065         (dest) = (SPLIT*) NULL                                    \
00066 
00067 
00068 /*----------------------------------------------------------------------
00069               F u n c t i o n s
00070 ----------------------------------------------------------------------*/
00071 void delete_split(SPLIT *split);
00072 
00073 EDGEPT *make_edgept(int x, int y, EDGEPT *next, EDGEPT *prev);
00074 
00075 void remove_edgept(EDGEPT *point);
00076 
00077 SPLIT *new_split(EDGEPT *point1, EDGEPT *point2);
00078 
00079 void print_split(SPLIT *split);
00080 
00081 void split_outline(EDGEPT *join_point1, EDGEPT *join_point2);
00082 
00083 void unsplit_outlines(EDGEPT *p1, EDGEPT *p2);
00084 
00085 #endif