1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - PRC - include
3   File:     prc_resample.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_RESAMPLE_H_
19 #define NITRO_PRC_RESAMPLE_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/common.h>
28 #include <nitro/prc/types.h>
29 
30 /*===========================================================================*
31   Constant Definitions
32  *===========================================================================*/
33 
34 /*===========================================================================*
35   Type Definitions
36  *===========================================================================*/
37 
38 
39 
40 /*---------------------------------------------------------------------------*
41   Name:         PRC_ResampleStrokes_None
42 
43   Description:  Does not resample.
44 
45   Arguments:    selectedPoints, pSelectedPointNum: Pointers that return the results.
46                 maxPointCount   Upper limit of input points (includes stylus up marker)
47                 maxStrokeCount      Upper limit of stroke count
48                 strokes             Raw input coordinate value before forming
49                 threshold           Resample threshold
50                 buffer              Work area (sizeof(int)*maxPointCount required)
51 
52   Returns:      TRUE if resampling succeeded.
53  *---------------------------------------------------------------------------*/
54 BOOL
55 
56  PRC_ResampleStrokes_None(u16 *selectedPoints,
57                           int *pSelectedPointNum,
58                           int maxPointCount,
59                           int maxStrokeCount,
60                           const PRCStrokes *strokes, int threshold, void *buffer);
61 
62 /*---------------------------------------------------------------------------*
63   Name:         PRC_ResampleStrokes_Distance
64 
65   Description:  Resamples based on city block distance.
66 
67   Arguments:    selectedPoints, pSelectedPointNum: Pointers that return the results.
68                 maxPointCount   Upper limit of input points (includes stylus up marker)
69                 maxStrokeCount      Upper limit of stroke count
70                 strokes             Raw input coordinate value before forming
71                 threshold           Resample threshold
72                 buffer              Work area (sizeof(int)*maxPointCount required)
73 
74   Returns:      TRUE if resampling succeeded.
75  *---------------------------------------------------------------------------*/
76 BOOL
77 
78  PRC_ResampleStrokes_Distance(u16 *selectedPoints,
79                               int *pSelectedPointNum,
80                               int maxPointCount,
81                               int maxStrokeCount,
82                               const PRCStrokes *strokes, int threshold, void *buffer);
83 
84 /*---------------------------------------------------------------------------*
85   Name:         PRC_ResampleStrokes_Angle
86 
87   Description:  Resamples based on angle.
88 
89   Arguments:    selectedPoints, pSelectedPointNum: Pointers that return the results.
90                 maxPointCount   Upper limit of input points (includes stylus up marker)
91                 maxStrokeCount      Upper limit of stroke count
92                 strokes             Raw input coordinate value before forming
93                 threshold           Resample threshold
94                 buffer              Work area (sizeof(int)*maxPointCount required)
95 
96   Returns:      TRUE if resampling succeeded.
97  *---------------------------------------------------------------------------*/
98 BOOL
99 
100  PRC_ResampleStrokes_Angle(u16 *selectedPoints,
101                            int *pSelectedPointNum,
102                            int maxPointCount,
103                            int maxStrokeCount,
104                            const PRCStrokes *strokes, int threshold, void *buffer);
105 
106 /*---------------------------------------------------------------------------*
107   Name:         PRC_ResampleStrokes_Recursive
108 
109   Description:  Resamples with recursive method.
110 
111   Arguments:    selectedPoints, pSelectedPointNum: Pointers that return the results.
112                 maxPointCount   Upper limit of input points (includes stylus up marker)
113                 maxStrokeCount      Upper limit of stroke count
114                 strokes             Raw input coordinate value before forming
115                 threshold           Resample threshold
116                 buffer              Work area (sizeof(int)*maxPointCount required)
117 
118   Returns:      TRUE if resampling succeeded.
119  *---------------------------------------------------------------------------*/
120 BOOL
121 
122  PRC_ResampleStrokes_Recursive(u16 *selectedPoints,
123                                int *pSelectedPointNum,
124                                int maxPointCount,
125                                int maxStrokeCount,
126                                const PRCStrokes *strokes, int threshold, void *buffer);
127 
128 
129 /*===========================================================================*
130   Inline Functions
131  *===========================================================================*/
132 
133 #ifdef __cplusplus
134 } /* extern "C" */
135 #endif
136 
137 /* NITRO_PRC_RESAMPLE_H_ */
138 #endif
139