00001 /* -*-C-*- 00002 ******************************************************************************** 00003 * 00004 * File: pieces.h (Formerly pieces.h) 00005 * Description: 00006 * Author: Mark Seaman, SW Productivity 00007 * Created: Fri Oct 16 14:37:00 1987 00008 * Modified: Tue Apr 30 11:49:11 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 PIECES_H 00026 #define PIECES_H 00027 00028 /*---------------------------------------------------------------------- 00029 I n c l u d e s 00030 ----------------------------------------------------------------------*/ 00031 #include "matrix.h" 00032 #include "seam.h" 00033 #include "states.h" 00034 00035 /*---------------------------------------------------------------------- 00036 T y p e s 00037 ----------------------------------------------------------------------*/ 00038 typedef struct 00039 { /* BOUNDS */ 00040 TPOINT topleft; 00041 TPOINT botright; 00042 } BOUNDS; 00043 00044 typedef BOUNDS *BOUNDS_LIST; /* BOUNDS_LIST */ 00045 00046 /*---------------------------------------------------------------------- 00047 F u n c t i o n s 00048 ----------------------------------------------------------------------*/ 00049 void break_pieces(TBLOB *blobs, SEAMS seams, inT16 start, inT16 end); 00050 00051 void join_pieces(TBLOB *piece_blobs, SEAMS seams, inT16 start, inT16 end); 00052 00053 void hide_seam(SEAM *seam); 00054 00055 void hide_edge_pair(EDGEPT *pt1, EDGEPT *pt2); 00056 00057 void reveal_seam(SEAM *seam); 00058 00059 void reveal_edge_pair(EDGEPT *pt1, EDGEPT *pt2); 00060 00061 void bounds_of_piece(BOUNDS_LIST bounds, 00062 inT16 start, 00063 inT16 end, 00064 TPOINT *extreme_tl, 00065 TPOINT *extreme_br); 00066 00067 BOUNDS_LIST record_blob_bounds(TBLOB *blobs); 00068 00069 MATRIX *record_piece_ratings(TBLOB *blobs); 00070 00071 /* 00072 #if defined(__STDC__) || defined(__cplusplus) 00073 # define _ARGS(s) s 00074 #else 00075 # define _ARGS(s) () 00076 #endif*/ 00077 00078 /* pieces.c * 00079 void break_pieces 00080 _ARGS((BLOB *blobs, 00081 SEAMS seams)); 00082 00083 void join_pieces 00084 _ARGS((BLOB *piece_blobs, 00085 SEAMS seams, 00086 inT16 start, 00087 inT16 end)); 00088 00089 void hide_seam 00090 _ARGS((SEAM *seam)); 00091 00092 void reveal_seam 00093 _ARGS((SEAM *seam)); 00094 00095 void bounds_of_piece 00096 _ARGS((BOUNDS_LIST bounds, 00097 inT16 start, 00098 inT16 end, 00099 TPOINT *extreme_tl, 00100 TPOINT *extreme_br)); 00101 00102 CHOICES classify_piece 00103 _ARGS((BLOB *pieces, 00104 SEAMS seams, 00105 inT16 start, 00106 inT16 end, 00107 inT32 fx, 00108 STATE* this_state, 00109 STATE* best_state, 00110 inT32 pass, 00111 inT32 blob_index)); 00112 00113 CHOICES get_piece_rating 00114 _ARGS((MATRIX ratings, 00115 BLOB *blobs, 00116 SEAMS seams, 00117 inT16 start, 00118 inT16 end, 00119 inT32 fx, 00120 STATE* this_state, 00121 STATE* best_state, 00122 inT32 pass, 00123 inT32 blob_index)); 00124 00125 BOUNDS_LIST record_blob_bounds 00126 _ARGS((BLOB *blobs)); 00127 00128 MATRIX record_piece_ratings 00129 _ARGS((BLOB *blobs)); 00130 00131 #undef _ARGS 00132 */ 00133 #endif