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

Method Draw

deps/tesseract/ccstruct/imagedata.cpp:66–80  ·  view source on GitHub ↗

Draws the features in the given window.

Source from the content-addressed store, hash-verified

64
65// Draws the features in the given window.
66void WordFeature::Draw(const GenericVector<WordFeature>& features,
67 ScrollView* window) {
68#ifndef GRAPHICS_DISABLED
69 for (int f = 0; f < features.size(); ++f) {
70 FCOORD pos(features[f].x_, features[f].y_);
71 FCOORD dir;
72 dir.from_direction(features[f].dir_);
73 dir *= 8.0f;
74 window->SetCursor(IntCastRounded(pos.x() - dir.x()),
75 IntCastRounded(pos.y() - dir.y()));
76 window->DrawTo(IntCastRounded(pos.x() + dir.x()),
77 IntCastRounded(pos.y() + dir.y()));
78 }
79#endif
80}
81
82// Writes to the given file. Returns false in case of error.
83bool WordFeature::Serialize(FILE* fp) const {

Callers

nothing calls this directly

Calls 7

IntCastRoundedFunction · 0.85
from_directionMethod · 0.80
SetCursorMethod · 0.80
DrawToMethod · 0.80
sizeMethod · 0.45
xMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected