Skip to content

Instantly share code, notes, and snippets.

@pvorb pvorb/baseapi.cpp
Created Apr 2, 2014

Embed
What would you like to do?
// BASELINE INFORMATION
if (level == PageIteratorLevel::RIL_TEXTLINE) {
int x1, y1, x2, y2;
it->Baseline(level, &x1, &y1, &x2, &y2);
int p0;
float p1;
p0 = bottom - y1;
p1 = ((float) (y1 - y2)) / (x2 - x1);
int f_size;
if (p1 > 0) f_size = 8;
else f_size = 9;
*hocr_str += "; baseline ";
char p1_str[9];
snprintf(p1_str, f_size - 1, "%f", p1);
p1_str[f_size - 1] = '\0';
*hocr_str += p1_str;
hocr_str->add_str_int(" ", p0);
}
// /BASELINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.