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

Method plot_normed

deps/tesseract/ccstruct/coutln.cpp:997–1023  ·  view source on GitHub ↗

* Draws the outline in the given colour, normalized using the given denorm, * making use of sub-pixel accurate information if available. */

Source from the content-addressed store, hash-verified

995 * making use of sub-pixel accurate information if available.
996 */
997void C_OUTLINE::plot_normed(const DENORM& denorm, ScrollView::Color colour,
998 ScrollView* window) const {
999 window->Pen(colour);
1000 if (stepcount == 0) {
1001 window->Rectangle(box.left(), box.top(), box.right(), box.bottom());
1002 return;
1003 }
1004 const DENORM* root_denorm = denorm.RootDenorm();
1005 ICOORD pos = start; // current position
1006 FCOORD f_pos = sub_pixel_pos_at_index(pos, 0);
1007 FCOORD pos_normed;
1008 denorm.NormTransform(root_denorm, f_pos, &pos_normed);
1009 window->SetCursor(IntCastRounded(pos_normed.x()),
1010 IntCastRounded(pos_normed.y()));
1011 for (int s = 0; s < stepcount; pos += step(s++)) {
1012 int edge_weight = edge_strength_at_index(s);
1013 if (edge_weight == 0) {
1014 // This point has conflicting gradient and step direction, so ignore it.
1015 continue;
1016 }
1017 FCOORD f_pos = sub_pixel_pos_at_index(pos, s);
1018 FCOORD pos_normed;
1019 denorm.NormTransform(root_denorm, f_pos, &pos_normed);
1020 window->DrawTo(IntCastRounded(pos_normed.x()),
1021 IntCastRounded(pos_normed.y()));
1022 }
1023}
1024#endif
1025
1026/**

Callers 1

word_bln_displayMethod · 0.45

Calls 12

sub_pixel_pos_at_indexFunction · 0.85
IntCastRoundedFunction · 0.85
stepFunction · 0.85
edge_strength_at_indexFunction · 0.85
PenMethod · 0.80
RectangleMethod · 0.80
RootDenormMethod · 0.80
NormTransformMethod · 0.80
SetCursorMethod · 0.80
DrawToMethod · 0.80
xMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected