tesseract v5.3.3.20231005
|
#include <ocrblock.h>
Public Member Functions | |
BLOCK () | |
BLOCK (const char *name, bool prop, int16_t kern, int16_t space, TDimension xmin, TDimension ymin, TDimension xmax, TDimension ymax) | |
~BLOCK ()=default | |
void | set_stats (bool prop, int16_t kern, int16_t space, int16_t ch_pitch) |
void | set_xheight (int32_t height) |
set char size More... | |
void | set_font_class (int16_t font) |
set font class More... | |
bool | prop () const |
return proportional More... | |
bool | right_to_left () const |
void | set_right_to_left (bool value) |
int32_t | fixed_pitch () const |
return pitch More... | |
int16_t | kern () const |
return kerning More... | |
int16_t | font () const |
return font class More... | |
int16_t | space () const |
return spacing More... | |
const char * | name () const |
return filename More... | |
int32_t | x_height () const |
return xheight More... | |
float | cell_over_xheight () const |
void | set_cell_over_xheight (float ratio) |
ROW_LIST * | row_list () |
get rows More... | |
void | compute_row_margins () |
PARA_LIST * | para_list () |
C_BLOB_LIST * | blob_list () |
get blobs More... | |
C_BLOB_LIST * | reject_blobs () |
FCOORD | re_rotation () const |
void | set_re_rotation (const FCOORD &rotation) |
FCOORD | classify_rotation () const |
void | set_classify_rotation (const FCOORD &rotation) |
FCOORD | skew () const |
void | set_skew (const FCOORD &skew) |
const ICOORD & | median_size () const |
void | set_median_size (int x, int y) |
Image | render_mask (TBOX *mask_box) |
TBOX | restricted_bounding_box (bool upper_dots, bool lower_dots) const |
void | reflect_polygon_in_y_axis () |
void | rotate (const FCOORD &rotation) |
void | sort_rows () |
decreasing y order More... | |
void | compress () |
shrink white space More... | |
void | check_pitch () |
check proportional More... | |
void | compress (const ICOORD vec) |
shrink white space and move by vector More... | |
void | print (FILE *fp, bool dump) |
dump whole table More... | |
BLOCK & | operator= (const BLOCK &source) |
![]() | |
ELIST_LINK () | |
ELIST_LINK (const ELIST_LINK &) | |
void | operator= (const ELIST_LINK &) |
Public Attributes | |
PDBLK | pdblk |
Page Description Block. More... | |
Friends | |
class | BLOCK_RECT_IT |
Definition at line 32 of file ocrblock.h.
|
inline |
Definition at line 37 of file ocrblock.h.
tesseract::BLOCK::BLOCK | ( | const char * | name, |
bool | prop, | ||
int16_t | kern, | ||
int16_t | space, | ||
TDimension | xmin, | ||
TDimension | ymin, | ||
TDimension | xmax, | ||
TDimension | ymax | ||
) |
Constructor for a simple rectangular block.
name | filename |
prop | proportional |
kern | kerning |
space | spacing |
xmin | bottom left |
xmax | top right |
Definition at line 34 of file ocrblock.cpp.
|
default |
|
inline |
|
inline |
Definition at line 104 of file ocrblock.h.
void tesseract::BLOCK::check_pitch | ( | ) |
check proportional
Check whether the block is fixed or prop, set the flag, and set the pitch if it is fixed.
Definition at line 164 of file ocrblock.cpp.
|
inline |
Definition at line 135 of file ocrblock.h.
void tesseract::BLOCK::compress | ( | ) |
shrink white space
Delete space between the rows. (And maybe one day, compress the rows) Fill space of block from top down, left aligning rows.
Definition at line 128 of file ocrblock.cpp.
void tesseract::BLOCK::compress | ( | const ICOORD | vec | ) |
shrink white space and move by vector
Compress and move in a single operation.
Definition at line 175 of file ocrblock.cpp.
void tesseract::BLOCK::compute_row_margins | ( | ) |
Definition at line 330 of file ocrblock.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 147 of file ocrblock.h.
|
inline |
Assignment - duplicate the block structure, but with an EMPTY row list.
Definition at line 222 of file ocrblock.cpp.
|
inline |
Definition at line 119 of file ocrblock.h.
void tesseract::BLOCK::print | ( | FILE * | fp, |
bool | dump | ||
) |
dump whole table
Print the info on a block
fp | file to print on |
dump | print full detail |
Definition at line 188 of file ocrblock.cpp.
|
inline |
|
inline |
Definition at line 129 of file ocrblock.h.
void tesseract::BLOCK::reflect_polygon_in_y_axis | ( | ) |
BLOCK::reflect_polygon_in_y_axis
Reflects the polygon in the y-axis and recompute the bounding_box. Does nothing to any contained rows/words/blobs etc.
Definition at line 104 of file ocrblock.cpp.
|
inline |
Definition at line 126 of file ocrblock.h.
Definition at line 155 of file ocrblock.h.
TBOX tesseract::BLOCK::restricted_bounding_box | ( | bool | upper_dots, |
bool | lower_dots | ||
) | const |
Definition at line 88 of file ocrblock.cpp.
|
inline |
Definition at line 74 of file ocrblock.h.
void tesseract::BLOCK::rotate | ( | const FCOORD & | rotation | ) |
Rotate the polygon by the given rotation and recompute the bounding_box.
Definition at line 81 of file ocrblock.cpp.
|
inline |
|
inline |
Definition at line 107 of file ocrblock.h.
|
inline |
Definition at line 138 of file ocrblock.h.
|
inline |
|
inline |
Definition at line 150 of file ocrblock.h.
|
inline |
Definition at line 132 of file ocrblock.h.
|
inline |
Definition at line 77 of file ocrblock.h.
|
inline |
Definition at line 144 of file ocrblock.h.
|
inline |
set space size etc.
prop | proportional |
kern | inter char size |
space | inter word size |
ch_pitch | pitch if fixed |
Definition at line 56 of file ocrblock.h.
|
inline |
|
inline |
Definition at line 141 of file ocrblock.h.
void tesseract::BLOCK::sort_rows | ( | ) |
decreasing y order
Order rows so that they are in order of decreasing Y coordinate
Definition at line 115 of file ocrblock.cpp.
|
inline |
|
inline |
|
friend |
Definition at line 35 of file ocrblock.h.
PDBLK tesseract::BLOCK::pdblk |
Page Description Block.
Definition at line 185 of file ocrblock.h.