#include <ctype.h>
#include <math.h>
#include "errcode.h"
#include "drawtord.h"
#include "blkocc.h"
#include "helpers.h"
Go to the source code of this file.
test_underline
Check to see if the blob is an underline. Return TRUE if it is.
Definition at line 53 of file blkocc.cpp.
78 (
"Testing underline on blob at (%d,%d)->(%d,%d), base=%d\nOccs:",
83 horizontal_cblob_projection(blob, &projection);
86 if (occ <= blob_box.
top () && projection.
pile_count (occ) > desc_occ)
90 for (occ = baseline; occ <= baseline + xheight; occ++)
91 if (occ >= blob_box.
bottom () && occ <= blob_box.
top ()
96 for (occ = baseline + xheight + 1; occ <= blob_box.
top (); occ++)
100 tprintf (
"%d %d %d\n", desc_occ, x_occ, asc_occ);
102 if (desc_occ == 0 && x_occ == 0 && asc_occ == 0) {
103 tprintf (
"Bottom=%d, top=%d, base=%d, x=%d\n",
107 if (desc_occ > x_occ + x_occ
110 if (asc_occ > x_occ + x_occ
111 && asc_occ > blob_width * textord_underline_threshold)
double textord_underline_threshold
bool set_range(inT32 min_bucket_value, inT32 max_bucket_value_plus_1)
TBOX bounding_box() const
inT32 pile_count(inT32 value) const
double textord_underline_threshold = 0.5 |
"Fraction of width occupied"
Definition at line 38 of file blkocc.cpp.