#include <normalis.h>
List of all members.
Public Member Functions |
| DENORM () |
| DENORM (float x, float scaling, ROW *src) |
| DENORM (float x, float scaling, double line_m, double line_c, inT16 seg_count, DENORM_SEG *seg_pts, BOOL8 using_row, ROW *src) |
| DENORM (const DENORM &) |
DENORM & | operator= (const DENORM &) |
| ~DENORM () |
void | SetupBLNormalize (const BLOCK *block, const ROW *row, float x_height, const TBOX &word_box, int num_segs, const DENORM_SEG *segs) |
void | SetupNormalization (const BLOCK *block, const ROW *row, const FCOORD *rotation, const DENORM *predecessor, const DENORM_SEG *segs, int num_segs, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift) |
void | LocalNormTransform (const TPOINT &pt, TPOINT *transformed) const |
void | LocalNormTransform (const FCOORD &pt, FCOORD *transformed) const |
void | NormTransform (const TPOINT &pt, TPOINT *transformed) const |
void | NormTransform (const FCOORD &pt, FCOORD *transformed) const |
void | LocalDenormTransform (const TPOINT &pt, TPOINT *original) const |
void | LocalDenormTransform (const FCOORD &pt, FCOORD *original) const |
void | DenormTransform (const TPOINT &pt, TPOINT *original) const |
void | DenormTransform (const FCOORD &pt, FCOORD *original) const |
void | LocalNormBlob (TBLOB *blob) const |
bool | XHeightRange (int unichar_id, const UNICHARSET &unicharset, const TBOX &bbox, inT16 *min_xht, inT16 *max_xht) const |
Pix * | pix () const |
void | set_pix (Pix *pix) |
bool | inverse () const |
void | set_inverse (bool value) |
const DENORM * | RootDenorm () const |
const DENORM * | predecessor () const |
float | x_scale () const |
float | y_scale () const |
const ROW * | row () const |
void | set_row (ROW *row) |
const BLOCK * | block () const |
void | set_block (const BLOCK *block) |
Detailed Description
Definition at line 59 of file normalis.h.
Constructor & Destructor Documentation
DENORM::DENORM |
( |
float |
x, |
|
|
float |
scaling, |
|
|
ROW * |
src |
|
) |
| |
Definition at line 38 of file normalis.cpp.
{
Init();
x_origin_ = x;
y_origin_ = 0.0f;
x_scale_ = y_scale_ = scaling;
row_ = src;
}
DENORM::DENORM |
( |
float |
x, |
|
|
float |
scaling, |
|
|
double |
line_m, |
|
|
double |
line_c, |
|
|
inT16 |
seg_count, |
|
|
DENORM_SEG * |
seg_pts, |
|
|
BOOL8 |
using_row, |
|
|
ROW * |
src |
|
) |
| |
Definition at line 46 of file normalis.cpp.
{
Init();
x_origin_ = x;
y_origin_ = line_c;
x_scale_ = y_scale_ = scaling;
SetSegments(seg_pts, seg_count);
}
DENORM::DENORM |
( |
const DENORM & |
src | ) |
|
Definition at line 63 of file normalis.cpp.
{
num_segs_ = 0;
*this = src;
}
Member Function Documentation
const BLOCK* DENORM::block |
( |
| ) |
const |
|
inline |
void DENORM::DenormTransform |
( |
const TPOINT & |
pt, |
|
|
TPOINT * |
original |
|
) |
| const |
void DENORM::DenormTransform |
( |
const FCOORD & |
pt, |
|
|
FCOORD * |
original |
|
) |
| const |
bool DENORM::inverse |
( |
| ) |
const |
|
inline |
void DENORM::LocalDenormTransform |
( |
const TPOINT & |
pt, |
|
|
TPOINT * |
original |
|
) |
| const |
void DENORM::LocalDenormTransform |
( |
const FCOORD & |
pt, |
|
|
FCOORD * |
original |
|
) |
| const |
Definition at line 217 of file normalis.cpp.
{
FCOORD rotated(pt.
x() - final_xshift_, pt.
y() - final_yshift_);
FCOORD inverse_rotation(rotation_->
x(), -rotation_->
y());
rotated.
rotate(inverse_rotation);
}
original->
set_x(rotated.x() / x_scale_ + x_origin_);
if (num_segs_ > 0)
y_scale = YScaleAtOrigX(original->
x());
original->
set_y(rotated.y() / y_scale + YOriginAtOrigX(original->
x()));
}
void DENORM::LocalNormBlob |
( |
TBLOB * |
blob | ) |
const |
Definition at line 251 of file normalis.cpp.
{
float x_center = (blob_box.
left() + blob_box.
right()) / 2.0
f;
float scale = YScaleAtOrigX(x_center);
}
void DENORM::LocalNormTransform |
( |
const TPOINT & |
pt, |
|
|
TPOINT * |
transformed |
|
) |
| const |
void DENORM::LocalNormTransform |
( |
const FCOORD & |
pt, |
|
|
FCOORD * |
transformed |
|
) |
| const |
Definition at line 177 of file normalis.cpp.
{
FCOORD translated(pt.
x() - x_origin_, pt.
y() - YOriginAtOrigX(pt.
x()));
translated.set_x(translated.x() * x_scale_);
translated.set_y(translated.y() * YScaleAtOrigX(pt.
x()));
translated.rotate(*rotation_);
transformed->
set_x(translated.x() + final_xshift_);
transformed->
set_y(translated.y() + final_yshift_);
}
void DENORM::NormTransform |
( |
const TPOINT & |
pt, |
|
|
TPOINT * |
transformed |
|
) |
| const |
void DENORM::NormTransform |
( |
const FCOORD & |
pt, |
|
|
FCOORD * |
transformed |
|
) |
| const |
Definition at line 71 of file normalis.cpp.
{
Clear();
inverse_ = src.inverse_;
pix_ = src.pix_;
block_ = src.block_;
row_ = src.row_;
if (src.rotation_ ==
NULL)
else
rotation_ =
new FCOORD(*src.rotation_);
predecessor_ = src.predecessor_;
SetSegments(src.segs_, src.num_segs_);
x_origin_ = src.x_origin_;
y_origin_ = src.y_origin_;
x_scale_ = src.x_scale_;
y_scale_ = src.y_scale_;
final_xshift_ = src.final_xshift_;
final_yshift_ = src.final_yshift_;
return *this;
}
Pix* DENORM::pix |
( |
| ) |
const |
|
inline |
const DENORM* DENORM::predecessor |
( |
| ) |
const |
|
inline |
const DENORM* DENORM::RootDenorm |
( |
| ) |
const |
|
inline |
Definition at line 255 of file normalis.h.
{
if (predecessor_ !=
NULL)
return this;
}
const ROW* DENORM::row |
( |
| ) |
const |
|
inline |
void DENORM::set_block |
( |
const BLOCK * |
block | ) |
|
|
inline |
void DENORM::set_inverse |
( |
bool |
value | ) |
|
|
inline |
void DENORM::set_pix |
( |
Pix * |
pix | ) |
|
|
inline |
void DENORM::set_row |
( |
ROW * |
row | ) |
|
|
inline |
void DENORM::SetupBLNormalize |
( |
const BLOCK * |
block, |
|
|
const ROW * |
row, |
|
|
float |
x_height, |
|
|
const TBOX & |
word_box, |
|
|
int |
num_segs, |
|
|
const DENORM_SEG * |
segs |
|
) |
| |
Definition at line 99 of file normalis.cpp.
{
float x_origin = (word_box.
left() + word_box.
right()) / 2.0
f;
float y_origin = 0.0f;
if (num_segs == 0 && row ==
NULL) {
}
x_origin, y_origin, scale, scale,
}
void DENORM::SetupNormalization |
( |
const BLOCK * |
block, |
|
|
const ROW * |
row, |
|
|
const FCOORD * |
rotation, |
|
|
const DENORM * |
predecessor, |
|
|
const DENORM_SEG * |
segs, |
|
|
int |
num_segs, |
|
|
float |
x_origin, |
|
|
float |
y_origin, |
|
|
float |
x_scale, |
|
|
float |
y_scale, |
|
|
float |
final_xshift, |
|
|
float |
final_yshift |
|
) |
| |
Definition at line 143 of file normalis.cpp.
{
Clear();
else
rotation_ =
new FCOORD(*rotation);
SetSegments(segs, num_segs);
x_origin_ = x_origin;
y_origin_ = y_origin;
final_xshift_ = final_xshift;
final_yshift_ = final_yshift;
}
float DENORM::x_scale |
( |
| ) |
const |
|
inline |
bool DENORM::XHeightRange |
( |
int |
unichar_id, |
|
|
const UNICHARSET & |
unicharset, |
|
|
const TBOX & |
bbox, |
|
|
inT16 * |
min_xht, |
|
|
inT16 * |
max_xht |
|
) |
| const |
Definition at line 275 of file normalis.cpp.
{
int min_bottom, max_bottom, min_top, max_top;
&min_top, &max_top);
*min_xht = 0;
*max_xht = 0;
if (bottom < min_bottom - tolerance || bottom > max_bottom + tolerance) {
return false;
}
double min_height = min_top - kBlnBaselineOffset - tolerance;
double max_height = max_top - kBlnBaselineOffset + tolerance;
if (min_height <= 0.0) {
if (height <= 0 || max_height > 0)
} else if (height > 0) {
}
if (max_height > 0.0 && height > 0) {
}
return true;
}
float DENORM::y_scale |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: