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

#include <polyblk.h>

Collaboration diagram for POLY_BLOCK:

Public Member Functions

 POLY_BLOCK ()=default
 
 POLY_BLOCK (const TBOX &tbox, PolyBlockType type)
 
 POLY_BLOCK (ICOORDELT_LIST *points, PolyBlockType type)
 
 ~POLY_BLOCK ()=default
 
TBOXbounding_box ()
 
ICOORDELT_LIST * points ()
 
PolyBlockType isA () const
 
bool IsText () const
 
POLY_BLOCK::compute_bb

Compute the bounding box from the outline points.

void compute_bb ()
 
POLY_BLOCK::rotate

Rotate the POLY_BLOCK.

Parameters
rotationcos, sin of angle
void rotate (FCOORD rotation)
 
POLY_BLOCK::winding_number

Return the winding number of the outline around the given point.

Parameters
pointpoint to wind around
bool contains (POLY_BLOCK *other)
 
int16_t winding_number (const ICOORD &test_pt)
 

Private Attributes

ICOORDELT_LIST vertices
 
TBOX box
 
PolyBlockType type
 

POLY_BLOCK::reflect_in_y_axis

Reflect the coords of the polygon in the y-axis. (Flip the sign of x.)

void reflect_in_y_axis ()
 
void move (ICOORD shift)
 
void plot (ScrollView *window, int32_t num)
 
void fill (ScrollView *window, ScrollView::Color colour)
 
bool overlap (POLY_BLOCK *other)
 
static ScrollView::Color ColorForPolyBlockType (PolyBlockType type)
 Returns a color to draw the given type. More...
 

Constructor & Destructor Documentation

◆ POLY_BLOCK() [1/3]

POLY_BLOCK::POLY_BLOCK ( )
default

◆ POLY_BLOCK() [2/3]

POLY_BLOCK::POLY_BLOCK ( const TBOX tbox,
PolyBlockType  type 
)

◆ POLY_BLOCK() [3/3]

POLY_BLOCK::POLY_BLOCK ( ICOORDELT_LIST *  points,
PolyBlockType  type 
)

◆ ~POLY_BLOCK()

POLY_BLOCK::~POLY_BLOCK ( )
default

Member Function Documentation

◆ bounding_box()

TBOX* POLY_BLOCK::bounding_box ( )
inline

◆ ColorForPolyBlockType()

ScrollView::Color POLY_BLOCK::ColorForPolyBlockType ( PolyBlockType  type)
static

Returns a color to draw the given type.

◆ compute_bb()

void POLY_BLOCK::compute_bb ( )

◆ contains()

bool POLY_BLOCK::contains ( POLY_BLOCK other)
Returns
true if other is inside this.

◆ fill()

void POLY_BLOCK::fill ( ScrollView window,
ScrollView::Color  colour 
)

◆ isA()

PolyBlockType POLY_BLOCK::isA ( ) const
inline

◆ IsText()

bool POLY_BLOCK::IsText ( ) const
inline

◆ move()

void POLY_BLOCK::move ( ICOORD  shift)

POLY_BLOCK::move

Move the POLY_BLOCK.

Parameters
shiftx,y translation vector

◆ overlap()

bool POLY_BLOCK::overlap ( POLY_BLOCK other)
Returns
true if the polygons of other and this overlap.

◆ plot()

void POLY_BLOCK::plot ( ScrollView window,
int32_t  num 
)

◆ points()

ICOORDELT_LIST* POLY_BLOCK::points ( )
inline

◆ reflect_in_y_axis()

void POLY_BLOCK::reflect_in_y_axis ( )

◆ rotate()

void POLY_BLOCK::rotate ( FCOORD  rotation)

◆ winding_number()

int16_t POLY_BLOCK::winding_number ( const ICOORD test_pt)

Member Data Documentation

◆ box

TBOX POLY_BLOCK::box
private

◆ type

PolyBlockType POLY_BLOCK::type
private

◆ vertices

ICOORDELT_LIST POLY_BLOCK::vertices
private

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