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

Method compute_bb

deps/tesseract/ccstruct/polyblk.cpp:65–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 */
64
65void POLY_BLOCK::compute_bb() { //constructor
66 ICOORD ibl, itr; //integer bb
67 ICOORD botleft; //bounding box
68 ICOORD topright;
69 ICOORD pos; //current pos;
70 ICOORDELT_IT pts = &vertices; //iterator
71
72 botleft = *pts.data ();
73 topright = botleft;
74 do {
75 pos = *pts.data ();
76 if (pos.x () < botleft.x ())
77 //get bounding box
78 botleft = ICOORD (pos.x (), botleft.y ());
79 if (pos.y () < botleft.y ())
80 botleft = ICOORD (botleft.x (), pos.y ());
81 if (pos.x () > topright.x ())
82 topright = ICOORD (pos.x (), topright.y ());
83 if (pos.y () > topright.y ())
84 topright = ICOORD (topright.x (), pos.y ());
85 pts.forward ();
86 }
87 while (!pts.at_first ());
88 ibl = ICOORD (botleft.x (), botleft.y ());
89 itr = ICOORD (topright.x (), topright.y ());
90 box = TBOX (ibl, itr);
91}
92
93
94/**

Callers

nothing calls this directly

Calls 7

dataMethod · 0.80
ICOORDClass · 0.70
TBOXClass · 0.70
xMethod · 0.45
yMethod · 0.45
forwardMethod · 0.45
at_firstMethod · 0.45

Tested by

no test coverage detected