Back to index

texmacs  1.0.7.15
learn_handwriting.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : learn_handwriting.cpp
00004 * DESCRIPTION: Facilities for learning handwriting
00005 * COPYRIGHT  : (C) 2012  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #include "handwriting.hpp"
00013 
00014 /******************************************************************************
00015 * Learning glyphs
00016 ******************************************************************************/
00017 
00018 array<contours>       learned_glyphs;
00019 array<string>         learned_names;
00020 array<array<tree> >   learned_disc1;
00021 array<array<double> > learned_cont1;
00022 array<array<tree> >   learned_disc2;
00023 array<array<double> > learned_cont2;
00024 
00025 void
00026 register_glyph (string name, contours gl) {
00027   array<tree>   disc1;
00028   array<double> cont1;
00029   invariants (gl, 1, disc1, cont1);
00030   array<tree>   disc2;
00031   array<double> cont2;
00032   invariants (gl, 2, disc2, cont2);
00033   learned_names  << name;
00034   learned_glyphs << gl;
00035   learned_disc1  << disc1;
00036   learned_cont1  << cont1;
00037   learned_disc2  << disc2;
00038   learned_cont2  << cont2;
00039   //cout << "Added " << name << ", " << disc1 << "\n";
00040 }