Example #1
0
 public void extractDataFromRawBytes(byte[] rawBytes)
 {
     _inkDots.Clear();
     int chunkSize = AnotoInkDot.size();
     int offset = 0;
     byte[] chunk = new byte[chunkSize];
     while (offset < rawBytes.Length-chunkSize)
     {
         Array.Copy(rawBytes, offset, chunk, 0, chunkSize);
         AnotoInkDot inkDot = new AnotoInkDot();
         inkDot.parseFromRawBytes(chunk);
         _inkDots.Add(inkDot);
         offset += chunkSize;
     }
 }
Example #2
0
        public void extractDataFromRawBytes(byte[] rawBytes)
        {
            _inkDots.Clear();
            int chunkSize = AnotoInkDot.size();
            int offset    = 0;

            byte[] chunk = new byte[chunkSize];
            while (offset < rawBytes.Length - chunkSize)
            {
                Array.Copy(rawBytes, offset, chunk, 0, chunkSize);
                AnotoInkDot inkDot = new AnotoInkDot();
                inkDot.parseFromRawBytes(chunk);
                _inkDots.Add(inkDot);
                offset += chunkSize;
            }
        }
Example #3
0
        //get total length by accumulating component euclidean distances between dots
        public double getAccumulativeLength()
        {
            AnotoInkDot prevDot     = _inkDots[0];
            double      totalLength = 0;

            foreach (AnotoInkDot inkDot in _inkDots)
            {
                if (inkDot.PaperNoteID != prevDot.PaperNoteID)
                {
                    prevDot = inkDot;
                    continue;
                }
                double distance = Utilities.UtilitiesLib.distanceBetweenTwoPoints(prevDot.X, prevDot.Y,
                                                                                  inkDot.X, inkDot.Y);
                totalLength += distance;
                prevDot      = inkDot;
            }
            return(totalLength);
        }
Example #4
0
        public List <AnotoInkTrace> splitToSingleIDTraces()
        {
            List <AnotoInkTrace> singleIDTraces = new List <AnotoInkTrace>();
            AnotoInkTrace        curTrace       = new AnotoInkTrace();
            AnotoInkDot          prevDot        = _inkDots[0];

            foreach (AnotoInkDot inkDot in _inkDots)
            {
                if (inkDot.PaperNoteID == prevDot.PaperNoteID)
                {
                    curTrace.addInkDot(inkDot);
                }
                else
                {
                    singleIDTraces.Add(curTrace);
                    curTrace = new AnotoInkTrace();
                    curTrace.addInkDot(inkDot);
                }
                prevDot = inkDot;
            }
            return(singleIDTraces);
        }
Example #5
0
 public void addInkDot(AnotoInkDot inkDot)
 {
     _inkDots.Add(inkDot);
 }
Example #6
0
 public void addInkDot(AnotoInkDot inkDot)
 {
     _inkDots.Add(inkDot);
 }