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; } }
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; } }
//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); }
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); }
public void addInkDot(AnotoInkDot inkDot) { _inkDots.Add(inkDot); }
public void addInkDot(AnotoInkDot inkDot) { _inkDots.Add(inkDot); }