# PRC_InitInputPattern*

## C Specification

      #include <nitro/prc.h>

      void PRC_InitInputPattern(
                PRCInputPattern*          pattern,
          void*                           buffer,
          const PRCStrokes*               strokes,
          int                             maxPointCount,
          int                             maxStrokeCount );

      void PRC_InitInputPatternEx(
                PRCInputPattern*          pattern,
          void*                           buffer,
          const PRCStrokes*               strokes,
          int                             maxPointCount,
          int                             maxStrokeCount,
          const PRCInputPatternParam*     param );

## Description

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 store 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`.

## Arguments

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)

## Return Values

None

## See Also

`PRC_GetInputPatternBufferSize`, `PRC_GetInputPatternBufferSizeEx`, `PRCInputPatternParam`, `PRC_GetRecognizedEntry*`, `PRC_ResampleStrokes*`

## Revision History

06/23/2004 Initial version