#include <ocrpara.h>
|
| ParagraphModel (tesseract::ParagraphJustification justification, int margin, int first_indent, int body_indent, int tolerance) |
|
| ParagraphModel () |
|
bool | ValidFirstLine (int lmargin, int lindent, int rindent, int rmargin) const |
|
bool | ValidBodyLine (int lmargin, int lindent, int rindent, int rmargin) const |
|
tesseract::ParagraphJustification | justification () const |
|
int | margin () const |
|
int | first_indent () const |
|
int | body_indent () const |
|
int | tolerance () const |
|
bool | is_flush () const |
|
bool | Comparable (const ParagraphModel &other) const |
|
STRING | ToString () const |
|
Definition at line 114 of file ocrpara.h.
◆ ParagraphModel() [1/2]
Definition at line 116 of file ocrpara.h.
130 margin_ += added_margin;
131 first_indent_ -= added_margin;
132 body_indent_ -= added_margin;
◆ ParagraphModel() [2/2]
ParagraphModel::ParagraphModel |
( |
| ) |
|
|
inline |
◆ body_indent()
int ParagraphModel::body_indent |
( |
| ) |
const |
|
inline |
Definition at line 169 of file ocrpara.h.
169 {
return body_indent_; }
◆ Comparable()
Definition at line 79 of file ocrpara.cpp.
80 if (justification_ != other.justification_)
85 int tolerance = (tolerance_ + other.tolerance_) / 4;
87 other.margin_ + other.first_indent_,
tolerance) &&
89 other.margin_ + other.body_indent_,
tolerance);
◆ first_indent()
int ParagraphModel::first_indent |
( |
| ) |
const |
|
inline |
Definition at line 168 of file ocrpara.h.
168 {
return first_indent_; }
◆ is_flush()
bool ParagraphModel::is_flush |
( |
| ) |
const |
|
inline |
Definition at line 171 of file ocrpara.h.
174 abs(first_indent_ - body_indent_) <= tolerance_;
◆ justification()
Definition at line 164 of file ocrpara.h.
165 return justification_;
◆ margin()
int ParagraphModel::margin |
( |
| ) |
const |
|
inline |
◆ tolerance()
int ParagraphModel::tolerance |
( |
| ) |
const |
|
inline |
Definition at line 170 of file ocrpara.h.
170 {
return tolerance_; }
◆ ToString()
STRING ParagraphModel::ToString |
( |
| ) |
const |
Definition at line 92 of file ocrpara.cpp.
94 const STRING &alignment = ParagraphJustificationToString(justification_);
95 snprintf(buffer,
sizeof(buffer),
96 "margin: %d, first_indent: %d, body_indent: %d, alignment: %s",
97 margin_, first_indent_, body_indent_, alignment.
c_str());
◆ ValidBodyLine()
bool ParagraphModel::ValidBodyLine |
( |
int |
lmargin, |
|
|
int |
lindent, |
|
|
int |
rindent, |
|
|
int |
rmargin |
|
) |
| const |
Definition at line 62 of file ocrpara.cpp.
64 switch (justification_) {
66 return NearlyEqual(lmargin + lindent, margin_ + body_indent_,
69 return NearlyEqual(rmargin + rindent, margin_ + body_indent_,
72 return NearlyEqual(lindent, rindent, tolerance_ * 2);
◆ ValidFirstLine()
bool ParagraphModel::ValidFirstLine |
( |
int |
lmargin, |
|
|
int |
lindent, |
|
|
int |
rindent, |
|
|
int |
rmargin |
|
) |
| const |
Definition at line 45 of file ocrpara.cpp.
47 switch (justification_) {
49 return NearlyEqual(lmargin + lindent, margin_ + first_indent_,
52 return NearlyEqual(rmargin + rindent, margin_ + first_indent_,
55 return NearlyEqual(lindent, rindent, tolerance_ * 2);
The documentation for this class was generated from the following files: