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

Method fill

deps/tesseract/ccstruct/polyblk.cpp:272–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270
271
272void POLY_BLOCK::fill(ScrollView* window, ScrollView::Color colour) {
273 inT16 y;
274 inT16 width;
275 PB_LINE_IT *lines;
276 ICOORDELT_LIST *segments;
277 ICOORDELT_IT s_it;
278
279 lines = new PB_LINE_IT (this);
280 window->Pen(colour);
281
282 for (y = this->bounding_box ()->bottom ();
283 y <= this->bounding_box ()->top (); y++) {
284 segments = lines->get_line (y);
285 if (!segments->empty ()) {
286 s_it.set_to_list (segments);
287 for (s_it.mark_cycle_pt (); !s_it.cycled_list (); s_it.forward ()) {
288 // Note different use of ICOORDELT, x coord is x coord of pixel
289 // at the start of line segment, y coord is length of line segment
290 // Last pixel is start pixel + length.
291 width = s_it.data ()->y ();
292 window->SetCursor(s_it.data ()->x (), y);
293 window->DrawTo(s_it.data ()->x () + (float) width, y);
294 }
295 }
296 }
297
298 delete lines;
299}
300#endif
301
302

Callers

nothing calls this directly

Calls 13

PenMethod · 0.80
dataMethod · 0.80
SetCursorMethod · 0.80
DrawToMethod · 0.80
bounding_boxMethod · 0.45
get_lineMethod · 0.45
emptyMethod · 0.45
set_to_listMethod · 0.45
mark_cycle_ptMethod · 0.45
cycled_listMethod · 0.45
forwardMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected