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 / WINDISPL.CMD < prev   
OS/2 REXX Batch file  |  1992-08-05  |  2KB  |  56 lines

  1. ;windispl  --  copies the active image to the specified windows image
  2. ;
  3. ;syntax: windispl h #
  4. ;        h - windows image 
  5. ;        # = display modifier:
  6. ;             1: load grey value LUT
  7. ;             2: load pseudo colour LUT
  8. ;             3: load bitplane LUT: bitpl. 1 = red
  9. ;             4: load bitplane LUT: bitpl. 1 = red, 2 = green, 3 = blue
  10. ;        # = 16:   16 col. windows display - use dithering
  11. ;        # = 16+8: 16 col. windows display - no dithering
  12. ;        # = 256: 256 col. windows display
  13. ;
  14. ;Note: The '2' in the lut 3 2 ... function is an undocumented feature that prevents
  15. ;      the WinImage from being updated when a new Windows LUT is loaded. This makes
  16. ;      display less nervous.
  17.  
  18. #include timdefs.h
  19. ;#define LUTMASK         7
  20. ;#define DISPL_MASK 0xfff8
  21.  
  22. parms
  23.   file imag            ;Win-image to fill
  24.   int imode   
  25. endparms
  26.  
  27. if (((improp imag) & WIN_BIT) !=  WIN_BIT) stop
  28.  
  29. switch (imode & LUTMASK)  ;isolate LUT info
  30.   case WINLUT1            ;load greyvalue LUT
  31.     lut 3 2 1
  32. ;  case WINLUT2            ;load pseudocolour LUT
  33. ;    lut 3 2 1
  34. ;    lut 3 2 5 6
  35.   case WINLUT3
  36.     lut 3 2 1          ;load bitplane LUT: bitpl. 1 = red
  37.     lut 3 2 7 1
  38.   case WINLUT4            ;load bitplane LUT: bitpl. 1 = red, 2 = green, 3 = blue
  39.     lut 3 2 1
  40.     lut 3 2 7 1
  41.     lut 3 2 8 2
  42.     lut 3 2 9 3
  43. endsw  
  44.  
  45. switch (imode & DISPL_MASK)  ;remove LUT info
  46.   case 0
  47.     stop
  48.   case NO_DITHER
  49.     stop             ;for NO_DITHER attr. with no image copy (0)
  50.   case COL16
  51.     sdot imag  (imode & BITMASK)      ;copy image using dithering
  52.   default
  53.     save imag        ;copy image as is (also for COL16+NO_DITHER)
  54. endsw
  55.  
  56. stop