Leaper WaferScan Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILOCRLine Interface Reference

This interface represents a single line of text and is used to access its properties. More...

Inheritance diagram for ILOCRLine:
ILObjects ILObject LOCRLine

Public Member Functions

void Draw (HDC hdc, LPVOCRDrawFlags drawFlags, double zoomX, double zoomY, double panX, double panY)
 
double GetCharHeightMetric (LPVAggregation aggType)
 
double GetCharSpaceMetric (LPVAggregation aggType)
 
double GetCharWidthMetric (LPVAggregation aggType)
 
void GetLineImage (ILImage *img)
 
ILOCRCharItem (int index)
 
- Public Member Functions inherited from ILObjects
int Count ()
 
BOOL Empty ()
 
ILObjectItemObject (int objIndex)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Properties

double Angle [get]
 The angle of the line.
 
ILPoint Center [get]
 The center of the line.
 
double Height [get]
 The height of the line.
 
ILLine Midline [get]
 The middle line of text.
 
ILPolygon Quad [get]
 The region of the line as a quadrangle region.
 
double Space [get]
 The space between the line and its previous line. The first line has -1 space.
 
LString String [get]
 The recognition result.
 
double Width [get]
 The width of the line.
 

Detailed Description

This interface represents a single line of text and is used to access its properties.

Usually you get the LOCRLine object from the ILOCRResult::ItemLine() function. You can then use this interface to access to the line's placement, recognition result, reduced image, etc., and draw the result on graphics windows.

Example Code

Member Function Documentation

◆ Draw()

void Draw ( HDC  hdc,
LPVOCRDrawFlags  drawFlags,
double  zoomX,
double  zoomY,
double  panX,
double  panY 
)

Draw the line of text onto provide device context.

Parameters
[in]drawFlagsControl the drawing behavior, see LPVOCRDrawFlags
See also
Use Draw Functions
Remarks
This function is currently not available on Linux / MacOS platform.

◆ GetCharHeightMetric()

double GetCharHeightMetric ( LPVAggregation  aggType)

Calculate the aggregated metric based on the heights of the characters, for example, maximum height.

Parameters
[in]aggTypeAggregation type, see LPVAggregation for usage.
Return values
valReturn the aggregated metric.
See also
GetCharWidthMetric(), GetCharSpaceMetric()

◆ GetCharSpaceMetric()

double GetCharSpaceMetric ( LPVAggregation  aggType)

Calculate the aggregated metric based on the spaces between the characters, for example, averaging space.

Parameters
[in]aggTypeAggregation type, see LPVAggregation for usage.
Return values
valReturn the aggregated metric.
See also
GetCharWidthMetric(), GetCharHeightMetric()

◆ GetCharWidthMetric()

double GetCharWidthMetric ( LPVAggregation  aggType)

Calculate the aggregated metric based on the widths of the characters, for example, averaging width.

Parameters
[in]aggTypeAggregation type, see LPVAggregation for usage.
Return values
valReturn the aggregated metric.
See also
GetCharHeightMetric(), GetCharSpaceMetric()

◆ GetLineImage()

void GetLineImage ( ILImage img)

Get the reduced image of the line. For italic characters, the image is rectified.

Parameters
[out]imgOutput the line's image

◆ Item()

ILOCRChar* Item ( int  index)

Fetch one character with given index.

Parameters
[in]indexThe input index, it should be a 0-based number smaller than total count.
Return values
resultReturn the character object of given index.