Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1127 lines
49 KiB

  1. /**************************************************************************
  2. * *
  3. * LOWLEVEL.H Created: 28 May 1991. *
  4. * *
  5. * This file contains the items needed for the low word processing *
  6. * part of the recognizer which are needed only in kernel variant. *
  7. * *
  8. **************************************************************************/
  9. #ifndef LOW_LEVEL_INCLUDED
  10. #define LOW_LEVEL_INCLUDED
  11. #include "ams_mg.h"
  12. #include "floats.h"
  13. #define NEW_VERSION _TRUE /* New version - born in Sept.1992 */
  14. #define LOW_INLINE _FALSE /* If small low-level functions should be */
  15. /* expanded inline (as macros). */
  16. #define USE_FRM_WORD _FALSE /* _TRUE - makes it able to provide */
  17. /* formulas wordbreaking and */
  18. /* recogn. enhancing by cost of */
  19. /* code enlarging. */
  20. /* _FALSE- no fromula wordbreaking and */
  21. /* additional enhancement, but */
  22. /* code size reduces. */
  23. /**************************************************************************/
  24. /* CODES OF SPECIAL POINTS */
  25. /**************************************************************************/
  26. /* */
  27. #define EMPTY 0x00 /* empty mark */
  28. #define MINW 0x01 /* wide minimum */
  29. #define MINN 0x02 /* narrow minimum */
  30. #define MAXW 0x03 /* wide maximum */
  31. #define MAXN 0x04 /* narrow maximum */
  32. #define _MINX 0x11 /* */
  33. #define _MAXX 0x13 /* */
  34. #define MINXY 0x21 /* */
  35. #define MAXXY 0x23 /* */
  36. #define MINYX 0x31 /* */
  37. #define MAXYX 0x33 /* */
  38. #define SHELF 0x05 /* shelf */
  39. #define CROSS 0x06 /* crossing */
  40. #define STROKE 0x07 /* stroke */
  41. #define DOT 0x08 /* point */
  42. #define STICK 0x09 /* hypothetical stick */
  43. #define HATCH 0x0a /* crossing with the stroke */
  44. /* #define BIRD 0x12 */ /* */
  45. /* #define STAFF 0x21 */ /* */
  46. #define ANGLE 0x0b /* angle */
  47. #define BEG 0x10 /* beginning of unbroken group of points */
  48. #define END 0x20 /* end of the unbroken group of points */
  49. #define DROP 0x44 /* break */
  50. //GIT - new marks for SDS
  51. #define SDS_INTERSECTED 0x80
  52. #define SDS_ISOLATE 0x81
  53. /* */
  54. /**************************************************************************/
  55. /* Constants - direction setters for extrema searching. */
  56. /* They are bits in the variable and may be combined using "|". */
  57. /**************************************************************************/
  58. #define EMPTY_DIR 0x0000
  59. #define X_DIR 0x0001
  60. #define Y_DIR 0x0002
  61. #define XY_DIR 0x0004
  62. #define YX_DIR 0x0008
  63. /**************************************************************************/
  64. /* CONSTANTS DEFINITION */
  65. /**************************************************************************/
  66. /* */
  67. #define MAXBUF 8000 /* max size */
  68. /* buffer of data */
  69. #define LOWBUF (MAXBUF+3) /* size of buffer for */
  70. /* lower level. */
  71. #define SPECVAL 640 /* masssive measurity */
  72. /* structure of special*/
  73. /* points . */
  74. #define N_GR_BORD 50 /* Size of an array of */
  75. /* moveable SPECL elems*/
  76. #define N_ABSNUM 50 /* Size of an array of */
  77. /* moveable SPECL elems*/
  78. #define UMSPC 50 /* */
  79. /* */
  80. #define N_SDS 200 /* Size of SDS array */
  81. /* */
  82. #define LENTH_E 64 /* */
  83. /* */
  84. #define LENTH_Q 64 /* */
  85. /* */
  86. #define LENTH_S 128 /* */
  87. /* */
  88. #define ALEF 32767 /* the biggest number */
  89. /* y (for regime EGA ).*/
  90. #define SQRT_ALEF 181 /* sqrt(ALEF) */
  91. /* */
  92. #define ELEM 0 /* the smallest */
  93. /* bite number */
  94. /* without sign */
  95. #define BREAK -1 /* number-symbol of */
  96. /* style break */
  97. #define RIGHT 319 /* the most right point*/
  98. /* */
  99. #define CONSTVAL 8 /* max number of files */
  100. /* with constants */
  101. /* */
  102. #define ABSENCE 1 /* */
  103. /* */
  104. #define NOABSENCE 0 /* */
  105. /* */
  106. #define CELLSIZE 7 /*size of rastre square*/
  107. /* */
  108. #define END_OF_WORDS 0xff /* End of list */
  109. /* */
  110. #define UNDEF -2 /* Undef value for in- */
  111. /* dexes in arrays etc.*/
  112. /* */
  113. /* */
  114. /***************************************************************************/
  115. /* STRUCTURE OF DATA FOR LOW LEVEL */
  116. /***************************************************************************/
  117. /*------------------------------------------------------------------------*/
  118. #if defined(FOR_GERMAN) || defined(FOR_FRENCH) || defined(FOR_INTERNATIONAL)
  119. typedef struct
  120. {
  121. _SHORT GroupNum ;
  122. _SHORT numMin ;
  123. _CHAR tH ;
  124. _CHAR bH ;
  125. _CHAR UmEls ;
  126. _CHAR ElsUm ;
  127. _CHAR UmDot ;
  128. _CHAR DotUm ;
  129. _CHAR UmStr ;
  130. _CHAR StrUm ;
  131. _CHAR UmCom ;
  132. _CHAR ComUm ;
  133. _CHAR CrossFeature ;
  134. _CHAR PositionFeature ;
  135. }
  136. _UM_MARKS ,
  137. _PTR p_UM_MARKS ;
  138. typedef struct
  139. {
  140. p_UM_MARKS pUmMarks ;
  141. _SHORT Um_buf_Len ;
  142. _SHORT tmpUMnumber ;
  143. _SHORT termSpecl ;
  144. _SHORT termSpecl1 ;
  145. }
  146. _UM_MARKS_CONTROL , _PTR p_UM_MARKS_CONTROL ;
  147. #endif /* FOR_GERMAN... */
  148. /********************************************************/
  149. /* Lines description structures: */
  150. /********************************************************/
  151. typedef struct SDB_TYPE
  152. {
  153. _SHORT s ;
  154. _SHORT a ;
  155. _SHORT dL ;
  156. _SHORT iLmax ;
  157. _SHORT dR ;
  158. _SHORT iRmax ;
  159. _SHORT d ;
  160. _SHORT imax ;
  161. _LONG l ;
  162. _SHORT cr ;
  163. _SHORT ld ;
  164. _SHORT lg ;
  165. } _SAD ;
  166. typedef _SAD _PTR p_SAD ;
  167. /* cr == (BASE*d/s); "Curvity" */
  168. /* ld == (BASE*l/s); */
  169. /* lg == (BASE*l/(length of all part between breaks)); */
  170. /* ooo "l" */
  171. /* ooooooo | ooo */
  172. /* ooo | o ooOO */
  173. /* ooo | oo ooo */
  174. /* oo | oo oo */
  175. /* oo | "d" o o */
  176. /* ------- OO -------------- | ---------- o --------- o ---------- */
  177. /* ------- "s"| o o */
  178. /* ------------ o o */
  179. /* "a" - slope of this > --------OO oo */
  180. /* (BASE*"dy"/"dx") oo oo */
  181. /* ooo */
  182. typedef struct _SDS_TYPE
  183. {
  184. _SHORT mark ;
  185. _SHORT ibeg ;
  186. _SHORT iend ;
  187. _SHORT xmax ;
  188. _SHORT xmin ;
  189. _SHORT ymax ;
  190. _SHORT ymin ;
  191. _SAD des ;
  192. } _SDS ;
  193. typedef _SDS _PTR p_SDS ;
  194. typedef struct _SDS_CONTROL_TYPE
  195. {
  196. _SHORT sizeSDS ;
  197. _SHORT iBegLock_SDS ;
  198. _SHORT lenSDS ;
  199. p_SDS pSDS ;
  200. }
  201. _SDS_CONTROL ;
  202. typedef _SDS_CONTROL _PTR p_C_SDS ;
  203. /* links description structure */
  204. typedef enum
  205. {
  206. ARC_UNKNOWN = 0 ,
  207. ARC_LEFT ,
  208. ARC_RIGHT ,
  209. ARC_UP ,
  210. ARC_DOWN ,
  211. ARC_UP_LEFT ,
  212. ARC_DOWN_LEFT ,
  213. ARC_UP_RIGHT ,
  214. ARC_DOWN_RIGHT ,
  215. ARC_LINE_VERT ,
  216. ARC_LINE_HOR ,
  217. ARC_LINE_SLASH ,
  218. ARC_LINE_BACKSLASH ,
  219. ARC_S_LIKE ,
  220. ARC_Z_LIKE ,
  221. ARC_SHORT
  222. }
  223. _ARC_TYPE ;
  224. /* new links description structure */
  225. typedef enum
  226. {
  227. LINK_UNKNOWN = 0, // 0
  228. LINK_HCR_CCW , // 1
  229. LINK_LCR_CCW , // 2
  230. LINK_MCR_CCW , // 3
  231. LINK_SCR_CCW , // 4
  232. LINK_TCR_CCW , // 5
  233. LINK_LINE , // 6
  234. LINK_TCR_CW , // 7
  235. LINK_SCR_CW , // 8
  236. LINK_MCR_CW , // 9
  237. LINK_LCR_CW , // 10
  238. LINK_HCR_CW , // 11
  239. LINK_HS_LIKE , // 12
  240. LINK_S_LIKE , // 13
  241. LINK_Z_LIKE , // 14
  242. LINK_HZ_LIKE // 15
  243. }
  244. _LINK_TYPE ;
  245. /*--------------- SPECIAL POINTS DESCRIPTOR ------------------------------*/
  246. typedef struct SPEC_TYPE
  247. {
  248. _UCHAR mark ;
  249. _UCHAR code ;
  250. _UCHAR attr ;
  251. _UCHAR other ;
  252. _SHORT ibeg ;
  253. _SHORT iend ;
  254. _SHORT ipoint0 ;
  255. _SHORT ipoint1 ;
  256. struct SPEC_TYPE near * next ;
  257. struct SPEC_TYPE near * prev ;
  258. } SPECL, _PTR p_FSPECL; /* grafy.h definitions */
  259. typedef SPECL near* p_SPECL ;
  260. /*--------------- LIST OF CONSTANTS --------------------------------------*/
  261. typedef struct CON_TYPE /* table for interpolaton constants */
  262. {
  263. _SHORT horda ; /* chord of normalizaton */
  264. _SHORT dlt0 ; /* */
  265. _SHORT nsr ; /* */
  266. _SHORT j_step ; /* beginning steps of crossings */
  267. _SHORT i_step ; /* search */
  268. _SHORT eps_y ; /* environs of extremums marking out*/
  269. _SHORT eps_x ; /* and preliminary marking out */
  270. /* of shelves */
  271. _SHORT eps_py ; /* max.(vertical and horisontal) */
  272. _SHORT eps_px ; /* sizes of 'points */
  273. _SHORT eps_st ; /* max stroke legnth */
  274. _SHORT a0 ; /* */
  275. _SHORT b0 ; /* */
  276. _SHORT lf0 ; /* */
  277. _SHORT lz0 ; /* */
  278. _SHORT a1 ; /* */
  279. _SHORT b1 ; /* */
  280. _SHORT lf1 ; /* */
  281. _SHORT lz1 ; /* */
  282. _SHORT a2 ; /* */
  283. _SHORT b2 ; /* */
  284. _SHORT lf2 ; /* */
  285. _SHORT lz2 ; /* */
  286. _SHORT a3 ; /* */
  287. _SHORT b3 ; /* */
  288. _SHORT lf3 ; /* */
  289. _SHORT lz3 ; /* */
  290. }
  291. CONSTS ;
  292. /*--------------- HEIGHTS ------------------------------------------------*/
  293. typedef struct { /* If y<=y_US_, then height==_US_ */
  294. _SHORT y_US1_ ;
  295. _SHORT y_US2_ ;
  296. _SHORT y_UE1_ ;
  297. _SHORT y_UE2_ ;
  298. _SHORT y_UI1_ ;
  299. _SHORT y_UI2_ ;
  300. _SHORT y_MD_ ;
  301. _SHORT y_DI1_ ;
  302. _SHORT y_DI2_ ;
  303. _SHORT y_DE1_ ;
  304. _SHORT y_DE2_ ;
  305. _SHORT y_DS1_ ;
  306. _SHORT y_DS2_ ;
  307. }
  308. HEIGHTS_DEF ;
  309. /*--------------- BUFFER'S STRUCTURE -------------------------------------*/
  310. typedef struct
  311. {
  312. p_SHORT ptr ; /* Pointer to buffer. */
  313. _SHORT nSize ; /* # of _SHORTs in buffer. */
  314. }
  315. BUF_DESCR, _PTR p_BUF_DESCR ;
  316. /*--------------- NUMBER OF BEGIN & END OF POINTS GROUP ------------------*/
  317. typedef struct
  318. {
  319. _SHORT iBeg ;
  320. _SHORT iEnd ;
  321. _RECT GrBox ;
  322. }
  323. POINTS_GROUP, _PTR p_POINTS_GROUP ;
  324. /*--------------- LOW LEVEL MAIN DATA STRUCTURE --------------------------*/
  325. #define NUM_BUF 4 /* buffers quantity */
  326. typedef struct
  327. {
  328. rc_type _PTR rc ;
  329. BUF_DESCR buffers[NUM_BUF] ;
  330. PS_point_type _PTR p_trace ;
  331. _SHORT nLenXYBuf ;
  332. p_SHORT xBuf ;
  333. p_SHORT yBuf ;
  334. p_SHORT x ;
  335. p_SHORT y ;
  336. _SHORT ii ;
  337. p_SPECL specl ;
  338. _SHORT nMaxLenSpecl ;
  339. _SHORT len_specl ;
  340. _SHORT LastSpeclIndex ;
  341. p_SHORT pAbsnum ;
  342. _SHORT lenabs ;
  343. _SHORT rmAbsnum ;
  344. p_POINTS_GROUP pGroupsBorder ;
  345. _SHORT lenGrBord ;
  346. _SHORT rmGrBord ;
  347. _SHORT iBegBlankGroups ;
  348. #if defined(FOR_GERMAN) || defined(FOR_FRENCH) || defined(FOR_INTERNATIONAL)
  349. p_UM_MARKS_CONTROL pUmMarksControl ;
  350. #endif
  351. p_C_SDS p_cSDS ; /* array of geometric features */
  352. _SHORT VertSticksNum ;
  353. p_POINTS_GROUP pVS_Collector ;
  354. _SHORT padding ;
  355. _SHORT slope ;
  356. _SHORT width_letter ;
  357. _SHORT StepSure ;
  358. _RECT box ;
  359. /* the smallest and the biggest y */
  360. /* the smallest and the biggest x */
  361. HEIGHTS_DEF hght ;
  362. _SHORT o_little ;
  363. _SHORT z_little ;
  364. }
  365. low_type, _PTR p_low_type ;
  366. typedef p_low_type p_LowData ;
  367. #if PG_DEBUG
  368. _VOID draw_SDS(p_low_type low_data);
  369. #endif
  370. _SHORT GetLinkBetweenThisAndNextXr(p_low_type low_data,p_SPECL pXr,
  371. xrd_el_type _PTR xrd_elem);
  372. _SHORT RecountBegEndInSDS(p_low_type low_data);
  373. /* bCalc determines, whether or not to calculate some features in this function */
  374. _SHORT iMostFarDoubleSide( p_SHORT xArray, p_SHORT yArray, p_SDS pSDS,
  375. p_SHORT pxd, p_SHORT pyd, _BOOL bCalc ) ;
  376. /***************************************************************************/
  377. /* FUNCTIONS */
  378. /***************************************************************************/
  379. /*------------------------- module lk_begin ------------------------------*/
  380. _SHORT lk_begin(low_type _PTR low_data); /*beginning working out of elem.*/
  381. _SHORT get_last_in_specl(low_type _PTR low_data);
  382. _SHORT Sort_specl(p_SPECL specl,_SHORT l_specl); /*sorting SPECL in time*/
  383. _SHORT Clear_specl(p_SPECL specl,_SHORT len_specl);
  384. _SHORT extremum(_UCHAR code,_SHORT beg,_SHORT end,_SHORT _PTR y);
  385. /*------------------------ module lk_cross ------------------------------*/
  386. _SHORT lk_cross(low_type _PTR low_data); /*sorting out of elem. crossings*/
  387. /*------------------------ module lk_next ------------------------------*/
  388. /* Parsing of different arcs on the ends: */
  389. _SHORT lk_duga( low_type _PTR low_data );
  390. /*------------------------ module low_3 -------------------------------*/
  391. _SHORT FindDArcs ( low_type _PTR pld ) ; /* see fig. at the */
  392. /* func. text */
  393. /* Checks, if some _IU(D)_s should be _UU(D)_ and vice versa: */
  394. _VOID Adjust_I_U ( low_type _PTR low_data ) ;
  395. _BOOL FindSideExtr( low_type _PTR low_data ) ;
  396. _BOOL PostFindSideExtr( low_type _PTR low_data );
  397. _SHORT RestoreColons( low_type _PTR low_data );
  398. #if !defined (FOR_GERMAN)
  399. _BOOL RestoreApostroph(p_low_type low_data,p_SPECL pCurr); /*Eric*/
  400. #endif
  401. /*------------------------ module breaks -------------------------------*/
  402. _SHORT xt_st_zz(low_type _PTR low_data); /* working out of tear-off parts */
  403. _BOOL find_CROSS(p_low_type low_data,_SHORT ibeg_X,_SHORT iend_X,
  404. p_SPECL _PTR pCross);
  405. /*------------------------ module FILTER -------------------------------*/
  406. _SHORT Filt( low_type _PTR pLowData ,
  407. _SHORT t_horda , _SHORT fl_absence ) ;
  408. _SHORT PreFilt( _SHORT t_horda , low_type _PTR p_low_data ) ;
  409. _VOID Errorprov(low_type _PTR low_data) ; /* check tablete co-ordinates*/
  410. /*------------------------ module INIT_GRF -------------------------------*/
  411. _VOID AcceptEps( _SHORT a,_SHORT b,_SHORT lf,_SHORT lz,p_SHORT eps ) ;
  412. _VOID AcceptNbcut (_VOID) ;
  413. _VOID glob_low_init( _VOID ) ; /* initialisation of globals */
  414. /*----------------------- module CHECK, PICT, CROSS ---------------------*/
  415. _SHORT InitSpecl( low_type _PTR low_data, _SHORT n ) ;
  416. _SHORT InitSpeclElement( SPECL _PTR specl ) ;
  417. _SHORT Mark( low_type _PTR low_data ,
  418. _UCHAR mark , _UCHAR code, _UCHAR attr , _UCHAR other ,
  419. _SHORT begin, _SHORT end , _SHORT ipoint0, _SHORT ipoint1 ) ;
  420. _SHORT MarkSpecl( low_type _PTR low_data , SPECL _PTR p_tmpSpecl ) ;
  421. _BOOL NoteSpecl( low_type _PTR pLowData , SPECL _PTR pTmpSpecl ,
  422. SPECL _PTR pSpecl , _SHORT _PTR pLspecl ,
  423. _SHORT limSpecl ) ;
  424. #if PG_DEBUG
  425. _VOID PaintSpeclElement( low_type _PTR pLowData, SPECL _PTR pNewSpecl,
  426. SPECL _PTR pSpecl , _SHORT _PTR pLspecl );
  427. #endif
  428. p_SPECL LastElemAnyKind ( p_SPECL pSpecl , _UCHAR kind_of_mark ) ;
  429. p_SPECL FirstElemAnyKind ( p_SPECL pSpecl , _UCHAR kind_of_mark ) ;
  430. _SHORT Pict( low_type _PTR low_data ) ;
  431. _SHORT Surgeon( low_type _PTR pLowData ) ;
  432. _SHORT OperateSpeclArray( low_type _PTR pLowData ) ;
  433. #define NO_CONTACT 0x0000
  434. #define END_RESTRICTION 0x0001
  435. #define ANY_OCCUARANCE 0x0002
  436. #define END_INSIDE 0x0004
  437. #define IP0_INSIDE 0x0008
  438. #define BEG_INSIDE 0x0010
  439. #define TOTALY_INSIDE 0x0020
  440. #define TOTALY_COVERED 0x0040
  441. #define MOD_SKIP 0x0080
  442. _SHORT SpcElemFirstOccArr( low_type _PTR pLowData, p_INT pModeWord ,
  443. p_POINTS_GROUP pTrajectoryCut, _UCHAR mark ) ;
  444. #define NREDUCTION 5
  445. #define NREDUCTION_FOR_BORDER 0
  446. _SHORT Extr( low_type _PTR low_data, _SHORT eps_fy,
  447. _SHORT eps_fx , _SHORT eps_fxy , _SHORT eps_fyx ,
  448. _SHORT nMaxReduct , _SHORT extr_axis ) ;
  449. _SHORT Cross( low_type _PTR low_data ) ;
  450. _SHORT Clash( _SHORT _PTR x, _SHORT _PTR y, _SHORT i, _SHORT j,
  451. _SHORT of, _SHORT bf ) ;
  452. /***************************************************************************/
  453. /* module LOW_UTIL */
  454. /***************************************************************************/
  455. #define LEFT_OUTSIDE 1
  456. #define RIGHT_OUTSIDE 2
  457. #define LEFT_SHIFT 3
  458. #define RIGHT_SHIFT 4
  459. #define INSIDE 5
  460. #define COVERS 6
  461. _VOID SetXYToInitial ( low_type _PTR pLowData ) ;
  462. _SHORT LowAlloc( _SHORT _PTR _PTR buffer,
  463. _SHORT num_buffers , _SHORT len_buf ,
  464. low_type _PTR pLowData ) ;
  465. _SHORT low_dealloc( _SHORT _PTR _PTR buffer ) ;
  466. _SHORT alloc_rastr( _ULONG _PTR _PTR rastr ,
  467. _SHORT num_rastrs,_SHORT len_rastr ) ;
  468. _SHORT dealloc_rastr( _ULONG _PTR _PTR rastr ) ;
  469. _BOOL AllocSpecl ( p_SPECL _PTR ppSpecl, _SHORT nElements ) ;
  470. _VOID DeallocSpecl ( p_SPECL _PTR ppSpecl ) ;
  471. _BOOL CreateSDS ( low_type _PTR pLowData , _SHORT nSDS ) ;
  472. _VOID DestroySDS( low_type _PTR pLowData ) ;
  473. _SHORT MaxPointsGrown(
  474. #ifdef FORMULA
  475. _TRACE trace,
  476. #endif /*FORMULA*/
  477. _SHORT nPoints ) ;
  478. /* Max # of points */
  479. /* after "Errorprov" or oth-*/
  480. /* er functions in "x" and */
  481. /* "y" arrays. nPoints - */
  482. /* initial value. */
  483. _INT MaxesCount( p_SHORT xyArr, low_type _PTR pLowData ) ;
  484. /* Counts (and returns) the total number of */
  485. /* x- or y-maxima in the whole trajectory. */
  486. _BOOL BorderForSpecSymbol ( low_type _PTR pLowData , rc_type _PTR rc );
  487. /* If the trace looks like some special */
  488. /* symbol (fraction line,"-","=","+"), then */
  489. /* finds borders for it and returns _TRUE, */
  490. /* otherwise does nothing and returns _FALSE. */
  491. _LONG DistanceSquare ( _INT i1, _INT i2, p_SHORT xAr, p_SHORT yAr ) ;
  492. /* The square of the distance between */
  493. /* points #i1 and #i2. */
  494. #if 0
  495. #define PRESERVE_GLOB_EXTR _TRUE /* For usage as parameter */
  496. /* "bPreserveGlobExtr" in funct- */
  497. /* ion "SmoothXY". */
  498. _BOOL SmoothXY ( p_SHORT x, p_SHORT y,
  499. _INT iLeft, _INT iRight,
  500. _INT nTimes, _BOOL bPreserveGlobExtr );
  501. #endif
  502. /* This function computes the square of the distance of the */
  503. /* point (xPoint,yPoint) to the straight line going through */
  504. /* (x1,y1) and (x2,y2). See figure in the function code. */
  505. _LONG QDistFromChord ( _INT x1, _INT y1,
  506. _INT x2, _INT y2,
  507. _INT xPoint, _INT yPoint );
  508. #define CURV_MAX (1000L)
  509. #define CURV_NORMA (100L)
  510. _SHORT CurvMeasure ( p_SHORT x, p_SHORT y,
  511. _INT iBeg, _INT iEnd,
  512. _INT iMostFar );
  513. /* This function computes the distance whose "circle" */
  514. /* is the 8-angles figure: */
  515. _INT Distance8 ( _INT x1, _INT y1,
  516. _INT x2, _INT y2 );
  517. #if PG_DEBUG
  518. _VOID SetNewAttr ( p_SPECL pElem, _UCHAR hght, _UCHAR fb_dir );
  519. /* Clears attrs and sets */
  520. /* specified height and cir- */
  521. /* cle direction. */
  522. #else
  523. #define SetNewAttr(el,h,fb) (el)->attr = (((h)&_umd_) | ((fb)&_fb_))
  524. #endif
  525. #if (PG_DEBUG || PG_DEBUG_WIN)
  526. p_SPECL BadSPECLPtr (_VOID);
  527. #define REF(elem) ((elem)? (elem):BadSPECLPtr())
  528. #define CHECK_PTR(p) {if ((p)==_NULL) BadSPECLPtr();}
  529. #else
  530. #define REF(elem) (elem)
  531. #define CHECK_PTR(p) {}
  532. #endif /*!(PG_DEBUG || PG_DEBUG_WIN)*/
  533. #define ANY_CROSSING(pElem) ( REF(pElem)->mark==CROSS \
  534. || REF(pElem)->mark==HATCH \
  535. || REF(pElem)->mark==STICK )
  536. #define IU_OR_ID(pElem) (REF(pElem)->code==_IU_ || REF(pElem)->code==_ID_)
  537. /* #define SET_XTST_BITS(pElem) {SetBit(pElem,X_XT); SetBit(pElem,X_ST);}*/
  538. #define NULL_OR_ZZ(pElem) ( (pElem)==_NULL \
  539. || REF(pElem)->code==_ZZZ_ \
  540. || REF(pElem)->code==_ZZ_ \
  541. || REF(pElem)->code==_Z_ \
  542. || REF(pElem)->code==_FF_ )
  543. #define ANY_BREAK(pElem) ( REF(pElem)->code==_ZZZ_ \
  544. || REF(pElem)->code==_ZZ_ \
  545. || REF(pElem)->code==_Z_ \
  546. || REF(pElem)->code==_FF_ )
  547. #define ANY_ARC_WITH_TAIL(pElem) ( REF(pElem)->code==_UUR_ \
  548. || REF(pElem)->code==_UUL_ \
  549. || REF(pElem)->code==_UDR_ \
  550. || REF(pElem)->code==_UDL_)
  551. #define ANY_GAMMA_SMALL(pElem) ( REF(pElem)->code==_GUs_ \
  552. || REF(pElem)->code==_GDs_ \
  553. || REF(pElem)->code==_Gl_ \
  554. || REF(pElem)->code==_Gr_)
  555. #define ANY_ANGLE(pElem) ( REF(pElem)->code==_ANl \
  556. || REF(pElem)->code==_ANr \
  557. || REF(pElem)->code==_AN_UR \
  558. || REF(pElem)->code==_AN_UL \
  559. )
  560. #define XT_OR_ST(pElem) ( REF(pElem)->code==_XT_ \
  561. || REF(pElem)->code==_ST_)
  562. #define ANY_MOVEMENT(pElem) ( REF(pElem)->code==_TZ_ \
  563. || REF(pElem)->code==_TS_ \
  564. || REF(pElem)->code==_BL_ \
  565. || REF(pElem)->code==_BR_)
  566. #if LOW_INLINE
  567. #define IsAnyCrossing(e) ANY_CROSSING(e)
  568. #define Is_IU_or_ID(e) IU_OR_ID(e)
  569. #define NULL_or_ZZ_this(el) NULL_OR_ZZ(el)
  570. #define NULL_or_ZZ_after(el) NULL_or_ZZ_this(REF(el)->next)
  571. #define NULL_or_ZZ_before(el) NULL_or_ZZ_this(REF(el)->prev)
  572. #define IsAnyBreak(el) ANY_BREAK(el)
  573. #define IsAnyArcWithTail(el) ANY_ARC_WITH_TAIL(el)
  574. #define IsAnyGsmall(el) ANY_GAMMA_SMALL(el)
  575. #define IsAnyAngle(el) ANY_ANGLE(el)
  576. #define IsXTorST(el) XT_OR_ST(el)
  577. #define IsAnyMovement(el) ANY_MOVEMENT(el)
  578. #else
  579. _BOOL IsAnyCrossing ( p_SPECL pElem ); /* Checks if the "Elem" has the */
  580. /* HATCH,CROSS or STICK mark. */
  581. _BOOL IsAnyBreak( p_SPECL pElem ); /* Checks if the "Elem" is BREAK*/
  582. _BOOL Is_IU_or_ID ( p_SPECL pElem );
  583. /* _VOID SetXTSTBits ( p_SPECL pElem );*/ /* Sets both XT and ST bits */
  584. /* (frequently used operation). */
  585. _BOOL NULL_or_ZZ_this ( p_SPECL pElem );
  586. _BOOL NULL_or_ZZ_after ( p_SPECL pElem );
  587. _BOOL NULL_or_ZZ_before( p_SPECL pElem );
  588. _BOOL IsAnyArcWithTail(p_SPECL pElem);
  589. _BOOL IsAnyGsmall(p_SPECL pElem);
  590. _BOOL IsAnyAngle(p_SPECL pElem);
  591. _BOOL IsXTorST(p_SPECL pElem);
  592. _BOOL IsAnyMovement(p_SPECL pElem);
  593. #endif /*LOW_INLINE*/
  594. p_SPECL SkipAnglesAfter ( p_SPECL pElem );
  595. p_SPECL SkipAnglesBefore ( p_SPECL pElem );
  596. p_SPECL FindStrongElemAfter ( p_SPECL pElem );
  597. p_SPECL FindStrongElemBefore ( p_SPECL pElem );
  598. _BOOL IsUpperElem ( p_SPECL pElem );
  599. _BOOL IsLowerElem ( p_SPECL pElem );
  600. _BOOL IsStrongElem ( p_SPECL pElem );
  601. _BOOL X_IsBreak ( p_xrd_el_type pXr );
  602. _BOOL X_IsStrongElem( p_xrd_el_type pXr );
  603. _INT iRefPoint( p_SPECL pElem, p_SHORT y );
  604. _UCHAR HeightInLine ( _SHORT y, /* Calculating height in */
  605. low_type _PTR pLowData ); /* the line of the point */
  606. /* with abs.coord "y". */
  607. _UCHAR MidPointHeight ( p_SPECL pElem, low_type _PTR pLowData );
  608. /* The height of the middle point */
  609. /* of the "pElem" */
  610. _INT iMidPointPlato ( _INT iFirst, _INT iToStop, p_SHORT val, p_SHORT y );
  611. _BOOL GetBoxFromTrace ( _TRACE trace,
  612. _INT iLeft, _INT iRight,
  613. p_RECT pRect );
  614. _VOID GetTraceBox ( p_SHORT xArray, p_SHORT yArray,
  615. _INT iLeft, _INT iRight,
  616. p_RECT pRect );
  617. _BOOL GetTraceBoxInsideYZone ( p_SHORT x, p_SHORT y,
  618. _INT ibeg, _INT iend,
  619. _SHORT yUpZone, _SHORT yDnZone,
  620. p_RECT pRect,
  621. p_SHORT ixmax,p_SHORT ixmin,p_SHORT iymax,p_SHORT iymin);
  622. #define size_cross(jb,je,x,y,pr) GetTraceBox((x),(y),(jb),(je),(pr))
  623. /* Values of (*ptRetCod) after "ClosedSquare" worked: */
  624. #define RETC_OK ((_SHORT)0)
  625. #define RETC_NO_PTS_IN_TRAJECTORY ((_SHORT)1)
  626. #define RETC_BREAK_WHERE_SHOULDNT ((_SHORT)2)
  627. _LONG ClosedSquare( p_SHORT xTrace, p_SHORT yTrace,
  628. _INT iBeg, _INT iEnd, p_SHORT ptRetCod );
  629. _LONG TriangleSquare( p_SHORT x, p_SHORT y,
  630. _INT i1, _INT i2, _INT i3 );
  631. _SHORT CurvFromSquare( p_SHORT x, p_SHORT y,
  632. _INT iBeg, _INT iEnd );
  633. _LONG LengthOfTraj( p_SHORT xTrace, p_SHORT yTrace,
  634. _INT iBeg, _INT iEnd, p_LONG pChord ,p_SHORT ptRetCod );
  635. /* Calc. angle cos */
  636. _LONG cos_pointvect ( _INT xbeg1, _INT ybeg1,
  637. _INT xend1, _INT yend1,
  638. _INT xbeg2, _INT ybeg2,
  639. _INT xend2, _INT yend2 );
  640. _LONG cos_vect( _INT beg1, _INT end1, /* beg and end first */
  641. _INT beg2, _INT end2, /* and second vector's */
  642. _SHORT _PTR x, _SHORT _PTR y);
  643. _LONG cos_horizline ( _INT beg1, _INT end1,
  644. _SHORT _PTR x, _SHORT _PTR y);
  645. _LONG cos_normalslope ( _INT beg1, _INT end1,
  646. _INT slope, _SHORT _PTR x, _SHORT _PTR y );
  647. _UCHAR GetBit (p_SPECL elem,_SHORT bitnum);
  648. _BOOL SetBit (p_SPECL elem, _SHORT bitnum);
  649. _BOOL ClrBit (p_SPECL elem, _SHORT bitnum);
  650. _INT ixMin ( _INT iStart, _INT iEnd, p_SHORT xArray, p_SHORT yArray );
  651. _INT ixMax ( _INT iStart, _INT iEnd, p_SHORT xArray, p_SHORT yArray );
  652. _INT iXYweighted_max_right ( p_SHORT xArray, p_SHORT yArray,
  653. _INT iStart, _INT nDepth,
  654. _INT xCoef, _INT yCoef );
  655. _INT iXmax_right ( p_SHORT xArray, p_SHORT yArray,
  656. _INT iStart, _INT nDepth );
  657. _INT iXmin_right ( p_SHORT xArray, p_SHORT yArray,
  658. _INT iStart, _INT nDepth );
  659. _INT iXmax_left ( p_SHORT xArray, p_SHORT yArray,
  660. _INT iStart, _INT nDepth );
  661. _INT iXmin_left ( p_SHORT xArray, p_SHORT yArray,
  662. _INT iStart, _INT nDepth );
  663. #define iYup_right(y,iStart,nDepth) (iXmin_right((y),(y),(iStart),(nDepth)))
  664. #define iYdown_right(y,iStart,nDepth) (iXmax_right((y),(y),(iStart),(nDepth)))
  665. #define iYup_left(y,iStart,nDepth) (iXmin_left((y),(y),(iStart),(nDepth)))
  666. #define iYdown_left(y,iStart,nDepth) (iXmax_left((y),(y),(iStart),(nDepth)))
  667. _BOOL xMinMax ( _INT ibeg, _INT iend,
  668. p_SHORT x, p_SHORT y,
  669. p_SHORT pxMin, p_SHORT pxMax );
  670. _BOOL yMinMax ( _INT ibeg, _INT iend,
  671. p_SHORT y,
  672. p_SHORT pyMin, p_SHORT pyMax );
  673. _INT iyMin ( _INT iStart, _INT iEnd, p_SHORT yArray );
  674. _INT iyMax ( _INT iStart, _INT iEnd, p_SHORT yArray );
  675. _INT iYup_range ( p_SHORT yArray, _INT iStart, _INT iEnd );
  676. _INT iYdown_range ( p_SHORT yArray, _INT iStart, _INT iEnd );
  677. _INT iClosestToXY ( _INT iBeg, _INT iEnd,
  678. p_SHORT xAr, p_SHORT yAr,
  679. _SHORT xRef, _SHORT yRef );
  680. _INT iClosestToY( p_SHORT yAr, _INT iBeg, _INT iEnd, _SHORT yVal );
  681. _BOOL FindCrossPoint ( _SHORT x1, _SHORT y1, _SHORT x2, _SHORT y2,
  682. _SHORT x3, _SHORT y3, _SHORT x4, _SHORT y4,
  683. p_SHORT pxAnswer, p_SHORT pyAnswer );
  684. _BOOL is_cross ( _SHORT x1, _SHORT y1, _SHORT x2, _SHORT y2,
  685. _SHORT x3, _SHORT y3, _SHORT x4, _SHORT y4 );
  686. _INT iMostFarFromChord ( p_SHORT xArray, p_SHORT yArray,
  687. _INT iLeft, _INT iRight );
  688. /* Constants - return values of the "SideExtr" */
  689. /* function: */
  690. /* "NO_SIDE_EXTR" Must be ZERO */
  691. #define NO_SIDE_EXTR 0
  692. #define SIDE_EXTR_LIKE_1ST 1
  693. #define SIDE_EXTR_LIKE_2ND 2
  694. #define SIDE_EXTR_LIKE_1ST_WEAK 3
  695. #define SIDE_EXTR_LIKE_2ND_WEAK 4
  696. #if defined(FOR_GERMAN) || defined(FOR_FRENCH)
  697. #define SIDE_EXTR_TRACE_FOR_er 5
  698. #endif /*FOR_GERMAN*/
  699. /* Constant for usage as "bStrict" argument of "SideExtr": */
  700. #define STRICT_ANGLE_STRUCTURE _TRUE
  701. _INT SideExtr( p_SHORT x, p_SHORT y,
  702. _INT iBeg, _INT iEnd,
  703. _INT nSlope,
  704. p_SHORT xBuf, p_SHORT yBuf,
  705. p_SHORT ind_back,
  706. p_INT piSideExtr,
  707. _BOOL bStrict );
  708. _INT iMostCurvedPoint( p_SHORT x, p_SHORT y,
  709. _INT iBeg, _INT iEnd, _INT nCurvAll );
  710. /* "CurrIndex" finds the current index of the point */
  711. /* with the "ind_old" source index (i.e. on the un- */
  712. /* modified trajectory). Or UNDEF, if this wasn't */
  713. /* found. */
  714. _SHORT CurrIndex ( p_SHORT indBack, _INT ind_old, _INT nIndexes );
  715. _SHORT SlopeShiftDx ( _SHORT dy, _INT slope );
  716. #define STRICT_OVERLAP _TRUE
  717. _BOOL xHardOverlapRect ( p_RECT pr1, p_RECT pr2, _BOOL bStrict );
  718. _BOOL yHardOverlapRect ( p_RECT pr1, p_RECT pr2, _BOOL bStrict );
  719. _BOOL HardOverlapRect ( p_RECT pr1, p_RECT pr2, _BOOL bStrict );
  720. #define STRICT_IN _TRUE
  721. _BOOL SoftInRect ( p_RECT pr1, p_RECT pr2, _BOOL bStrict );
  722. _BOOL IsRightGulfLikeIn3 ( p_SHORT x, p_SHORT y,
  723. _INT iBeg, _INT iEnd,
  724. p_INT piGulf );
  725. _INT brk_right ( p_SHORT yArray,
  726. _INT iStart, _INT iEnd );
  727. _INT brk_left ( p_SHORT yArray,
  728. _INT iStart, _INT iEnd );
  729. _INT nobrk_right ( p_SHORT yArray,
  730. _INT iStart, _INT iEnd );
  731. _INT nobrk_left ( p_SHORT yArray,
  732. _INT iStart, _INT iEnd );
  733. #define _FIRST 0
  734. #define _MEAD 1
  735. #define _LAST 2
  736. _SHORT NewIndex ( p_SHORT indBack , p_SHORT newY ,
  737. _SHORT ind_old , _SHORT nIndexes , _SHORT fl ) ;
  738. _SHORT R_ClosestToLine( p_SHORT xAr, p_SHORT yAr, PS_point_type _PTR pRef,
  739. p_POINTS_GROUP pLine , p_SHORT p_iClosest ) ;
  740. _VOID DefLineThresholds ( p_low_type pLowData ) ;
  741. _LONG SquareDistance ( _SHORT xBeg , _SHORT yBeg,
  742. _SHORT xEnd , _SHORT yEnd );
  743. #define INIT 1
  744. #define NOINIT 0
  745. _SHORT InitGroupsBorder( low_type _PTR pLowData , _SHORT fl_BoxInit ) ;
  746. _INT GetGroupNumber( low_type _PTR pLowData , _INT iPoint ) ;
  747. _BOOL HeightMeasure( _INT iBeg, _INT iEnd, low_type _PTR pLowData ,
  748. p_UCHAR pUpperHeight, p_UCHAR pLowerHeight ) ;
  749. _SHORT IsPointCont( low_type _PTR pLowData, _INT iPoint, _UCHAR mark );
  750. /* Return values of the function "DefineWritingStep": */
  751. //with bUseMediana == _TRUE
  752. #define STEP_INDEPENDENT 0
  753. #define STEP_MEDIANA 1
  754. #define STEP_COMBINED 2
  755. //with bUseMediana == _FALSE
  756. #define STEP_SURE STEP_INDEPENDENT
  757. #define STEP_REJECT STEP_MEDIANA
  758. #define STEP_UNSURE STEP_COMBINED
  759. _SHORT DefineWritingStep( low_type _PTR low_data,
  760. p_SHORT pxWrtStep,
  761. _BOOL bUseMediana );
  762. _BOOL IsInnerAngle ( p_SHORT xArray, p_SHORT yArray,
  763. SPECL _PTR pFrst, SPECL _PTR pLast,
  764. SPECL _PTR pAngle );
  765. _INT CalcDistBetwXr(p_SHORT xTrace,p_SHORT yTrace,
  766. _INT ibeg1,_INT iend1,_INT ibeg2,_INT iend2,
  767. p_SHORT Retcod);
  768. _BOOL CurveHasSelfCrossing( p_SHORT x, p_SHORT y,
  769. _INT iBeg, _INT iEnd,
  770. p_INT pInd1, p_INT pInd2,
  771. _LONG lMinAbsSquare );
  772. #define POINT_ON_BORDER 0
  773. #define POINT_INSIDE 1
  774. #define POINT_OUTSIDE 2
  775. /* in case of moving those two prototypes below, move defines above with them */
  776. _SHORT IsPointInsideArea(p_SHORT pxBorder,p_SHORT pyBorder,_INT NumPntsInBorder,
  777. _SHORT xPoint,_SHORT yPoint,p_SHORT position);
  778. _BOOL IsPointOnBorder(p_SHORT pxBorder,p_SHORT pyBorder,_INT Pnt1st,_INT Pnt2nd,
  779. _SHORT xPoint,_SHORT yPoint,p_BOOL pbIsCross);
  780. _BOOL GetTraceBoxWithoutXT_ST(p_low_type low_data,_INT ibeg,_INT iend,p_RECT pRect);
  781. _BOOL IsPointBelongsToXT_ST(_INT iPoint,p_SPECL specl);
  782. /***************************************************************************/
  783. /* module TRANSFRM */
  784. /***************************************************************************/
  785. _SHORT transfrmN(low_type _PTR low_data); /* */
  786. /***************************************************************************/
  787. /* module OVER */
  788. /***************************************************************************/
  789. _SHORT measure_slope(low_type _PTR low_data); /* calculation of */
  790. /* slope */
  791. /* */
  792. _SHORT def_over(low_type _PTR low_data); /* setting OVR */
  793. /* */
  794. /***************************************************************************/
  795. /* module ANGLE */
  796. /***************************************************************************/
  797. _SHORT angl(low_type _PTR low_data); /* search for angles */
  798. /* */
  799. /* */
  800. _SHORT angle_direction(_SHORT x0, /* calculate any angle direction */
  801. _SHORT y0, /* vector of angle direction*/
  802. _SHORT slope); /* script slope */
  803. /* */
  804. /***************************************************************************/
  805. /* module LU_SPECL */
  806. /***************************************************************************/
  807. p_SPECL NewSPECLElem( low_type _PTR low_data );
  808. _VOID DelFromSPECLList ( p_SPECL pElem );
  809. _VOID DelThisAndNextFromSPECLList ( p_SPECL pElem );
  810. _VOID DelCrossingFromSPECLList ( p_SPECL pElem );
  811. _VOID SwapThisAndNext ( p_SPECL pElem );
  812. _VOID Insert2ndAfter1st ( p_SPECL p1st, p_SPECL p2nd );
  813. _VOID InsertCrossing2ndAfter1st ( p_SPECL p1st, p_SPECL p2nd );
  814. _VOID Move2ndAfter1st ( p_SPECL p1st, p_SPECL p2nd );
  815. _VOID MoveCrossing2ndAfter1st ( p_SPECL p1st, p_SPECL p2nd );
  816. #define ATTACH_2nd_TO_1st(p1,p2) {if (p1) {(p1)->next=(p2); } if(p2)(p2)->prev=(p1);}
  817. #define CROSS_IN_TIME(p1,p2) ( p1 && p2 && (p1)->iend >= (p2)->ibeg \
  818. && (p2)->iend >= (p1)->ibeg )
  819. #define FIRST_IN_SECOND(p1,p2) ( p1 && p2 && (p1)->ibeg >= (p2)->ibeg \
  820. && (p1)->iend <= (p2)->iend )
  821. #if LOW_INLINE
  822. #define Attach2ndTo1st(p1,p2) ATTACH_2nd_TO_1st(p1,p2)
  823. #define CrossInTime(p1,p2) CROSS_IN_TIME(p1,p2)
  824. #define FirstBelongsTo2nd(p1,p2) FIRST_IN_SECOND(p1,p2)
  825. #else
  826. _VOID Attach2ndTo1st ( p_SPECL p1st, p_SPECL p2nd );
  827. _BOOL CrossInTime ( p_SPECL p1st, p_SPECL p2nd ); /* TRUE if some part */
  828. /* of trajectory belongs to */
  829. /* both elems. */
  830. _BOOL FirstBelongsTo2nd ( p_SPECL p1st, p_SPECL p2nd ); /* TRUE if all */
  831. /* trajectory of the 1st elem */
  832. /* is part of that of the 2nd */
  833. /* one */
  834. #endif /*LOW_INLINE*/
  835. _VOID RefreshElem ( p_SPECL pElem,
  836. _UCHAR mark, _UCHAR code, _UCHAR attr
  837. #if !NEW_VERSION
  838. , _SHORT bitToSet
  839. #endif /*NEW_VERSION*/
  840. ); /* Set the fields of "pElem". */
  841. p_SPECL FindMarkRight ( p_SPECL pElem, _UCHAR mark ); /* Goes "next" */
  842. /* until "mark" is found or end */
  843. /* of specl. If pElem->mark==mark*/
  844. /* returns pElem. */
  845. p_SPECL FindMarkLeft ( p_SPECL pElem, _UCHAR mark ); /* Same, but "prev" */
  846. /***************************************************************************/
  847. /* module CONVERT */
  848. /***************************************************************************/
  849. _SHORT exchange( low_type _PTR low_data,
  850. xrdata_type _PTR xrd);
  851. _SHORT form_pseudo_xr_data(low_type _PTR low_data, xrdata_type _PTR xrdata);
  852. /***************************************************************************/
  853. /* module CIRCLE */
  854. /***************************************************************************/
  855. _SHORT Circle(low_type _PTR low_data); /* */
  856. /* */
  857. /***************************************************************************/
  858. /* module frm_word */
  859. /***************************************************************************/
  860. _BOOL MayBeFrline ( p_SHORT xArray, p_SHORT yArray,
  861. _INT iBeg, _INT iEnd,
  862. _SHORT xRange );
  863. /* Possible return values of "chk_sign" function: */
  864. #define SGN_NOT_SIGN 0 /* CHE: This MUST be zero !!! */
  865. #define SGN_SOME 1 /* Some of the possible signs listed */
  866. /* below in "#define"'s */
  867. #define SGN_PLUS 2
  868. #define SGN_EQUAL 3
  869. _SHORT chk_sign ( p_SHORT xArray, p_SHORT yArray,
  870. _INT iBeg, _INT iEnd,
  871. _SHORT xRange, _SHORT yRange );
  872. /* Definition for "chk_slash" function: */
  873. #define WHOLE_TRAJECTORY _TRUE
  874. _BOOL chk_slash (p_SHORT xArray, p_SHORT yArray,
  875. _INT iLeft, _INT iRight,
  876. _SHORT yRange, _BOOL bWholeTrj );
  877. _VOID FindStraightPart ( p_SHORT xArray, p_SHORT yArray,
  878. p_INT piBeg, p_INT piEnd);
  879. _BOOL delta_interval ( p_SHORT xArray, p_SHORT yArray,
  880. _INT iLeft, _INT iRight,
  881. _INT nMaxRectRatio,
  882. _INT nSlope,
  883. p_LONG pldxSum, p_LONG pldySum,
  884. p_LONG plNumIntervals,
  885. _BOOL bThrowBigAndSmall );
  886. #if USE_FRM_WORD
  887. /* Constants for usage as "bIncrementalBreak" parameter values: */
  888. #define INCREMENTAL_BREAK _TRUE
  889. #define NOT_INCREMENTAL_BREAK (!INCREMENTAL_BREAK)
  890. _SHORT FrmWordBreak ( _TRACE trace, _INT nPoints,
  891. _BOOL bIncrementalBreak,
  892. p_SHORT pn1stWrdPoints,
  893. p_SHORT pnFrLinePoints );
  894. _VOID ResetFrmWordBreak(_VOID); /* Should be called before the passing */
  895. /* the first stroke of the new formula. */
  896. /***************************************************************************/
  897. /* module LOW_UTIL */
  898. /***************************************************************************/
  899. _INT brk_left_trace ( PS_point_type _PTR trace,
  900. _INT iStart, _INT iEnd );
  901. _INT nobrk_left_trace ( PS_point_type _PTR trace,
  902. _INT iStart, _INT iEnd );
  903. _INT brk_right_trace ( PS_point_type _PTR trace,
  904. _INT iStart, _INT iEnd );
  905. _INT nobrk_right_trace ( PS_point_type _PTR trace,
  906. _INT iStart, _INT iEnd );
  907. _SHORT Xmean_range ( p_SHORT xArray, p_SHORT yArray,
  908. _INT iStart, _INT iEnd );
  909. _SHORT Ymean_range ( p_SHORT yArray, _INT iStart, _INT iEnd );
  910. _SHORT Yup_range ( p_SHORT yArray, _INT iStart, _INT iEnd );
  911. _SHORT Ydown_range ( p_SHORT yArray, _INT iStart, _INT iEnd );
  912. _VOID xy_to_trace ( p_SHORT xArray, p_SHORT yArray,
  913. _INT nPoints, _TRACE trace );
  914. #endif /*USE_FRM_WORD*/
  915. _VOID trace_to_xy ( p_SHORT xArray, p_SHORT yArray,
  916. _INT nPoints, _TRACE trace );
  917. /***************************************************************************/
  918. /* module SPECWIN */
  919. /***************************************************************************/
  920. _SHORT low_level(PS_point_type _PTR trace, /* completeness of low level */
  921. xrdata_type _PTR xrdata, /* */
  922. rc_type _PTR rc );
  923. _INT BaselineAndScale(low_type _PTR pLowData);
  924. _BOOL PrepareLowData(low_type _PTR pLowData,
  925. PS_point_type _PTR trace,
  926. rc_type _PTR rc,
  927. p_SHORT _PTR pbuffer);
  928. _VOID FillLowDataTrace(low_type _PTR pLowData,
  929. PS_point_type _PTR trace);
  930. _VOID GetLowDataRect (low_type _PTR pLowData);
  931. _INT AnalyzeLowData(low_type _PTR pLowData,
  932. PS_point_type _PTR trace);
  933. /***************************************************************************/
  934. #endif /* LOW_LEVEL_INCLUDED */
  935. /***************************************************************************/