tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
BLOCK Class Reference

#include <ocrblock.h>

Inheritance diagram for BLOCK:
Collaboration diagram for BLOCK:

Public Member Functions

 BLOCK ()
 
 BLOCK (const char *name, BOOL8 prop, int16_t kern, int16_t space, int16_t xmin, int16_t ymin, int16_t xmax, int16_t ymax)
 
 ~BLOCK ()=default
 
void set_stats (BOOL8 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...
 
BOOL8 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 ICOORDmedian_size () const
 
void set_median_size (int x, int y)
 
Pix * 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...
 
BLOCKoperator= (const BLOCK &source)
 

Public Attributes

PDBLK pdblk
 

Private Attributes

BOOL8 proportional
 
bool right_to_left_
 
int8_t kerning
 
int16_t spacing
 
int16_t pitch
 
int16_t font_class
 
int32_t xheight
 
float cell_over_xheight_
 
STRING filename
 
ROW_LIST rows
 
PARA_LIST paras_
 
C_BLOB_LIST c_blobs
 
C_BLOB_LIST rej_blobs
 
FCOORD re_rotation_
 
FCOORD classify_rotation_
 
FCOORD skew_
 
ICOORD median_size_
 

Friends

class BLOCK_RECT_IT
 

Constructor & Destructor Documentation

◆ BLOCK() [1/2]

BLOCK::BLOCK ( )
inline

◆ BLOCK() [2/2]

BLOCK::BLOCK ( const char *  name,
BOOL8  prop,
int16_t  kern,
int16_t  space,
int16_t  xmin,
int16_t  ymin,
int16_t  xmax,
int16_t  ymax 
)

BLOCK::BLOCK

Constructor for a simple rectangular block.

◆ ~BLOCK()

BLOCK::~BLOCK ( )
default

Member Function Documentation

◆ blob_list()

C_BLOB_LIST* BLOCK::blob_list ( )
inline

get blobs

◆ cell_over_xheight()

float BLOCK::cell_over_xheight ( ) const
inline

◆ check_pitch()

void BLOCK::check_pitch ( )

check proportional

BLOCK::check_pitch

Check whether the block is fixed or prop, set the flag, and set the pitch if it is fixed.

◆ classify_rotation()

FCOORD BLOCK::classify_rotation ( ) const
inline

◆ compress() [1/2]

void BLOCK::compress ( )

shrink white space

BLOCK::compress

Delete space between the rows. (And maybe one day, compress the rows) Fill space of block from top down, left aligning rows.

◆ compress() [2/2]

void BLOCK::compress ( const ICOORD  vec)

shrink white space and move by vector

BLOCK::compress

Compress and move in a single operation.

◆ compute_row_margins()

void BLOCK::compute_row_margins ( )

◆ fixed_pitch()

int32_t BLOCK::fixed_pitch ( ) const
inline

return pitch

◆ font()

int16_t BLOCK::font ( ) const
inline

return font class

◆ kern()

int16_t BLOCK::kern ( ) const
inline

return kerning

◆ median_size()

const ICOORD& BLOCK::median_size ( ) const
inline

◆ name()

const char* BLOCK::name ( ) const
inline

return filename

◆ operator=()

BLOCK & BLOCK::operator= ( const BLOCK source)

BLOCK::operator=

Assignment - duplicate the block structure, but with an EMPTY row list.

◆ para_list()

PARA_LIST* BLOCK::para_list ( )
inline

◆ print()

void BLOCK::print ( FILE *  fp,
bool  dump 
)

dump whole table

BLOCK::print

Print the info on a block

◆ prop()

BOOL8 BLOCK::prop ( ) const
inline

return proportional

◆ re_rotation()

FCOORD BLOCK::re_rotation ( ) const
inline

◆ reflect_polygon_in_y_axis()

void 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.

◆ reject_blobs()

C_BLOB_LIST* BLOCK::reject_blobs ( )
inline

◆ render_mask()

Pix* BLOCK::render_mask ( TBOX mask_box)
inline

◆ restricted_bounding_box()

TBOX BLOCK::restricted_bounding_box ( bool  upper_dots,
bool  lower_dots 
) const

◆ right_to_left()

bool BLOCK::right_to_left ( ) const
inline

◆ rotate()

void BLOCK::rotate ( const FCOORD rotation)

BLOCK::rotate

Rotate the polygon by the given rotation and recompute the bounding_box.

◆ row_list()

ROW_LIST* BLOCK::row_list ( )
inline

get rows

◆ set_cell_over_xheight()

void BLOCK::set_cell_over_xheight ( float  ratio)
inline

◆ set_classify_rotation()

void BLOCK::set_classify_rotation ( const FCOORD rotation)
inline

◆ set_font_class()

void BLOCK::set_font_class ( int16_t  font)
inline

set font class

◆ set_median_size()

void BLOCK::set_median_size ( int  x,
int  y 
)
inline

◆ set_re_rotation()

void BLOCK::set_re_rotation ( const FCOORD rotation)
inline

◆ set_right_to_left()

void BLOCK::set_right_to_left ( bool  value)
inline

◆ set_skew()

void BLOCK::set_skew ( const FCOORD skew)
inline

◆ set_stats()

void BLOCK::set_stats ( BOOL8  prop,
int16_t  kern,
int16_t  space,
int16_t  ch_pitch 
)
inline

set space size etc.

Parameters
propproportional
kerninter char size
spaceinter word size
ch_pitchpitch if fixed

◆ set_xheight()

void BLOCK::set_xheight ( int32_t  height)
inline

set char size

◆ skew()

FCOORD BLOCK::skew ( ) const
inline

◆ sort_rows()

void BLOCK::sort_rows ( )

decreasing y order

BLOCK::sort_rows

Order rows so that they are in order of decreasing Y coordinate

◆ space()

int16_t BLOCK::space ( ) const
inline

return spacing

◆ x_height()

int32_t BLOCK::x_height ( ) const
inline

return xheight

Friends And Related Function Documentation

◆ BLOCK_RECT_IT

friend class BLOCK_RECT_IT
friend

Member Data Documentation

◆ c_blobs

C_BLOB_LIST BLOCK::c_blobs
private

◆ cell_over_xheight_

float BLOCK::cell_over_xheight_
private

◆ classify_rotation_

FCOORD BLOCK::classify_rotation_
private

◆ filename

STRING BLOCK::filename
private

◆ font_class

int16_t BLOCK::font_class
private

◆ kerning

int8_t BLOCK::kerning
private

◆ median_size_

ICOORD BLOCK::median_size_
private

◆ paras_

PARA_LIST BLOCK::paras_
private

◆ pdblk

PDBLK BLOCK::pdblk

◆ pitch

int16_t BLOCK::pitch
private

◆ proportional

BOOL8 BLOCK::proportional
private

◆ re_rotation_

FCOORD BLOCK::re_rotation_
private

◆ rej_blobs

C_BLOB_LIST BLOCK::rej_blobs
private

◆ right_to_left_

bool BLOCK::right_to_left_
private

◆ rows

ROW_LIST BLOCK::rows
private

◆ skew_

FCOORD BLOCK::skew_
private

◆ spacing

int16_t BLOCK::spacing
private

◆ xheight

int32_t BLOCK::xheight
private

The documentation for this class was generated from the following files: