Extend this vector to include the supplied blob if it doesn't already have it.
| 244 | // Extend this vector to include the supplied blob if it doesn't |
| 245 | // already have it. |
| 246 | void TabVector::ExtendToBox(BLOBNBOX* new_blob) { |
| 247 | TBOX new_box = new_blob->bounding_box(); |
| 248 | BLOBNBOX_C_IT it(&boxes_); |
| 249 | if (!it.empty()) { |
| 250 | BLOBNBOX* blob = it.data(); |
| 251 | TBOX box = blob->bounding_box(); |
| 252 | while (!it.at_last() && box.top() <= new_box.top()) { |
| 253 | if (blob == new_blob) |
| 254 | return; // We have it already. |
| 255 | it.forward(); |
| 256 | blob = it.data(); |
| 257 | box = blob->bounding_box(); |
| 258 | } |
| 259 | if (box.top() >= new_box.top()) { |
| 260 | it.add_before_stay_put(new_blob); |
| 261 | needs_refit_ = true; |
| 262 | return; |
| 263 | } |
| 264 | } |
| 265 | needs_refit_ = true; |
| 266 | it.add_after_stay_put(new_blob); |
| 267 | } |
| 268 | |
| 269 | // Set the ycoord of the start and move the xcoord to match. |
| 270 | void TabVector::SetYStart(int start_y) { |
no test coverage detected