BLOCK Class Reference

#include <ocrblock.h>

Inheritance diagram for BLOCK:
ELIST_LINK PDBLK

List of all members.

Public Member Functions

 BLOCK ()
 BLOCK (const char *name, BOOL8 prop, inT16 kern, inT16 space, inT16 xmin, inT16 ymin, inT16 xmax, inT16 ymax)
 ~BLOCK ()
void set_stats (BOOL8 prop, inT16 kern, inT16 space, inT16 ch_pitch)
void set_xheight (inT32 height)
 set char size
void set_font_class (inT16 font)
 set font class
BOOL8 prop () const
 return proportional
bool right_to_left () const
void set_right_to_left (bool value)
inT32 fixed_pitch () const
 return pitch
inT16 kern () const
 return kerning
inT16 font () const
 return font class
inT16 space () const
 return spacing
const char * name () const
 return filename
inT32 x_height () const
 return xheight
float cell_over_xheight () const
void set_cell_over_xheight (float ratio)
ROW_LIST * row_list ()
 get rows
void compute_row_margins ()
PARA_LIST * para_list ()
C_BLOB_LIST * blob_list ()
 get blobs
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 ()
void reflect_polygon_in_y_axis ()
void rotate (const FCOORD &rotation)
void sort_rows ()
 decreasing y order
void compress ()
 shrink white space
void check_pitch ()
 check proportional
void compress (const ICOORD vec)
 shrink white space and move by vector
void print (FILE *fp, BOOL8 dump)
 dump whole table
BLOCKoperator= (const BLOCK &source)

Friends

class BLOCK_RECT_IT

Constructor & Destructor Documentation

BLOCK::BLOCK (  )  [inline]
BLOCK::BLOCK ( const char *  name,
BOOL8  prop,
inT16  kern,
inT16  space,
inT16  xmin,
inT16  ymin,
inT16  xmax,
inT16  ymax 
)

BLOCK::BLOCK

Constructor for a simple rectangular block.

BLOCK::~BLOCK (  )  [inline]

Member Function Documentation

C_BLOB_LIST* BLOCK::blob_list (  )  [inline]

get blobs

float BLOCK::cell_over_xheight (  )  const [inline]
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.

FCOORD BLOCK::classify_rotation (  )  const [inline]
void BLOCK::compress ( const ICOORD  vec  ) 

shrink white space and move by vector

BLOCK::compress

Compress and move in a single operation.

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.

void BLOCK::compute_row_margins (  ) 
inT32 BLOCK::fixed_pitch (  )  const [inline]

return pitch

inT16 BLOCK::font (  )  const [inline]

return font class

inT16 BLOCK::kern (  )  const [inline]

return kerning

const ICOORD& BLOCK::median_size (  )  const [inline]
const char* BLOCK::name (  )  const [inline]

return filename

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

BLOCK::operator=

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

PARA_LIST* BLOCK::para_list (  )  [inline]
void BLOCK::print ( FILE *  fp,
BOOL8  dump 
)

dump whole table

BLOCK::print

Print the info on a block

BOOL8 BLOCK::prop (  )  const [inline]

return proportional

FCOORD BLOCK::re_rotation (  )  const [inline]
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.

C_BLOB_LIST* BLOCK::reject_blobs (  )  [inline]
Pix* BLOCK::render_mask (  )  [inline]
bool BLOCK::right_to_left (  )  const [inline]
void BLOCK::rotate ( const FCOORD rotation  ) 

BLOCK::rotate

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

ROW_LIST* BLOCK::row_list (  )  [inline]

get rows

void BLOCK::set_cell_over_xheight ( float  ratio  )  [inline]
void BLOCK::set_classify_rotation ( const FCOORD rotation  )  [inline]
void BLOCK::set_font_class ( inT16  font  )  [inline]

set font class

void BLOCK::set_median_size ( int  x,
int  y 
) [inline]
void BLOCK::set_re_rotation ( const FCOORD rotation  )  [inline]
void BLOCK::set_right_to_left ( bool  value  )  [inline]
void BLOCK::set_skew ( const FCOORD skew  )  [inline]
void BLOCK::set_stats ( BOOL8  prop,
inT16  kern,
inT16  space,
inT16  ch_pitch 
) [inline]

set space size etc.

Parameters:
prop proportional
kern inter char size
space inter word size
ch_pitch pitch if fixed
void BLOCK::set_xheight ( inT32  height  )  [inline]

set char size

FCOORD BLOCK::skew (  )  const [inline]
void BLOCK::sort_rows (  ) 

decreasing y order

BLOCK::sort_rows

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

inT16 BLOCK::space (  )  const [inline]

return spacing

inT32 BLOCK::x_height (  )  const [inline]

return xheight


Friends And Related Function Documentation

friend class BLOCK_RECT_IT [friend]

Reimplemented from PDBLK.


The documentation for this class was generated from the following files:
Generated on Thu Feb 2 08:19:24 2012 for Tesseract by  doxygen 1.6.3