home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / t / timwin.zip / TIMWIN2.EXE / pak / DHOLO.CMD < prev    next >
OS/2 REXX Batch file  |  1992-08-05  |  2KB  |  137 lines

  1. ;TIM-DEMO       HOLO    0.4.1
  2. ;holo    -  demonstratie min-max met hologrammenbeeld
  3. ;verwacht:  beginbeeld in a
  4. ;versie IT
  5. ;Modified for Windows version TIM
  6. ;****************************************************
  7. #include timdefs.h
  8.  
  9. parms
  10.   int imode
  11. endparms
  12. int tl, gval, olddraw, loop
  13.  
  14. cls
  15.              ;prepare LUTs
  16. lut 2 4      ;red = 1, green = 2
  17.              ;prepare environment
  18. gval = set 1 1
  19. dest p
  20. show p
  21. copy a
  22. era x 1 2 3
  23.  
  24. ;     voer drempelingen uit met versch. dremp.waardes
  25.  
  26.  
  27. copy a
  28. era 1 2 3
  29. *windispl h (imode+WINLUT1)
  30.  
  31.       ;only if image is FG image
  32. if ((improp) & DIS_BIT)  == DIS_BIT
  33.  zoom 1
  34.       ;show running threshold by loading LUTs
  35.  for tl = 20 to 255 step 3
  36.   thre a tl /
  37.   lut 2 5 4
  38.  endfor
  39.  
  40.  for tl = 250 to 25 step -3
  41.   thre a tl /
  42.   lut 2 5 4
  43.  endfor
  44.  
  45.  lut 2 3               ;restore
  46.  zoom 0
  47. endif
  48.  
  49. xorln p 80 0 80 255 1
  50. *windispl h (imode+WINLUT4+BITCOPY1)
  51.  
  52. dest q
  53. era q
  54. lut 2 4
  55.  
  56. line a 80
  57. grav 
  58. text 1 10 20 "line 80 from original image"
  59. copy q b          ;keep graph
  60. *windispl i (imode+NO_DITHER)    ;always image copy (no dither), use LUT 3
  61.  
  62. dest r
  63. lut 2 1            ;BW lut
  64. min a 15 
  65. max 15
  66. unif 11
  67. dest s
  68. max a 15
  69. min 15
  70. unif 11
  71. sub s r
  72. ;         local contrast stretch
  73. ;dest p
  74. dest r
  75. sub a r         ;trek ondergrens glad
  76.  
  77. div r s 222     ;trek bovengrens naar maximum
  78. era r 1 2 3
  79. xorln r 79 0 80 255 2    ;draw line 79 to keep 80 original
  80. *windispl h (imode+BITCOPY2)
  81.  
  82. lut 4
  83. dest q
  84. line r 80
  85. olddraw = set 4 2
  86. graf
  87. text 2 25 20 "line 80 from corrected image"
  88. or b q >b
  89.  
  90. *windispl i (imode+NO_DITHER)    ;always image copy (no dither), use LUT 4
  91.  
  92. dest p
  93. thre r
  94. keep 1
  95.  
  96. dest s
  97. label a 128     ;threshold original
  98. thre 2           ;get rid of large white object (upper-left)
  99. keep 2
  100. or p s          ;use this as a seed and
  101. lpr 2 1         ;propagate 
  102. band 1 2 3      ;keep pixels which are in both bitplanes
  103.  
  104.  
  105. bit 3
  106. keep 1 2
  107. *windispl i (imode+BITCOPY2)
  108. zoom 1
  109. lsk 2
  110. bcop 2 1
  111. lver 2
  112. ldi6 2 1
  113. ;debug
  114. binv 2
  115. band 1 2 3
  116. bcop 3 4
  117. lskz 3 4
  118. lps 3
  119. lpr 3 4
  120. bcop 3 2
  121. lenp 2
  122. ldi6 2 2
  123. lsk 2
  124. dest p
  125. show p
  126. and a 0xf8
  127. or p s
  128. bor 3 2 1
  129. era 2 3
  130. *windispl h (imode+BITCOPY1)
  131. set 1 gval
  132. set 4 olddraw
  133.  
  134. stop
  135.  
  136.  
  137.