1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>PRC_InitInputPattern*</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">PRC_InitInputPattern* <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD>
15  <PRE><CODE>#include &lt;nitro/prc.h&gt;
16
17BOOL PRC_InitInputPattern(
18    <A href="PRCInputPattern.html">PRCInputPattern</A>*            pattern,
19    void*                       buffer,
20    const <A href="../stroke/PRCStrokes.html">PRCStrokes</A>*       strokes,
21    int                         maxPointCount,
22    int                         maxStrokeCount );
23
24BOOL PRC_InitInputPatternEx(
25    <A href="PRCInputPattern.html">PRCInputPattern</A>*            pattern,
26    void*                       buffer,
27    const <A href="../stroke/PRCStrokes.html">PRCStrokes</A>*           strokes,
28    int                         maxPointCount,
29    int                         maxStrokeCount,
30    const <A href="PRCInputPatternParam.html">PRCInputPatternParam</A>* param );
31</CODE></PRE>
32</DL>
33<H2>Arguments</H2>
34<TABLE border="1" width="100%">
35  <TBODY>
36    <TR>
37<TD width="13%"><CODE>pattern</CODE></TD>
38<TD width="87%">Pointer to the input pattern structure to be created.</TD>
39    </TR>
40    <TR>
41<TD width="13%"><CODE>buffer</CODE></TD>
42<TD width="87%">Pointer to the memory area that will be used inside <code>pattern</code>.</TD>
43    </TR>
44    <TR>
45<TD width="13%"><CODE>strokes</CODE></TD>
46<TD width="87%">Raw input stroke data.</TD>
47    </TR>
48    <TR>
49<TD width="13%"><CODE>maxPointCount</CODE></TD>
50<TD width="87%">Maximum point count after processing.</TD>
51    </TR>
52    <TR>
53<TD width="13%"><CODE>maxStrokeCount</CODE></TD>
54<TD width="87%">Maximum stroke count after processing.</TD>
55    </TR>
56    <TR>
57<TD width="13%"><CODE>param</CODE></TD>
58<TD width="87%">Other parameter values that are dependent on the recognition algorithm (use NULL as the default).</TD>
59    </TR>
60  </TBODY>
61</TABLE>
62<H2>Return Values</H2>
63<P>Returns <CODE>TRUE</CODE> if input pattern data is created successfully.</P>
64<H2>Description</H2>
65<P>Converts raw input stroke data into the input pattern data in the<A href="PRCInputPattern.html"><CODE>PRCInputPattern</CODE></A> type that is used for recognition. First, it normalizes and resamples the input stroke data according to the settings specified in <code>param</code>. 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.</P>
66<P>The <code>buffer</code> argument specifies the memory region used internally by <code>inputPattern</code>. Use the <A href="PRC_GetInputPatternBufferSize.html"><CODE>PRC_GetInputPatternBufferSize</CODE></A> function to get the amount of memory required, and then allocate at least that amount. Do not free <code>buffer</code> while <code>inputPattern</code> is in use.</P>
67<P>The <code>maxPointCount</code> and <code>maxStrokeCount</code> arguments 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 <code>maxPointCount</code> and <code>maxStrokeCount</code> to the results of that process and store the results in <code>inputPattern</code>.</P>
68<P>For details on normalizing and resampling, see <A href="PRCInputPatternParam.html"><CODE>PRCInputPatternParam</CODE></A>.</P>
69<P><code>PRC_InitInputPattern</code> is equivalent to calling <code>PRC_InitInputPatternEx</code> with <code>param</code> set to <code>NULL</code>.</P>
70<H2>See Also</H2>
71<P><A href="PRC_GetInputPatternBufferSize.html"><CODE>PRC_GetInputPatternBufferSize</CODE></a><BR> <a href="PRC_GetInputPatternBufferSize.html"><CODE>PRC_GetInputPatternBufferSizeEx</CODE></a><BR> <a href="PRCInputPatternParam.html"><CODE>PRCInputPatternParam</CODE></a><BR> <a href="PRC_GetRecognizedEntry.html"><CODE>PRC_GetRecognizedEntry*</CODE></a><BR> <a href="PRC_ResampleStrokes.html"><CODE>PRC_ResampleStrokes*</CODE></A></P>
72<H2>Revision History</H2>
73<P>2005/03/04 Changed return value to BOOL.<BR>2004/06/23 Initial version.</P>
74<hr><p>CONFIDENTIAL</p></body>
75</HTML>
76