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

Method ValidFirstLine

deps/tesseract/ccstruct/ocrpara.cpp:46–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46bool ParagraphModel::ValidFirstLine(int lmargin, int lindent,
47 int rindent, int rmargin) const {
48 switch (justification_) {
49 case JUSTIFICATION_LEFT:
50 return NearlyEqual(lmargin + lindent, margin_ + first_indent_,
51 tolerance_);
52 case JUSTIFICATION_RIGHT:
53 return NearlyEqual(rmargin + rindent, margin_ + first_indent_,
54 tolerance_);
55 case JUSTIFICATION_CENTER:
56 return NearlyEqual(lindent, rindent, tolerance_ * 2);
57 default:
58 // shouldn't happen
59 return false;
60 }
61}
62
63bool ParagraphModel::ValidBodyLine(int lmargin, int lindent,
64 int rindent, int rmargin) const {

Callers 1

ValidFirstLineFunction · 0.80

Calls 1

NearlyEqualFunction · 0.85

Tested by

no test coverage detected