SCRIBBLE(2)SCRIBBLE(2)
NAME
scribblealloc, recognize – character recognition
SYNOPSIS
#include <u.h> #include <libc.h> #include <draw.h> #include <scribble.h> Scribble *scribblealloc(void); Rune recognize(Scribble *);
DESCRIPTION
The scribble library implements simple character recognition. All characters are drawn using a single stroke of the pen (mouse button 1) as on a palmtop computer.
The library is not really intended for standalone use. Its primary
use is by the scribble graphical control (see
#define CS_LETTERS 0 #define CS_DIGITS 1 #define CS_PUNCTUATION 2 struct Scribble { /* private state */ Point *pt; int ppasize; Stroke ps; Graffiti *graf; int capsLock; int puncShift; int tmpShift; int ctrlShift; int curCharSet; };
This structure encodes the points making up the stroke to be recognized, as well as the character group in which the stroke should be searched.
There are three such groups:
The character to be recognized is encoded as an array of pen_points in the
FILES
SOURCE
This library is adapted from software reproduced by permission:
Copyright © 1999 Keith Packard
Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Keith Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Keith Packard makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Portions of the software Copyright © 1994 by Sun Microsystems Computer Company.
Portions of the software Copyright © 2000 by Compaq Computer Corporation.