/********************************************************************** * break_pieces * * Break up the blobs in this chain so that they are all independent. * This operation should undo the affect of join_pieces. **********************************************************************/ void break_pieces(const GenericVector<SEAM*>& seams, int first, int last, TWERD *word) { for (int x = first; x < last; ++x) reveal_seam(seams[x]); TESSLINE *outline = word->blobs[first]->outlines; int next_blob = first + 1; while (outline != NULL && next_blob <= last) { if (outline->next == word->blobs[next_blob]->outlines) { outline->next = NULL; outline = word->blobs[next_blob]->outlines; ++next_blob; } else { outline = outline->next; } } }
/********************************************************************** * break_pieces * * Break up the blobs in this chain so that they are all independent. * This operation should undo the affect of join_pieces. **********************************************************************/ void break_pieces(TBLOB *blobs, SEAMS seams, INT16 start, INT16 end) { TESSLINE *outline = blobs->outlines; TBLOB *next_blob; INT16 x; for (x = start; x < end; x++) reveal_seam ((SEAM *) array_value (seams, x)); next_blob = blobs->next; while (outline && next_blob) { if (outline->next == next_blob->outlines) { outline->next = NULL; outline = next_blob->outlines; next_blob = next_blob->next; } else { outline = outline->next; } } }