예제 #1
0
        private static IEnumerable <StrokeFit> GetFunctions(TransformedStrokes strokes)
        {
            if (strokes == null)
            {
                return(Enumerable.Empty <StrokeFit>());
            }

            StrokeData strokeData = strokes.GetStrokeData();

            if (strokeData.Points.Length <= 3)
            {
                return(Enumerable.Empty <StrokeFit>());
            }

            return(FitFunctions.Select(f => f(strokeData)).Where(f => f.IsValid).AsParallel().OrderBy(f => f));
        }
예제 #2
0
 public static Task <IEnumerable <StrokeFit> > GetFunctionAsync(TransformedStrokes strokes)
 {
     return(Task.Run(() => GetFunctions(strokes)));
 }