?? segbreakdet.cc
字號:
//// SegBreakDet - detects all the possible segmant breaks (which are// the freeman bvectors 0,1, and 2.// Input - reads HWRawDataC records from standard in, w/ freeman vect events.// Output - writes HWRawDataC records to standard out w/ seg break events.//// System Include Files.// Local Include Files.#include "HWRawDataC.hh"// Manifest Constants.// Prototypes.void OutputPossSegBreak(HWRawDataC);// Global Variablesint main(int argc, char *argv[]){ // Read off the header and put it back on the output stream. HWHeaderC Header; cin >> Header; cout << Header; // Process all of the data points. int PenDown = 0; HWRawDataC RawData; while(!!(cin >> RawData)) { switch(RawData.Type) { case PEN_UP: // Pass the pen up through. cout << RawData; case FREEMAN_0: // Strip out the freeman vectors. case FREEMAN_1: case FREEMAN_2: case FREEMAN_3: case FREEMAN_4: case FREEMAN_5: case FREEMAN_6: case FREEMAN_7: // This is a freeman vector event. OutputPossSegBreak(RawData); break; default: // Just pass the point through. cout << RawData; break; } }}//// OutputPossSegBreak() - checks to see if a ligature is starting (0,1,2).//void OutputPossSegBreak(HWRawDataC RawData){ static InLigature = 0; static HWRawDataC LastVector; switch(RawData.Type) { case FREEMAN_0: case FREEMAN_1: case FREEMAN_2: if (!InLigature) { // Output the seg break marker with time equal to the end of it. InLigature = 1; cerr << "Ligature start detected, Freeman " << RawData.Type-FREEMAN_0 << ", from " << LastVector.DataPoint << " to " << RawData.DataPoint << " (" << RawData.Time << ")\n"; HWRawDataC PossSegBreak; PossSegBreak.Time = RawData.Time; PossSegBreak.Type = POSS_SEG_BREAK; cout << PossSegBreak; // End of vector. } // This is in a ligature so set bit. InLigature = 1; break; default: InLigature = 0; // May have been a pen up. break; } LastVector = RawData;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -