40 #define NUM_STARTING_SEAMS 20
82 if (split ==
NULL)
return false;
93 if (seam ==
NULL)
return false;
121 if (source_seam->
split1) {
124 else if (!dest_seam->
split2)
126 else if (!dest_seam->
split3)
129 cprintf(
"combine_seam: Seam is too crowded, can't be combined !\n");
131 if (source_seam->
split2) {
134 else if (!dest_seam->
split3)
137 cprintf(
"combine_seam: Seam is too crowded, can't be combined !\n");
139 if (source_seam->
split3) {
143 cprintf(
"combine_seam: Seam is too crowded, can't be combined !\n");
145 free_seam(source_seam);
182 for (blob = blobs; blob->
next !=
NULL; blob = blob->
next) {
185 location.
x = (bbox.
right() + nbox.
left()) / 2;
223 for (test_index=0, blob=first_blob->
next;
225 test_index++, blob=blob->
next) {
227 if (test_index + test_seam->
widthp < index &&
228 test_seam->
widthp + test_index == index - 1 &&
232 for (test_index=index, blob=left_blob->
next;
233 test_index < list_length;
234 test_index++, blob=blob->
next) {
236 if (test_index - test_seam->
widthn >= index &&
237 test_index - test_seam->
widthn == index &&
261 for (test_index=0, blob=first_blob->
next;
263 test_index++, blob=blob->
next) {
265 if (test_index + test_seam->
widthp >= index) {
267 }
else if (test_seam->
widthp + test_index == index - 1) {
269 if (test_seam->
widthp < 0) {
270 cprintf(
"Failed to find any right blob for a split!\n");
276 for (test_index=index, blob=left_blob->
next;
277 test_index < list_length;
278 test_index++, blob=blob->
next) {
280 if (test_index - test_seam->
widthn < index) {
282 }
else if (test_index - test_seam->
widthn == index) {
284 if (test_seam->
widthn < 0) {
285 cprintf(
"Failed to find any left blob for a split!\n");
308 if (found_em[0] && found_em[1] && found_em[2])
318 if (found_em[0] && found_em[1] && found_em[2]) {
323 }
while (blob !=
NULL);
344 if (blob != end_blob) {
347 depth, width, found_em);
361 if (!found_em[0] || !found_em[1] || !found_em[2]) {
400 assert(seam1 &&seam2);
461 cprintf(
" %6.2f @ (%d,%d), p=%d, n=%d ",
492 sprintf(number,
"%2d: ", x);
540 for (x = start; x < end; x++)
543 next_blob = blobs->
next;
545 while (outline && next_blob) {
549 next_blob = next_blob->
next;
552 outline = outline->
next;
571 for (x = 0, blob = piece_blobs; x < start; x++)
573 next_blob = blob->
next;
580 if (x - seam->
widthn >= start && x + seam->
widthp < end)
582 while (outline->
next)
583 outline = outline->
next;
585 next_blob = next_blob->
next;
625 edgept = edgept->
next;
627 while (!
exact_point (edgept, pt2) && edgept != pt1);
635 edgept = edgept->
next;
637 while (!
exact_point (edgept, pt1) && edgept != pt2);
678 edgept = edgept->
next;
680 while (!
exact_point (edgept, pt2) && edgept != pt1);
688 edgept = edgept->
next;
690 while (!
exact_point (edgept, pt1) && edgept != pt2);