#include <boxword.h>
List of all members.
Detailed Description
Definition at line 47 of file boxword.h.
Constructor & Destructor Documentation
tesseract::BoxWord::BoxWord |
( |
| ) |
|
tesseract::BoxWord::BoxWord |
( |
const BoxWord & |
src | ) |
|
|
explicit |
tesseract::BoxWord::~BoxWord |
( |
| ) |
|
Member Function Documentation
const TBOX& tesseract::BoxWord::BlobBox |
( |
int |
index | ) |
const |
|
inline |
Definition at line 102 of file boxword.h.
{
return boxes_[index];
}
ScriptPos tesseract::BoxWord::BlobPosition |
( |
int |
index | ) |
const |
|
inline |
Definition at line 105 of file boxword.h.
{
if (index < 0 || index >= script_pos_.
size())
return script_pos_[index];
}
const TBOX& tesseract::BoxWord::bounding_box |
( |
| ) |
const |
|
inline |
void tesseract::BoxWord::ClipToOriginalWord |
( |
const BLOCK * |
block, |
|
|
WERD * |
original_word |
|
) |
| |
Definition at line 138 of file boxword.cpp.
{
for (int i = 0; i < length_; ++i) {
for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
TBOX blob_box = b_it.data()->bounding_box();
original_box += blob_box;
}
}
if (!original_box.null_box()) {
if (NearlyEqual<int>(original_box.right(), box.
right(),
if (NearlyEqual<int>(original_box.bottom(), box.
bottom(),
}
}
ComputeBoundingBox();
}
void tesseract::BoxWord::CopyFrom |
( |
const BoxWord & |
src | ) |
|
Definition at line 54 of file boxword.cpp.
{
bbox_ = src.bbox_;
length_ = src.length_;
for (int i = 0; i < length_; ++i)
}
BoxWord * tesseract::BoxWord::CopyFromNormalized |
( |
const DENORM * |
denorm, |
|
|
TWERD * |
tessword |
|
) |
| |
|
static |
Definition at line 67 of file boxword.cpp.
{
boxword->length_ = 0;
for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next)
++boxword->length_;
boxword->boxes_.reserve(boxword->length_);
for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next) {
outline = outline->next) {
EDGEPT* edgept = outline->loop;
do {
}
blob_box += pt_box;
}
} while (edgept != outline->loop);
}
boxword->boxes_.push_back(blob_box);
}
boxword->ComputeBoundingBox();
return boxword;
}
void tesseract::BoxWord::DeleteAllBoxes |
( |
| ) |
|
void tesseract::BoxWord::DeleteBox |
( |
int |
index | ) |
|
Definition at line 205 of file boxword.cpp.
{
--length_;
ComputeBoundingBox();
}
void tesseract::BoxWord::InsertBox |
( |
int |
index, |
|
|
const TBOX & |
box |
|
) |
| |
Definition at line 194 of file boxword.cpp.
{
if (index < length_)
else
ComputeBoundingBox();
}
const int tesseract::BoxWord::length |
( |
| ) |
const |
|
inline |
void tesseract::BoxWord::MergeBoxes |
( |
int |
start, |
|
|
int |
end |
|
) |
| |
Definition at line 177 of file boxword.cpp.
{
if (end <= start + 1)
return;
for (int i = start + 1; i < end; ++i) {
boxes_[start] += boxes_[i];
}
int shrinkage = end - 1 - start;
length_ -= shrinkage;
for (int i = start + 1; i < length_; ++i)
boxes_[i] = boxes_[i + shrinkage];
}
void tesseract::BoxWord::ProcessMatchedBlobs |
( |
const TWERD & |
other, |
|
|
TessCallback1< int > * |
cb |
|
) |
| const |
Definition at line 229 of file boxword.cpp.
{
for (
int i = 0; i < length_ && blob !=
NULL; ++i, blob = blob->
next) {
TBOX blob_box = blob->bounding_box();
if (blob_box == boxes_[i])
}
delete cb;
}
void tesseract::BoxWord::SetScriptPositions |
( |
const UNICHARSET & |
unicharset, |
|
|
bool |
small_caps, |
|
|
TWERD * |
tessword, |
|
|
WERD_CHOICE * |
best_choice |
|
) |
| |
Definition at line 108 of file boxword.cpp.
{
int blob_index = 0;
for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next,
++blob_index) {
int class_id = best_choice->
unichar_id(blob_index);
TBOX blob_box = tblob->bounding_box();
int top = blob_box.
top();
int bottom = blob_box.
bottom();
int min_bottom, max_bottom, min_top, max_top;
&min_top, &max_top);
} else if (!small_caps) {
}
}
}
}
The documentation for this class was generated from the following files: