MyScript Interactive Ink SDK 4.2.0
Public Member Functions | List of all members
myscript::iink::Recognizer Class Referenceabstract

#include <Recognizer.h>

Public Member Functions

virtual ~Recognizer ()=default
 
virtual void addListener (std::shared_ptr< IRecognizerListener > listener)=0
 
virtual void removeListener (std::shared_ptr< IRecognizerListener > listener)=0
 
virtual std::shared_ptr< Engine > getEngine ()=0
 
virtual void clear ()=0
 
virtual float getScaleX () const =0
 
virtual float getScaleY () const =0
 
virtual String pointerDown (float x, float y, int64_t t, float f)=0
 
virtual void pointerMove (float x, float y, int64_t t, float f)=0
 
virtual void pointerUp (float x, float y, int64_t t, float f)=0
 
virtual void pointerCancel ()=0
 
virtual void pointerEvents (const std::vector< PointerEvent > &events)=0
 
virtual bool isIdle ()=0
 
virtual void waitForIdle ()=0
 
virtual std::shared_ptr< Configuration > getConfiguration ()=0
 
virtual std::vector< MimeType > getSupportedResultMimeTypes ()=0
 
virtual String getResult (MimeType mimeType)=0
 

Detailed Description

The Recognizer runs background handwriting recognition on ink.

Since
2.1

Constructor & Destructor Documentation

◆ ~Recognizer()

virtual myscript::iink::Recognizer::~Recognizer ( )
virtualdefault

Member Function Documentation

◆ addListener()

virtual void myscript::iink::Recognizer::addListener ( std::shared_ptr< IRecognizerListener >  listener)
pure virtual

Adds the specified listener to this recognizer.

Parameters
listenerthe listener to be added.

◆ removeListener()

virtual void myscript::iink::Recognizer::removeListener ( std::shared_ptr< IRecognizerListener >  listener)
pure virtual

Removes the specified listener from this recognizer.

Parameters
listenerthe listener to be removed.

◆ getEngine()

virtual std::shared_ptr< Engine > myscript::iink::Recognizer::getEngine ( )
pure virtual

Returns the Engine to which this recognizer is attached.

Returns
the engine.

◆ clear()

virtual void myscript::iink::Recognizer::clear ( )
pure virtual

Removes all content from the recognizer.

Exceptions
pointer_sequence_errorwhen there is an ongoing pointer trace.

◆ getScaleX()

virtual float myscript::iink::Recognizer::getScaleX ( ) const
pure virtual

Returns the scale to convert input horizontal coordinates unit into mm, such that (X coordinate unit * scaleX = mm).

Returns
the horizontal scale.

◆ getScaleY()

virtual float myscript::iink::Recognizer::getScaleY ( ) const
pure virtual

Returns the scale to convert input vertical coordinates unit into mm, such that (Y coordinate unit * scaleY = mm).

Returns
the vertical scale.

◆ pointerDown()

virtual String myscript::iink::Recognizer::pointerDown ( float  x,
float  y,
int64_t  t,
float  f 
)
pure virtual

Registers a pointer down event.

Parameters
xpointer event x coordinate.
ypointer event y coordinate.
tpointer event timestamp, in ms since Unix EPOCH.
fnormalized pressure, in [0,1].
Returns
the item identifier of the starting stroke if any, otherwise an empty string.
Exceptions
std::invalid_argumentwhen x or y is not a number.
std::invalid_argumentwhen t exceeds year 9999.
std::invalid_argumentwhen f is not a number or is negative.
pointer_sequence_errorwhen pointerDown() has already been called.

◆ pointerMove()

virtual void myscript::iink::Recognizer::pointerMove ( float  x,
float  y,
int64_t  t,
float  f 
)
pure virtual

Registers a pointer move event.

Parameters
xpointer event x coordinate.
ypointer event y coordinate.
tpointer event timestamp, in ms since Unix EPOCH.
fnormalized pressure, in [0,1].
Exceptions
std::invalid_argumentwhen x or y is not a number.
std::invalid_argumentwhen f is not a number or is negative.
std::invalid_argumentwhen t exceeds year 9999.
std::invalid_argumentwhen stroke has too many points.
pointer_sequence_errorwhen pointerDown() has not been called before.

◆ pointerUp()

virtual void myscript::iink::Recognizer::pointerUp ( float  x,
float  y,
int64_t  t,
float  f 
)
pure virtual

Registers a pointer up event.

Parameters
xpointer event x coordinate.
ypointer event y coordinate.
tpointer event timestamp, in ms since Unix EPOCH.
fnormalized pressure, in [0,1].
Exceptions
std::invalid_argumentwhen x or y is not a number.
std::invalid_argumentwhen f is not a number or is negative.
std::invalid_argumentwhen t exceeds year 9999.
pointer_sequence_errorwhen pointerDown() has not been called before.

◆ pointerCancel()

virtual void myscript::iink::Recognizer::pointerCancel ( )
pure virtual

Cancels an ongoing pointer trace.

◆ pointerEvents()

virtual void myscript::iink::Recognizer::pointerEvents ( const std::vector< PointerEvent > &  events)
pure virtual

Sends a series of pointer events.

Parameters
eventsthe list of events.
Exceptions
std::invalid_argumentwhen a pointer event contains incorrect data.
std::invalid_argumentwhen stroke has too many points.
pointer_sequence_errorwhen event sequence is not allowed.

◆ isIdle()

virtual bool myscript::iink::Recognizer::isIdle ( )
pure virtual

Checks whether ongoing operations are over.

Returns
true if no operation is ongoing, otherwise false.

◆ waitForIdle()

virtual void myscript::iink::Recognizer::waitForIdle ( )
pure virtual

Waits until ongoing operations are over.

◆ getConfiguration()

virtual std::shared_ptr< Configuration > myscript::iink::Recognizer::getConfiguration ( )
pure virtual

Returns the configuration associated with this recognizer.

Returns
the recognizer configuration.

◆ getSupportedResultMimeTypes()

virtual std::vector< MimeType > myscript::iink::Recognizer::getSupportedResultMimeTypes ( )
pure virtual

Returns the supported result formats.

Returns
an array of the supported mime types.

◆ getResult()

virtual String myscript::iink::Recognizer::getResult ( MimeType  mimeType)
pure virtual

Returns the result of the recognition since the last call to clear().

Parameters
mimeTypethe mime type that specifies the output format.
Returns
the result as a string.
Exceptions
std::invalid_argumentwhen the specified mime type is not supported.
std::runtime_errorwhen there are some ongoing operations, see isIdle().

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