#include <ocrpara.h>
List of all members.
Public Member Functions |
| 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 |
Detailed Description
Definition at line 114 of file ocrpara.h.
Constructor & Destructor Documentation
ParagraphModel::ParagraphModel |
( |
| ) |
[inline] |
Member Function Documentation
int ParagraphModel::body_indent |
( |
| ) |
const [inline] |
Definition at line 80 of file ocrpara.cpp.
{
if (justification_ != other.justification_)
return false;
if (justification_ == JUSTIFICATION_CENTER ||
justification_ == JUSTIFICATION_UNKNOWN)
return true;
int tolerance = (tolerance_ + other.tolerance_) / 4;
return NearlyEqual(margin_ + first_indent_,
other.margin_ + other.first_indent_, tolerance) &&
NearlyEqual(margin_ + body_indent_,
other.margin_ + other.body_indent_, tolerance);
}
int ParagraphModel::first_indent |
( |
| ) |
const [inline] |
Definition at line 168 of file ocrpara.h.
{ return first_indent_; }
bool ParagraphModel::is_flush |
( |
| ) |
const [inline] |
Definition at line 164 of file ocrpara.h.
{
return justification_;
}
int ParagraphModel::margin |
( |
| ) |
const [inline] |
int ParagraphModel::tolerance |
( |
| ) |
const [inline] |
STRING ParagraphModel::ToString |
( |
| ) |
const |
Definition at line 93 of file ocrpara.cpp.
{
char buffer[200];
const STRING &alignment = ParagraphJustificationToString(justification_);
snprintf(buffer, sizeof(buffer),
"margin: %d, first_indent: %d, body_indent: %d, alignment: %s",
margin_, first_indent_, body_indent_, alignment.string());
return STRING(buffer);
}
bool ParagraphModel::ValidBodyLine |
( |
int |
lmargin, |
|
|
int |
lindent, |
|
|
int |
rindent, |
|
|
int |
rmargin |
|
) |
| const |
bool ParagraphModel::ValidFirstLine |
( |
int |
lmargin, |
|
|
int |
lindent, |
|
|
int |
rindent, |
|
|
int |
rmargin |
|
) |
| const |
The documentation for this class was generated from the following files: