1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - PRC - include
3   File:     prc/algo_superfine.h
4 
5   Copyright 2003-2008 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-18#$
14   $Rev: 8573 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NITRO_PRC_ALGO_SUPERFINE_H_
19 #define NITRO_PRC_ALGO_SUPERFINE_H_
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #include <nitro/misc.h>
26 #include <nitro/types.h>
27 #include <nitro/prc/types.h>
28 #include <nitro/prc/common.h>
29 #include <nitro/prc/resample.h>
30 #include <nitro/prc/algo_common.h>
31 
32 /*===========================================================================*
33   Constant Definitions
34  *===========================================================================*/
35 
36 #define PRC_LENGTH_FILTER_DEFAULT_THRESHOLD_SUPERFINE    normalizeSize
37 #define PRC_LENGTH_FILTER_DEFAULT_RATIO_SUPERFINE        3
38 
39 /*===========================================================================*
40   Type Definitions
41  *===========================================================================*/
42 
43 /*---------------------------------------------------------------------------*
44   Parameters for Sample DB Expansion
45     normalizeSize       Normalization Size
46     resampleThreshold   post-normalization resample threshold
47  *---------------------------------------------------------------------------*/
48 typedef PRCPrototypeDBParam_Common PRCPrototypeDBParam_Superfine;
49 
50 /*---------------------------------------------------------------------------*
51   Parameters for Input Pattern Interpretation
52     normalizeSize       Normalization Size
53     resampleThreshold   post-normalization resample threshold
54  *---------------------------------------------------------------------------*/
55 typedef PRCInputPatternParam_Common PRCInputPatternParam_Superfine;
56 
57 /*---------------------------------------------------------------------------*
58   Input-Originating Recognition Pattern
59  *---------------------------------------------------------------------------*/
60 typedef PRCInputPattern_Common PRCInputPattern_Superfine;
61 
62 /*---------------------------------------------------------------------------*
63   Sample DB Expanded in Memory
64  *---------------------------------------------------------------------------*/
65 typedef PRCPrototypeDB_Common PRCPrototypeDB_Superfine;
66 
67 /*---------------------------------------------------------------------------*
68   Parameters for Recognition Processing
69  *---------------------------------------------------------------------------*/
70 typedef struct PRCRecognizeParam_Superfine
71 {
72     int     lengthFilterThreshold;
73     int     lengthFilterRatio;
74 }
75 PRCRecognizeParam_Superfine;
76 
77 
78 
79 /*---------------------------------------------------------------------------*
80   Name:         PRC_Init_Superfine
81 
82   Description:  Initializes pattern recognition API.
83 
84   Arguments:    None.
85 
86   Returns:      None.
87  *---------------------------------------------------------------------------*/
PRC_Init_Superfine(void)88 static inline void PRC_Init_Superfine(void)
89 {
90     PRC_Init_Common();
91 }
92 
93 /*---------------------------------------------------------------------------*
94   Name:         PRC_GetPrototypeDBBufferSize_Superfine
95 
96   Description:  Calculates the work area size required for expanding sample DB.
97 
98   Arguments:    prototypeList   sample pattern list
99 
100   Returns:      required memory capacity for expanding sample DB
101  *---------------------------------------------------------------------------*/
PRC_GetPrototypeDBBufferSize_Superfine(const PRCPrototypeList * prototypeList)102 static inline u32 PRC_GetPrototypeDBBufferSize_Superfine(const PRCPrototypeList *prototypeList)
103 {
104     return PRC_GetPrototypeDBBufferSize_Common(prototypeList);
105 }
106 
107 /*---------------------------------------------------------------------------*
108   Name:         PRC_GetPrototypeDBBufferSizeEx_Superfine
109 
110   Description:  Calculates the work area size required for expanding sample DB.
111 
112   Arguments:    prototypeList   sample pattern list
113                 kindMask        mask for type specification
114                 ignoreDisabledEntries   Whether or not sample DB entries with the enabled flag FALSE are ever expanded.
115 
116                 param           parameters for sample DB expansion
117 
118   Returns:      required memory capacity for expanding sample DB
119  *---------------------------------------------------------------------------*/
120 static inline u32
PRC_GetPrototypeDBBufferSizeEx_Superfine(const PRCPrototypeList * prototypeList,u32 kindMask,BOOL ignoreDisabledEntries,const PRCPrototypeDBParam_Superfine * param)121 PRC_GetPrototypeDBBufferSizeEx_Superfine(const PRCPrototypeList *prototypeList,
122                                          u32 kindMask,
123                                          BOOL ignoreDisabledEntries,
124                                          const PRCPrototypeDBParam_Superfine *param)
125 {
126     return PRC_GetPrototypeDBBufferSizeEx_Common(prototypeList, kindMask, ignoreDisabledEntries,
127                                                  param);
128 }
129 
130 /*---------------------------------------------------------------------------*
131   Name:         PRC_InitPrototypeDB_Superfine
132 
133   Description:  Creates the PRCPrototypeDB structure.
134                 A buffer region larger than the size that PRC_GetPrototypeDBBufferSize returns needs to be set up in the buffer.
135 
136 
137   Arguments:    protoDB         sample DB structure to be initialized
138                 buffer          pointer to memory region used for sample DB expansion
139                                 (Memory area size >= return value of PRC_GetPrototypeDBBufferSize)
140                 prototypeList   sample pattern list
141 
142   Returns:      TRUE if create succeeded.
143  *---------------------------------------------------------------------------*/
144 static inline BOOL
PRC_InitPrototypeDB_Superfine(PRCPrototypeDB_Superfine * protoDB,void * buffer,const PRCPrototypeList * prototypeList)145 PRC_InitPrototypeDB_Superfine(PRCPrototypeDB_Superfine *protoDB,
146                               void *buffer, const PRCPrototypeList *prototypeList)
147 {
148     return PRC_InitPrototypeDB_Common(protoDB, buffer, prototypeList);
149 }
150 
151 /*---------------------------------------------------------------------------*
152   Name:         PRC_InitPrototypeDBEx_Superfine
153 
154   Description:  Creates the PRCPrototypeDB structure.
155                 A buffer region larger than the size that PRC_GetPrototypeDBBufferSize returns needs to be set up in the buffer.
156 
157                 Parameters during expansion can be specified with param.
158 
159   Arguments:    protoDB         sample DB structure to be initialized
160                 buffer          pointer to memory region used for sample DB expansion
161                                 (Memory area size >= return value of PRC_GetPrototypeDBBufferSize)
162                 prototypeList   sample pattern list
163                 kindMask        mask for type specification
164                 ignoreDisabledEntries   Whether or not sample DB entries with the enabled flag FALSE are ever expanded.
165 
166                 param           parameters for sample DB expansion
167 
168   Returns:      TRUE if create succeeded.
169  *---------------------------------------------------------------------------*/
170 static inline BOOL
PRC_InitPrototypeDBEx_Superfine(PRCPrototypeDB_Superfine * protoDB,void * buffer,const PRCPrototypeList * prototypeList,u32 kindMask,BOOL ignoreDisabledEntries,const PRCPrototypeDBParam_Superfine * param)171 PRC_InitPrototypeDBEx_Superfine(PRCPrototypeDB_Superfine *protoDB,
172                                 void *buffer,
173                                 const PRCPrototypeList *prototypeList,
174                                 u32 kindMask,
175                                 BOOL ignoreDisabledEntries,
176                                 const PRCPrototypeDBParam_Superfine *param)
177 {
178     return PRC_InitPrototypeDBEx_Common(protoDB, buffer, prototypeList, kindMask,
179                                         ignoreDisabledEntries, param);
180 }
181 
182 /*---------------------------------------------------------------------------*
183   Name:         PRC_GetInputPatternBufferSize_Superfine
184 
185   Description:  Calculates work area required for expanding pattern data for comparison.
186 
187 
188   Arguments:    maxPointCount   Upper limit of input points (includes stylus up marker)
189                 maxStrokeCount      Upper limit of stroke count
190 
191   Returns:      memory capacity required for expanding pattern
192  *---------------------------------------------------------------------------*/
PRC_GetInputPatternBufferSize_Superfine(int maxPointCount,int maxStrokeCount)193 static inline u32 PRC_GetInputPatternBufferSize_Superfine(int maxPointCount, int maxStrokeCount)
194 {
195     return PRC_GetInputPatternBufferSize_Common(maxPointCount, maxStrokeCount);
196 }
197 
198 /*---------------------------------------------------------------------------*
199   Name:         PRC_InitInputPattern_Superfine
200 
201   Description:  Creates PRCInputPattern structure.
202 
203   Arguments:    pattern             pattern structure to be initialized
204                 buffer              pointer to memory region used for pattern expansion
205                                     (Region size >=return value of PRC_GetInputPatternBufferSize)
206                 strokes             Raw input coordinate value before forming
207                 maxPointCount   Upper limit of input points (includes stylus up marker)
208                 maxStrokeCount      Upper limit of stroke count
209 
210   Returns:      TRUE if create succeeded.
211  *---------------------------------------------------------------------------*/
212 static inline BOOL
PRC_InitInputPattern_Superfine(PRCInputPattern_Superfine * pattern,void * buffer,const PRCStrokes * strokes,int maxPointCount,int maxStrokeCount)213 PRC_InitInputPattern_Superfine(PRCInputPattern_Superfine *pattern,
214                                void *buffer,
215                                const PRCStrokes *strokes, int maxPointCount, int maxStrokeCount)
216 {
217     return PRC_InitInputPattern_Common(pattern, buffer, strokes, maxPointCount, maxStrokeCount);
218 }
219 
220 /*---------------------------------------------------------------------------*
221   Name:         PRC_InitInputPatternEx_Superfine
222 
223   Description:  Creates PRCInputPattern structure.
224                 Specification of parameters for input pattern interpretation can be done with param.
225 
226   Arguments:    pattern             pattern structure to be initialized
227                 buffer              pointer to memory region used for pattern expansion
228                                     (Region size >=return value of PRC_GetInputPatternBufferSize)
229                 strokes             Raw input coordinate value before forming
230                 param               parameters for input pattern interpretation
231 
232   Returns:      TRUE if create succeeded.
233  *---------------------------------------------------------------------------*/
234 static inline BOOL
PRC_InitInputPatternEx_Superfine(PRCInputPattern_Superfine * pattern,void * buffer,const PRCStrokes * strokes,int maxPointCount,int maxStrokeCount,const PRCInputPatternParam_Superfine * param)235 PRC_InitInputPatternEx_Superfine(PRCInputPattern_Superfine *pattern,
236                                  void *buffer,
237                                  const PRCStrokes *strokes,
238                                  int maxPointCount,
239                                  int maxStrokeCount, const PRCInputPatternParam_Superfine *param)
240 {
241     return PRC_InitInputPatternEx_Common(pattern, buffer, strokes, maxPointCount, maxStrokeCount,
242                                          param);
243 }
244 
245 /*---------------------------------------------------------------------------*
246   Name:         PRC_GetRecognitionBufferSizeEx_Superfine
247 
248   Description:  Calculates the work area size required for recognition algorithm.
249 
250 
251   Arguments:    maxPointCount   Upper limit of input points (includes stylus up marker)
252                 maxStrokeCount      Upper limit of stroke count
253                 protoDB     sample DB
254                 param       parameters for recognition processing
255 
256   Returns:      The memory capacity required for the recognition algorithm.
257  *---------------------------------------------------------------------------*/
258 u32
259 
260 
261 PRC_GetRecognitionBufferSizeEx_Superfine(int maxPointCount,
262                                          int maxStrokeCount,
263                                          const PRCPrototypeDB_Superfine *protoDB,
264                                          const PRCRecognizeParam_Superfine *param);
265 
266 /*---------------------------------------------------------------------------*
267   Name:         PRC_GetRecognitionBufferSize_Superfine
268 
269   Description:  Calculates the work area size required for recognition algorithm.
270 
271 
272   Arguments:    maxPointCount   Upper limit of input points (includes stylus up marker)
273                 maxStrokeCount      Upper limit of stroke count
274                 protoDB     sample DB
275 
276   Returns:      The memory capacity required for the recognition algorithm.
277  *---------------------------------------------------------------------------*/
278 static inline u32
PRC_GetRecognitionBufferSize_Superfine(int maxPointCount,int maxStrokeCount,const PRCPrototypeDB_Superfine * protoDB)279 PRC_GetRecognitionBufferSize_Superfine(int maxPointCount,
280                                        int maxStrokeCount, const PRCPrototypeDB_Superfine *protoDB)
281 {
282     return PRC_GetRecognitionBufferSizeEx_Superfine(maxPointCount, maxStrokeCount, protoDB, NULL);
283 }
284 
285 /*---------------------------------------------------------------------------*
286   Name:         PRC_GetRecognizedEntriesEx_Superfine
287 
288   Description:  Compares and recognizes a specific kind entry and input pattern to return the top numRanking ranking of the result.
289 
290 
291   Arguments:    resultEntries   Pointer to array that holds pointer to recognition result.
292                                 If less than the requested number could be recognized, fill in remainder with NULL.
293 
294                 resultScores    pointer to recognition result score array
295                 numRanking      Number of returns to result*
296                 buffer      Pointer to memory region used by recognition algorithm
297                                 (Region size >= return value of PRC_GetRecognitionBufferSize)
298                 input           Input pattern
299                 protoDB     sample DB
300                 kindMask    Take the AND of kind values for each sample DB entry, with any non-zero values considered valid.
301 
302                 param       parameters for recognition processing
303 
304   Returns:      Number of compared patterns in the sample DB
305  *---------------------------------------------------------------------------*/
306 int
307 
308 
309 PRC_GetRecognizedEntriesEx_Superfine(PRCPrototypeEntry **resultEntries,
310                                      fx32 *resultScores,
311                                      int numRanking,
312                                      void *buffer,
313                                      const PRCInputPattern_Superfine *input,
314                                      const PRCPrototypeDB_Superfine *protoDB,
315                                      u32 kindMask, const PRCRecognizeParam_Superfine *param);
316 
317 /*---------------------------------------------------------------------------*
318   Name:         PRC_GetRecognizedEntries_Superfine
319 
320   Description:  Compares and recognizes sample DB input patterns, and returns the top numRanking ranking of the result.
321 
322 
323   Arguments:    resultEntries   Pointer to array that holds pointer to recognition result.
324                                 If less than the requested number could be recognized, fill in remainder with NULL.
325 
326                 resultScores    pointer to recognition result score array
327                 numRanking      the number of items desired to be returned to result*
328                 buffer      Pointer to memory region used by recognition algorithm
329                                 (Region size >= return value of PRC_GetRecognitionBufferSize)
330                 input           Input pattern
331                 protoDB     sample DB
332 
333   Returns:      Number of compared patterns in the sample DB
334  *---------------------------------------------------------------------------*/
335 static inline int
PRC_GetRecognizedEntries_Superfine(PRCPrototypeEntry ** resultEntries,fx32 * resultScores,int numRanking,void * buffer,const PRCInputPattern_Superfine * input,const PRCPrototypeDB_Superfine * protoDB)336 PRC_GetRecognizedEntries_Superfine(PRCPrototypeEntry **resultEntries,
337                                    fx32 *resultScores,
338                                    int numRanking,
339                                    void *buffer,
340                                    const PRCInputPattern_Superfine *input,
341                                    const PRCPrototypeDB_Superfine *protoDB)
342 {
343     return PRC_GetRecognizedEntriesEx_Superfine(resultEntries, resultScores, numRanking, buffer,
344                                                 input, protoDB, PRC_KIND_ALL, NULL);
345 }
346 
347 /*---------------------------------------------------------------------------*
348   Name:         PRC_GetRecognizedEntryEx_Superfine
349 
350   Description:  Compares and recognizes a specific kind entry and input pattern for the sample DB.
351 
352   Arguments:    resultEntry  Pointer that receives pointer to recognized sample DB entry.
353                             If could not recognize, NULL is entered.
354                 buffer      Pointer to memory region used by recognition algorithm
355                             (Region size >= return value of PRC_GetRecognitionBufferSize)
356                 input           Input pattern
357                 protoDB     sample DB
358                 kindMask    Take the AND of kind values for each sample DB entry, with any non-zero values considered valid.
359 
360                 param       parameters for recognition processing
361 
362   Returns:      score value
363  *---------------------------------------------------------------------------*/
364 static inline fx32
PRC_GetRecognizedEntryEx_Superfine(PRCPrototypeEntry ** resultEntry,void * buffer,const PRCInputPattern_Superfine * input,const PRCPrototypeDB_Superfine * protoDB,u32 kindMask,const PRCRecognizeParam_Superfine * param)365 PRC_GetRecognizedEntryEx_Superfine(PRCPrototypeEntry **resultEntry,
366                                    void *buffer,
367                                    const PRCInputPattern_Superfine *input,
368                                    const PRCPrototypeDB_Superfine *protoDB,
369                                    u32 kindMask, const PRCRecognizeParam_Superfine *param)
370 {
371     fx32    score;
372     (void)PRC_GetRecognizedEntriesEx_Superfine(resultEntry, &score, 1, buffer, input, protoDB,
373                                                kindMask, param);
374     return score;
375 }
376 
377 /*---------------------------------------------------------------------------*
378   Name:         PRC_GetRecognizedEntry_Superfine
379 
380   Description:  Compares and recognizes sample DB and input pattern.
381 
382   Arguments:    resultEntry  Pointer that receives pointer to recognized sample DB entry.
383                             If could not recognize, NULL is entered.
384                 buffer      Pointer to memory region used by recognition algorithm
385                             (Region size >= return value of PRC_GetRecognitionBufferSize)
386                 input           Input pattern
387                 protoDB     sample DB
388 
389   Returns:      score value
390  *---------------------------------------------------------------------------*/
391 static inline fx32
PRC_GetRecognizedEntry_Superfine(PRCPrototypeEntry ** resultEntry,void * buffer,const PRCInputPattern_Superfine * input,const PRCPrototypeDB_Superfine * protoDB)392 PRC_GetRecognizedEntry_Superfine(PRCPrototypeEntry **resultEntry,
393                                  void *buffer,
394                                  const PRCInputPattern_Superfine *input,
395                                  const PRCPrototypeDB_Superfine *protoDB)
396 {
397     return PRC_GetRecognizedEntryEx_Superfine(resultEntry, buffer, input, protoDB, PRC_KIND_ALL,
398                                               NULL);
399 }
400 
401 /*---------------------------------------------------------------------------*
402   Name:         PRC_GetInputPatternStrokes_Superfine
403 
404   Description:  Gets dot sequence data from PRCInputPattern structure.
405 
406   Arguments:    strokes:        Obtained dot sequence data
407                                 Overwriting is not permitted.
408                 input           Input pattern
409 
410   Returns:      None.
411  *---------------------------------------------------------------------------*/
412 static inline void
PRC_GetInputPatternStrokes_Superfine(PRCStrokes * strokes,const PRCInputPattern_Superfine * input)413 PRC_GetInputPatternStrokes_Superfine(PRCStrokes *strokes, const PRCInputPattern_Superfine *input)
414 {
415     PRC_GetInputPatternStrokes_Common(strokes, input);
416 }
417 
418 
419 /*===========================================================================*
420   Inline Functions
421  *===========================================================================*/
422 
423 
424 
425 
426 /*===========================================================================*
427   Set as the standard function of the graphics recognition API
428  *===========================================================================*/
429 #ifndef PRC_DEFAULT_ALGORITHM
430 #define PRC_DEFAULT_ALGORITHM "Superfine"
431 
432 /*---------------------------------------------------------------------------*
433   Parameters for Sample DB Expansion
434  *---------------------------------------------------------------------------*/
435 typedef PRCPrototypeDBParam_Superfine PRCPrototypeDBParam;
436 
437 /*---------------------------------------------------------------------------*
438   Parameters for Input Pattern Interpretation
439  *---------------------------------------------------------------------------*/
440 typedef PRCInputPatternParam_Superfine PRCInputPatternParam;
441 
442 /*---------------------------------------------------------------------------*
443   Input-Originating Recognition Pattern
444  *---------------------------------------------------------------------------*/
445 typedef PRCInputPattern_Superfine PRCInputPattern;
446 
447 /*---------------------------------------------------------------------------*
448   Sample DB Expanded in Memory
449  *---------------------------------------------------------------------------*/
450 typedef PRCPrototypeDB_Superfine PRCPrototypeDB;
451 
452 /*---------------------------------------------------------------------------*
453   Parameters for Recognition Processing
454  *---------------------------------------------------------------------------*/
455 typedef PRCRecognizeParam_Superfine PRCRecognizeParam;
456 
457 
458 /*---------------------------------------------------------------------------*
459   Functions
460  *---------------------------------------------------------------------------*/
PRC_Init(void)461 static inline void PRC_Init(void)
462 {
463     PRC_Init_Superfine();
464 }
465 
PRC_GetPrototypeDBBufferSize(const PRCPrototypeList * prototypeList)466 static inline u32 PRC_GetPrototypeDBBufferSize(const PRCPrototypeList *prototypeList)
467 {
468     return PRC_GetPrototypeDBBufferSize_Superfine(prototypeList);
469 }
470 
471 static inline u32
PRC_GetPrototypeDBBufferSizeEx(const PRCPrototypeList * prototypeList,u32 kindMask,BOOL ignoreDisabledEntries,const PRCPrototypeDBParam * param)472 PRC_GetPrototypeDBBufferSizeEx(const PRCPrototypeList *prototypeList,
473                                u32 kindMask,
474                                BOOL ignoreDisabledEntries, const PRCPrototypeDBParam *param)
475 {
476     return PRC_GetPrototypeDBBufferSizeEx_Superfine(prototypeList, kindMask, ignoreDisabledEntries,
477                                                     param);
478 }
479 
480 static inline BOOL
PRC_InitPrototypeDB(PRCPrototypeDB * protoDB,void * buffer,const PRCPrototypeList * prototypeList)481 PRC_InitPrototypeDB(PRCPrototypeDB *protoDB, void *buffer, const PRCPrototypeList *prototypeList)
482 {
483     return PRC_InitPrototypeDB_Superfine(protoDB, buffer, prototypeList);
484 }
485 
486 static inline BOOL
PRC_InitPrototypeDBEx(PRCPrototypeDB * protoDB,void * buffer,const PRCPrototypeList * prototypeList,u32 kindMask,BOOL ignoreDisabledEntries,const PRCPrototypeDBParam * param)487 PRC_InitPrototypeDBEx(PRCPrototypeDB *protoDB,
488                       void *buffer,
489                       const PRCPrototypeList *prototypeList,
490                       u32 kindMask, BOOL ignoreDisabledEntries, const PRCPrototypeDBParam *param)
491 {
492     return PRC_InitPrototypeDBEx_Superfine(protoDB, buffer, prototypeList, kindMask,
493                                            ignoreDisabledEntries, param);
494 }
495 
PRC_GetInputPatternBufferSize(int maxPointCount,int maxStrokeCount)496 static inline u32 PRC_GetInputPatternBufferSize(int maxPointCount, int maxStrokeCount)
497 {
498     return PRC_GetInputPatternBufferSize_Superfine(maxPointCount, maxStrokeCount);
499 }
500 
501 static inline BOOL
PRC_InitInputPattern(PRCInputPattern * pattern,void * buffer,const PRCStrokes * strokes,int maxPointCount,int maxStrokeCount)502 PRC_InitInputPattern(PRCInputPattern *pattern,
503                      void *buffer, const PRCStrokes *strokes, int maxPointCount, int maxStrokeCount)
504 {
505     return PRC_InitInputPattern_Superfine(pattern, buffer, strokes, maxPointCount, maxStrokeCount);
506 }
507 
508 static inline BOOL
PRC_InitInputPatternEx(PRCInputPattern * pattern,void * buffer,const PRCStrokes * strokes,int maxPointCount,int maxStrokeCount,const PRCInputPatternParam * param)509 PRC_InitInputPatternEx(PRCInputPattern *pattern,
510                        void *buffer,
511                        const PRCStrokes *strokes,
512                        int maxPointCount, int maxStrokeCount, const PRCInputPatternParam *param)
513 {
514     return PRC_InitInputPatternEx_Superfine(pattern, buffer, strokes, maxPointCount, maxStrokeCount,
515                                             param);
516 }
517 
518 static inline u32
PRC_GetRecognitionBufferSize(int maxPointCount,int maxStrokeCount,const PRCPrototypeDB_Superfine * protoDB)519 PRC_GetRecognitionBufferSize(int maxPointCount,
520                              int maxStrokeCount, const PRCPrototypeDB_Superfine *protoDB)
521 {
522     return PRC_GetRecognitionBufferSize_Superfine(maxPointCount, maxStrokeCount, protoDB);
523 }
524 
525 static inline u32
PRC_GetRecognitionBufferSizeEx(int maxPointCount,int maxStrokeCount,const PRCPrototypeDB_Superfine * protoDB,const PRCRecognizeParam_Superfine * param)526 PRC_GetRecognitionBufferSizeEx(int maxPointCount,
527                                int maxStrokeCount,
528                                const PRCPrototypeDB_Superfine *protoDB,
529                                const PRCRecognizeParam_Superfine *param)
530 {
531     return PRC_GetRecognitionBufferSizeEx_Superfine(maxPointCount, maxStrokeCount, protoDB, param);
532 }
533 
534 static inline fx32
PRC_GetRecognizedEntry(PRCPrototypeEntry ** resultEntry,void * buffer,const PRCInputPattern * input,const PRCPrototypeDB * protoDB)535 PRC_GetRecognizedEntry(PRCPrototypeEntry **resultEntry,
536                        void *buffer, const PRCInputPattern *input, const PRCPrototypeDB *protoDB)
537 {
538     return PRC_GetRecognizedEntry_Superfine(resultEntry, buffer, input, protoDB);
539 }
540 
541 static inline fx32
PRC_GetRecognizedEntryEx(PRCPrototypeEntry ** resultEntry,void * buffer,const PRCInputPattern * input,const PRCPrototypeDB * protoDB,u32 kindMask,const PRCRecognizeParam * param)542 PRC_GetRecognizedEntryEx(PRCPrototypeEntry **resultEntry,
543                          void *buffer,
544                          const PRCInputPattern *input,
545                          const PRCPrototypeDB *protoDB,
546                          u32 kindMask, const PRCRecognizeParam *param)
547 {
548     return PRC_GetRecognizedEntryEx_Superfine(resultEntry, buffer, input, protoDB, kindMask, param);
549 }
550 
551 static inline int
PRC_GetRecognizedEntries(PRCPrototypeEntry ** resultEntries,fx32 * resultScores,int numRanking,void * buffer,const PRCInputPattern * input,const PRCPrototypeDB * protoDB)552 PRC_GetRecognizedEntries(PRCPrototypeEntry **resultEntries,
553                          fx32 *resultScores,
554                          int numRanking,
555                          void *buffer, const PRCInputPattern *input, const PRCPrototypeDB *protoDB)
556 {
557     return PRC_GetRecognizedEntries_Superfine(resultEntries, resultScores, numRanking, buffer,
558                                               input, protoDB);
559 }
560 
561 static inline int
PRC_GetRecognizedEntriesEx(PRCPrototypeEntry ** resultEntries,fx32 * resultScores,int numRanking,void * buffer,const PRCInputPattern * input,const PRCPrototypeDB * protoDB,u32 kindMask,const PRCRecognizeParam * param)562 PRC_GetRecognizedEntriesEx(PRCPrototypeEntry **resultEntries,
563                            fx32 *resultScores,
564                            int numRanking,
565                            void *buffer,
566                            const PRCInputPattern *input,
567                            const PRCPrototypeDB *protoDB,
568                            u32 kindMask, const PRCRecognizeParam *param)
569 {
570     return PRC_GetRecognizedEntriesEx_Superfine(resultEntries, resultScores, numRanking, buffer,
571                                                 input, protoDB, kindMask, param);
572 }
573 
PRC_GetInputPatternStrokes(PRCStrokes * strokes,const PRCInputPattern * input)574 static inline void PRC_GetInputPatternStrokes(PRCStrokes *strokes, const PRCInputPattern *input)
575 {
576     PRC_GetInputPatternStrokes_Superfine(strokes, input);
577 }
578 
579 #endif // PRC_DEFAULT_ALGORITHM
580 
581 
582 
583 
584 #ifdef __cplusplus
585 } /* extern "C" */
586 #endif
587 
588 /* NITRO_PRC_ALGO_SUPERFINE_H_ */
589 #endif
590