#include <cinttypes>
#include <cmath>
#include <cstdint>
#include "elst.h"
#include "elst2.h"
#include "errcode.h"
#include "ocrblock.h"
#include "params.h"
#include "pdblock.h"
#include "points.h"
#include "quspline.h"
#include "rect.h"
#include "scrollview.h"
#include "statistc.h"
#include "stepblob.h"
#include "tprintf.h"
#include "werd.h"
Go to the source code of this file.
|
enum | PITCH_TYPE {
PITCH_DUNNO
, PITCH_DEF_FIXED
, PITCH_MAYBE_FIXED
, PITCH_DEF_PROP
,
PITCH_MAYBE_PROP
, PITCH_CORR_FIXED
, PITCH_CORR_PROP
} |
|
enum | TabType {
TT_NONE
, TT_DELETED
, TT_MAYBE_RAGGED
, TT_MAYBE_ALIGNED
,
TT_CONFIRMED
, TT_VLINE
} |
|
enum | BlobRegionType {
BRT_NOISE
, BRT_HLINE
, BRT_VLINE
, BRT_RECTIMAGE
,
BRT_POLYIMAGE
, BRT_UNKNOWN
, BRT_VERT_TEXT
, BRT_TEXT
,
BRT_COUNT
} |
|
enum | BlobNeighbourDir {
BND_LEFT
, BND_BELOW
, BND_RIGHT
, BND_ABOVE
,
BND_COUNT
} |
|
enum | BlobSpecialTextType {
BSTT_NONE
, BSTT_ITALIC
, BSTT_DIGIT
, BSTT_MATH
,
BSTT_UNCLEAR
, BSTT_SKIP
, BSTT_COUNT
} |
|
enum | BlobTextFlowType {
BTFT_NONE
, BTFT_NONTEXT
, BTFT_NEIGHBOURS
, BTFT_CHAIN
,
BTFT_STRONG_CHAIN
, BTFT_TEXT_ON_IMAGE
, BTFT_LEADER
, BTFT_COUNT
} |
|
|
BlobNeighbourDir | DirOtherWay (BlobNeighbourDir dir) |
|
bool | DominatesInMerge (BlobTextFlowType type1, BlobTextFlowType type2) |
|
void | find_cblob_limits (C_BLOB *blob, float leftx, float rightx, FCOORD rotation, float &ymin, float &ymax) |
|
void | find_cblob_vlimits (C_BLOB *blob, float leftx, float rightx, float &ymin, float &ymax) |
|
void | find_cblob_hlimits (C_BLOB *blob, float bottomy, float topy, float &xmin, float &xymax) |
|
C_BLOB * | crotate_cblob (C_BLOB *blob, FCOORD rotation) |
|
TBOX | box_next (BLOBNBOX_IT *it) |
|
TBOX | box_next_pre_chopped (BLOBNBOX_IT *it) |
|
void | vertical_cblob_projection (C_BLOB *blob, STATS *stats) |
|
void | vertical_coutline_projection (C_OUTLINE *outline, STATS *stats) |
|
void | plot_blob_list (ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour) |
|
◆ BlobNeighbourDir
Enumerator |
---|
BND_LEFT | |
BND_BELOW | |
BND_RIGHT | |
BND_ABOVE | |
BND_COUNT | |
Definition at line 87 of file blobbox.h.
◆ BlobRegionType
Enumerator |
---|
BRT_NOISE | |
BRT_HLINE | |
BRT_VLINE | |
BRT_RECTIMAGE | |
BRT_POLYIMAGE | |
BRT_UNKNOWN | |
BRT_VERT_TEXT | |
BRT_TEXT | |
BRT_COUNT | |
Definition at line 72 of file blobbox.h.
◆ BlobSpecialTextType
Enumerator |
---|
BSTT_NONE | |
BSTT_ITALIC | |
BSTT_DIGIT | |
BSTT_MATH | |
BSTT_UNCLEAR | |
BSTT_SKIP | |
BSTT_COUNT | |
Definition at line 96 of file blobbox.h.
◆ BlobTextFlowType
Enumerator |
---|
BTFT_NONE | |
BTFT_NONTEXT | |
BTFT_NEIGHBOURS | |
BTFT_CHAIN | |
BTFT_STRONG_CHAIN | |
BTFT_TEXT_ON_IMAGE | |
BTFT_LEADER | |
BTFT_COUNT | |
Definition at line 114 of file blobbox.h.
◆ PITCH_TYPE
Enumerator |
---|
PITCH_DUNNO | |
PITCH_DEF_FIXED | |
PITCH_MAYBE_FIXED | |
PITCH_DEF_PROP | |
PITCH_MAYBE_PROP | |
PITCH_CORR_FIXED | |
PITCH_CORR_PROP | |
Definition at line 44 of file blobbox.h.
◆ TabType
Enumerator |
---|
TT_NONE | |
TT_DELETED | |
TT_MAYBE_RAGGED | |
TT_MAYBE_ALIGNED | |
TT_CONFIRMED | |
TT_VLINE | |
Definition at line 59 of file blobbox.h.
◆ box_next()
TBOX box_next |
( |
BLOBNBOX_IT * |
it | ) |
|
Definition at line 636 of file blobbox.cpp.
647 if (blob->
cblob() ==
nullptr)
bool joined_to_prev() const
const TBOX & bounding_box() const
◆ box_next_pre_chopped()
TBOX box_next_pre_chopped |
( |
BLOBNBOX_IT * |
it | ) |
|
◆ crotate_cblob()
Definition at line 611 of file blobbox.cpp.
615 C_OUTLINE_LIST out_list;
617 C_OUTLINE_IT in_it = blob->
out_list ();
619 C_OUTLINE_IT out_it = &out_list;
621 for (in_it.mark_cycle_pt (); !in_it.cycled_list (); in_it.forward ()) {
622 out_it.add_after_then_move (
new C_OUTLINE (in_it.data (), rotation));
624 return new C_BLOB (&out_list);
C_OUTLINE_LIST * out_list()
◆ DirOtherWay()
◆ DominatesInMerge()
Definition at line 129 of file blobbox.h.
134 return type1 >= type2;
◆ find_cblob_hlimits()
void find_cblob_hlimits |
( |
C_BLOB * |
blob, |
|
|
float |
bottomy, |
|
|
float |
topy, |
|
|
float & |
xmin, |
|
|
float & |
xymax |
|
) |
| |
Definition at line 576 of file blobbox.cpp.
587 C_OUTLINE_IT out_it = blob->
out_list ();
589 xmin =
static_cast<float>(INT32_MAX);
590 xmax =
static_cast<float>(-INT32_MAX);
591 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
592 outline = out_it.data ();
594 for (stepindex = 0; stepindex < outline->
pathlength (); stepindex++) {
596 if (pos.
y () >= bottomy && pos.
y () <= topy) {
599 vec = outline->
step (stepindex);
void UpdateRange(const T1 &x, T2 *lower_bound, T2 *upper_bound)
ICOORD step(int index) const
const ICOORD & start_pos() const
int32_t pathlength() const
int16_t y() const
access_function
int16_t x() const
access function
◆ find_cblob_limits()
void find_cblob_limits |
( |
C_BLOB * |
blob, |
|
|
float |
leftx, |
|
|
float |
rightx, |
|
|
FCOORD |
rotation, |
|
|
float & |
ymin, |
|
|
float & |
ymax |
|
) |
| |
Definition at line 499 of file blobbox.cpp.
511 C_OUTLINE_IT out_it = blob->
out_list ();
513 ymin =
static_cast<float>(INT32_MAX);
514 ymax =
static_cast<float>(-INT32_MAX);
515 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
516 outline = out_it.data ();
519 for (stepindex = 0; stepindex < outline->
pathlength (); stepindex++) {
521 if (pos.
x () >= leftx && pos.
x () <= rightx) {
524 vec = outline->
step (stepindex);
void rotate(const FCOORD &vec)
◆ find_cblob_vlimits()
void find_cblob_vlimits |
( |
C_BLOB * |
blob, |
|
|
float |
leftx, |
|
|
float |
rightx, |
|
|
float & |
ymin, |
|
|
float & |
ymax |
|
) |
| |
Definition at line 539 of file blobbox.cpp.
550 C_OUTLINE_IT out_it = blob->
out_list ();
552 ymin =
static_cast<float>(INT32_MAX);
553 ymax =
static_cast<float>(-INT32_MAX);
554 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
555 outline = out_it.data ();
557 for (stepindex = 0; stepindex < outline->
pathlength (); stepindex++) {
559 if (pos.
x () >= leftx && pos.
x () <= rightx) {
562 vec = outline->
step (stepindex);
◆ plot_blob_list()
Definition at line 1086 of file blobbox.cpp.
1090 BLOBNBOX_IT it = list;
1091 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
1092 it.data()->plot(win, body_colour, child_colour);
◆ vertical_cblob_projection()
void vertical_cblob_projection |
( |
C_BLOB * |
blob, |
|
|
STATS * |
stats |
|
) |
| |
Definition at line 868 of file blobbox.cpp.
873 C_OUTLINE_IT out_it = blob->
out_list ();
875 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
void vertical_coutline_projection(C_OUTLINE *outline, STATS *stats)
◆ vertical_coutline_projection()
void vertical_coutline_projection |
( |
C_OUTLINE * |
outline, |
|
|
STATS * |
stats |
|
) |
| |
Definition at line 888 of file blobbox.cpp.
896 C_OUTLINE_IT out_it = outline->
child ();
900 for (stepindex = 0; stepindex < length; stepindex++) {
901 step = outline->
step (stepindex);
903 stats->
add (pos.
x (), -pos.
y ());
904 }
else if (step.
x () < 0) {
905 stats->
add (pos.
x () - 1, pos.
y ());
910 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
void add(int32_t value, int32_t count)
◆ textord_error_weight
double textord_error_weight = 3 |
|
extern |
"Weighting for error in believability"