MCPcopy Create free account
hub / github.com/creatale/node-dv / ExtendToBox

Method ExtendToBox

deps/tesseract/textord/tabvector.cpp:246–267  ·  view source on GitHub ↗

Extend this vector to include the supplied blob if it doesn't already have it.

Source from the content-addressed store, hash-verified

244// Extend this vector to include the supplied blob if it doesn't
245// already have it.
246void 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.
270void TabVector::SetYStart(int start_y) {

Callers 1

AddPartnerVectorMethod · 0.80

Calls 7

dataMethod · 0.80
bounding_boxMethod · 0.45
emptyMethod · 0.45
at_lastMethod · 0.45
forwardMethod · 0.45
add_before_stay_putMethod · 0.45
add_after_stay_putMethod · 0.45

Tested by

no test coverage detected