#include <nitro/prc.h>
BOOL PRC_InitInputPattern(
PRCInputPattern* pattern,
void* buffer,
const PRCStrokes* strokes,
int maxPointCount,
int maxStrokeCount );
BOOL PRC_InitInputPatternEx(
PRCInputPattern* pattern,
void* buffer,
const PRCStrokes* strokes,
int maxPointCount,
int maxStrokeCount,
const PRCInputPatternParam* param );
pattern | Pointer to the input pattern structure to be created. |
buffer | Pointer to the memory area that will be used inside pattern . |
strokes | Raw input stroke data. |
maxPointCount | Maximum point count after processing. |
maxStrokeCount | Maximum stroke count after processing. |
param | Other parameter values that are dependent on the recognition algorithm (use NULL as the default). |
Returns TRUE if input pattern data is created successfully.
Converts raw input stroke data into the input pattern data in the PRCInputPattern
type that is used for recognition. First it normalizes and resamples the input stroke data according to the settings specified in param
. Resampling will reduce the number of points in the stroke. Based on these points, this function pre-calculates the length, angles, bounding box, and other values used in recognition and stores them as input pattern data.
buffer
specifies the memory region used internally by inputPattern
. Obtain the amount of memory required using PRC_GetInputPatternBufferSize
, then allocate at least that amount. Do not free buffer
while inputPattern
is in use.
maxPointCount
and maxStrokeCount
determine the maximum numbers of points and strokes, respectively. Resampling will greatly reduce the number of targeted points. This will apply the restrictions specified by maxPointCount
and maxStrokeCount
to the results of that process and store the results in inputPattern
.
For details on normalizing and resampling see PRCInputPatternParam
.
PRC_InitInputPattern
is equivalent to calling PRC_InitInputPatternEx
with param
set to NULL
.
PRC_GetInputPatternBufferSize
, PRC_GetInputPatternBufferSizeEx
, PRCInputPatternParam
, PRC_GetRecognizedEntry*
, PRC_ResampleStrokes*
03/04/2005 Changed return value of BOOL
06/23/2004 Initial Version