home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume2 / bitimp / patch1 next >
Internet Message Format  |  1988-12-02  |  3KB

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v02i027:  generic bitmap to Impress converter, Patch1
  5. Message-ID: <1871@wyse.wyse.com>
  6. Date: 2 Dec 88 19:19:08 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 81
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: dana@thumper.bellcore.com (Dana A. Chee)
  12. Posting-number: Volume 2, Issue 27
  13. Archive-name: bitimp/patch1
  14.  
  15.  
  16.  
  17.  
  18. This is a patch to the contributed package bitimp on the R3 tape
  19. (contrib/clients/bitimp).  It removes the extra droppings on the right
  20. edges of windows.
  21.  
  22. Dana Chee, Bellcore, dana@thumper.bellcore.com
  23.  
  24. *** /u/dana/Xr3/contrib/clients/xipr/bitimp.c    Fri Aug 12 09:17:51 1988
  25. --- ./bitimp.c    Tue Nov 22 12:24:56 1988
  26. ***************
  27. *** 697,703 ****
  28. --- 697,705 ----
  29.       int        i,
  30.           j,
  31.           k,
  32. +             l,
  33.           slop;
  34. +     unsigned char tail;
  35.       unsigned nbytes;
  36.       register char *cp;
  37.       char  *raster;
  38. ***************
  39. *** 706,726 ****
  40.       if ((i = XReadDumpFP (BitIn, &xwd, (char **) 0, &raster)) <= 0)
  41.       adios (NULLCP, "window dump file is in bad format");
  42.   
  43. !     slop = (i = xwd.pixmap_width % PSIZE) ? PSIZE - i : 0;
  44.   
  45. !     imPbegin (PixPerIn, PixPerIn, xwd.pixmap_width + slop, xwd.pixmap_height);
  46.   
  47. !     k = xwd.bytes_per_line;
  48. !     if (slop)
  49. !     slop = (xwd.pixmap_width + slop) / 8 - k;
  50.       cp = raster;
  51.       for (i = xwd.pixmap_height; i > 0; i--) {
  52. !     for (j = k; j > 0; j--)
  53.           imPmap ((unsigned char) (*cp++));
  54.   
  55. !     for (j = slop; j > 0; j--)    /* Imagen pads to PSIZE boundaries */
  56.           imPmap ((unsigned char) 0x00);
  57.       }
  58.   
  59. --- 708,734 ----
  60.       if ((i = XReadDumpFP (BitIn, &xwd, (char **) 0, &raster)) <= 0)
  61.       adios (NULLCP, "window dump file is in bad format");
  62.   
  63. !     k = xwd.bytes_per_line;        /* # of stored bytes per line */
  64. !     l = (xwd.pixmap_width + 7) / 8;    /* # of useful bytes per line */
  65. !     
  66. !     slop = (i = k % PBYTES) ? PBYTES - i : 0;    /* how many more bytes needed*/
  67.   
  68. !     imPbegin (PixPerIn, PixPerIn, (k + slop)*8, xwd.pixmap_height);
  69.   
  70. !     tail = (i = xwd.pixmap_width % 8) ? 8 - i : 0;
  71. !     tail = (unsigned)0xff << tail;
  72. !     
  73.       cp = raster;
  74.       for (i = xwd.pixmap_height; i > 0; i--) {
  75. !     for (j = l; j > 1; j--)
  76.           imPmap ((unsigned char) (*cp++));
  77.   
  78. !     imPmap((unsigned char) (*cp++ & tail)); /* clip the last byte */
  79. !     for (j = (k - l); j > 0; j--)    /* put out extra bytes */
  80. !         imPmap((unsigned char) (*cp++ & 0x00));
  81. !     
  82. !     for (j = slop; j > 0; j--)    /* Imagen pads to PBYTES boundaries */
  83.           imPmap ((unsigned char) 0x00);
  84.       }
  85.   
  86. -- 
  87. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  88. Moderator of comp.sources.x
  89.