home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume5 / xldimage / patch2 / patch.02 < prev    next >
Encoding:
Text File  |  1989-11-21  |  18.1 KB  |  600 lines

  1. *** Imakefile.orig    Mon Nov 20 16:10:40 1989
  2. --- Imakefile    Mon Nov 20 16:17:15 1989
  3. ***************
  4. *** 1,13 ****
  5. !         DEFINES = -DSYSPATHFILE=\"/usr/lib/X11/xloadimage/xloadimagerc\"
  6.           DEPLIBS = $(DEPLIBS)
  7.   LOCAL_LIBRARIES = $(XLIB)
  8.              SRCS = bright.c clip.c compress.c dither.c faces.c fill.c \
  9. !           imagetypes.c merge.c misc.c new.c options.c path.c \
  10. !           pbm.c reduce.c root.c send.c sunraster.c value.c \
  11. !           window.c xbitmap.c xloadimage.c zio.c zoom.c
  12.              OBJS = bright.o clip.o compress.o dither.o faces.o fill.o \
  13. !           imagetypes.o merge.o misc.o new.o options.o path.o \
  14. !           pbm.o reduce.o root.o send.o sunraster.o value.o \
  15. !           window.o xbitmap.o xloadimage.o zio.o zoom.o
  16.   
  17.   ComplexProgramTarget(xloadimage)
  18. --- 1,16 ----
  19. !     SYSPATHFILE = $(USRLIBDIR)/xloadimagerc
  20. !         DEFINES = -DSYSPATHFILE=\"$(SYSPATHFILE)\"
  21.           DEPLIBS = $(DEPLIBS)
  22.   LOCAL_LIBRARIES = $(XLIB)
  23.              SRCS = bright.c clip.c compress.c dither.c faces.c fill.c \
  24. !           halftone.c imagetypes.c merge.c misc.c new.c \
  25. !           options.c path.c pbm.c reduce.c root.c send.c \
  26. !           sunraster.c value.c window.c xbitmap.c xloadimage.c \
  27. !           xpixmap.c zio.c zoom.c
  28.              OBJS = bright.o clip.o compress.o dither.o faces.o fill.o \
  29. !           halftone.o imagetypes.o merge.o misc.o new.o \
  30. !           options.o path.o pbm.o reduce.o root.o send.o \
  31. !           sunraster.o value.o window.o xbitmap.o xloadimage.o \
  32. !           xpixmap.o zio.o zoom.o
  33.   
  34.   ComplexProgramTarget(xloadimage)
  35. *** Makefile.gcc.orig    Mon Nov 20 16:10:41 1989
  36. --- Makefile.gcc    Mon Nov 20 16:18:54 1989
  37. ***************
  38. *** 8,16 ****
  39.   CFLAGS= -O -fstrength-reduce -finline-functions -DSYSPATHFILE=\"/usr/lib/xloadimagerc\"
  40.   
  41.   LIBS= -lX11
  42. ! OBJS= bright.o clip.o compress.o dither.o faces.o fill.o imagetypes.o \
  43. !       merge.o misc.o new.o options.o path.o pbm.o reduce.o root.o send.o \
  44. !       sunraster.o value.o window.o xbitmap.o xloadimage.o zio.o zoom.o
  45.   
  46.   xloadimage: $(OBJS)
  47.       $(CC) $(CFLAGS) -o xloadimage $(OBJS) $(LIBS)
  48. --- 8,17 ----
  49.   CFLAGS= -O -fstrength-reduce -finline-functions -DSYSPATHFILE=\"/usr/lib/xloadimagerc\"
  50.   
  51.   LIBS= -lX11
  52. ! OBJS= bright.o clip.o compress.o dither.o faces.o fill.o \
  53. !       halftone.o imagetypes.o merge.o misc.o new.o options.o path.o \
  54. !       pbm.o reduce.o root.o send.o sunraster.o value.o window.o \
  55. !       xbitmap.o xloadimage.o xpixmap.o zio.o zoom.o
  56.   
  57.   xloadimage: $(OBJS)
  58.       $(CC) $(CFLAGS) -o xloadimage $(OBJS) $(LIBS)
  59. *** Makefile.std.orig    Mon Nov 20 16:41:09 1989
  60. --- Makefile.std    Mon Nov 20 16:38:39 1989
  61. ***************
  62. *** 8,16 ****
  63.   CFLAGS= -O -DSYSPATHFILE=\"/usr/lib/xloadimagerc\"
  64.   
  65.   LIBS= -lX11
  66. ! OBJS= bright.o clip.o compress.o dither.o faces.o fill.o imagetypes.o \
  67. !       merge.o misc.o new.o options.o path.o pbm.o reduce.o root.o send.o \
  68. !       sunraster.o value.o window.o xbitmap.o xloadimage.o zio.o zoom.o
  69.   
  70.   xloadimage: $(OBJS)
  71.       $(CC) $(CFLAGS) -o xloadimage $(OBJS) $(LIBS)
  72. --- 8,17 ----
  73.   CFLAGS= -O -DSYSPATHFILE=\"/usr/lib/xloadimagerc\"
  74.   
  75.   LIBS= -lX11
  76. ! OBJS= bright.o clip.o compress.o dither.o faces.o fill.o \
  77. !       halftone.o imagetypes.o merge.o misc.o new.o options.o path.o \
  78. !       pbm.o reduce.o root.o send.o sunraster.o value.o window.o \
  79. !       xbitmap.o xloadimage.o xpixmap.o zio.o zoom.o
  80.   
  81.   xloadimage: $(OBJS)
  82.       $(CC) $(CFLAGS) -o xloadimage $(OBJS) $(LIBS)
  83. *** dither.c.orig    Mon Nov 20 16:10:44 1989
  84. --- dither.c    Mon Nov 20 16:15:07 1989
  85. ***************
  86. *** 1,13 ****
  87.   /* dither.c:
  88.    *
  89. !  * routine for dithering a color image to monochrome based on color
  90. !  * intensity.  this is loosely based on an algorithm which barry shein
  91. !  * (bzs@std.com) used in his "xf" program.
  92.    *
  93.    * jim frost 07.10.89
  94.    *
  95. !  * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
  96. !  * copyright information.
  97.    */
  98.   
  99.   #include "copyright.h"
  100. --- 1,14 ----
  101.   /* dither.c:
  102.    *
  103. !  * this is a modified version of the dithering algorithm in halftone.c
  104. !  * which doesn't enlarge the image.  modifications made by
  105. !  * Steve Losen (scl@virginia.edu).
  106.    *
  107.    * jim frost 07.10.89
  108. +  * Steve Losen 11.17.89
  109.    *
  110. !  * Copyright 1989 Jim Frost and Steve Losen.  See included file
  111. !  * "copyright.h" for complete copyright information.
  112.    */
  113.   
  114.   #include "copyright.h"
  115. ***************
  116. *** 21,41 ****
  117.   
  118.   static byte DitherBits[GRAYS][4] = {
  119.     0xf, 0xf, 0xf, 0xf,
  120. !   0xe, 0xf, 0xf, 0xf,
  121. !   0xe, 0xf, 0xb, 0xf,
  122. !   0xa, 0xf, 0xb, 0xf,
  123. !   0xa, 0xf, 0xa, 0xf,
  124. !   0xa, 0xd, 0xa, 0xf,
  125. !   0xa, 0xd, 0xa, 0x7,
  126. !   0xa, 0x5, 0xa, 0x7,
  127. !   0xa, 0x5, 0xa, 0x5,
  128. !   0x8, 0x5, 0xa, 0x5,
  129. !   0x8, 0x5, 0x2, 0x5,
  130. !   0x0, 0x5, 0x2, 0x5,
  131. !   0x0, 0x5, 0x0, 0x5,
  132. !   0x0, 0x4, 0x0, 0x5,
  133. !   0x0, 0x4, 0x0, 0x1,
  134. !   0x0, 0x0, 0x0, 0x1,
  135.     0x0, 0x0, 0x0, 0x0
  136.   };
  137.   
  138. --- 22,42 ----
  139.   
  140.   static byte DitherBits[GRAYS][4] = {
  141.     0xf, 0xf, 0xf, 0xf,
  142. !   0xf, 0xf, 0xf, 0x7,
  143. !   0xf, 0xf, 0xf, 0x3,
  144. !   0xf, 0xf, 0x7, 0x3,
  145. !   0xf, 0xf, 0x3, 0x3,
  146. !   0xf, 0xf, 0x3, 0x1,
  147. !   0xf, 0x7, 0x3, 0x1,
  148. !   0xf, 0x7, 0x1, 0x1,
  149. !   0x7, 0x7, 0x3, 0x0,
  150. !   0x7, 0x7, 0x1, 0x0,
  151. !   0x7, 0x3, 0x1, 0x0,
  152. !   0x7, 0x3, 0x0, 0x0,
  153. !   0x3, 0x3, 0x0, 0x0,
  154. !   0x3, 0x1, 0x0, 0x0,
  155. !   0x3, 0x0, 0x0, 0x0,
  156. !   0x1, 0x0, 0x0, 0x0,
  157.     0x0, 0x0, 0x0, 0x0
  158.   };
  159.   
  160. ***************
  161. *** 65,71 ****
  162.       printf("  Dithering image...");
  163.       fflush(stdout);
  164.     }
  165. !   image= newBitImage(cimage->width * 4, cimage->height * 4);
  166.     if (cimage->title) {
  167.       image->title= (char *)malloc(strlen(cimage->title) + 12);
  168.       sprintf(image->title, "%s (dithered)", cimage->title);
  169. --- 66,72 ----
  170.       printf("  Dithering image...");
  171.       fflush(stdout);
  172.     }
  173. !   image= newBitImage(cimage->width, cimage->height);
  174.     if (cimage->title) {
  175.       image->title= (char *)malloc(strlen(cimage->title) + 12);
  176.       sprintf(image->title, "%s (dithered)", cimage->title);
  177. ***************
  178. *** 99,105 ****
  179.     dp= image->data;
  180.     for (y= 0; y < cimage->height; y++) {
  181.       for (x= 0; x < cimage->width; x++) {
  182. -       dp2= dp + (x >> 1);
  183.         color= memToVal(sp, spl);
  184.         if (index)
  185.       dindex= *(index + color);
  186. --- 100,105 ----
  187. ***************
  188. *** 107,130 ****
  189.       dindex= ((unsigned long)(*(cimage->rgb.red + color)) +
  190.            *(cimage->rgb.green + color) +
  191.            *(cimage->rgb.blue + color)) / GRAYSTEP;
  192. !       /* loop for the four Y bits in the dither pattern, putting all
  193. !        * four X bits in at once.  if you think this would be hard to
  194. !        * change to be an NxN dithering array, you're right, since we're
  195. !        * banking on the fact that we need only shift the mask based on
  196. !        * whether x is odd or not.  an 8x8 array wouldn't even need that,
  197. !        * but blowing an image up by 64x is probably not a feature.
  198. !        */
  199. !       if (x & 1)
  200. !     for (a= 0; a < 4; a++, dp2 += dll)
  201. !       *dp2 |= DitherBits[dindex][a];
  202. !       else
  203. !     for (a= 0; a < 4; a++, dp2 += dll)
  204. !       *dp2 |= (DitherBits[dindex][a] << 4);
  205.         sp += spl;
  206.       }
  207. !     dp += (dll << 2); /* (dll * 4) but I like shifts */
  208.     }
  209.     if (verbose)
  210.       printf("done\n");
  211. --- 107,117 ----
  212.       dindex= ((unsigned long)(*(cimage->rgb.red + color)) +
  213.            *(cimage->rgb.green + color) +
  214.            *(cimage->rgb.blue + color)) / GRAYSTEP;
  215. !       if (DitherBits[dindex][y & 3] & (1 << (x & 3)))
  216. !      dp[x / 8] |= 1 << (7 - (x & 7));
  217.         sp += spl;
  218.       }
  219. !     dp += dll;
  220.     }
  221.     if (verbose)
  222.       printf("done\n");
  223. *** image.h.orig    Mon Nov 20 16:10:45 1989
  224. --- image.h    Mon Nov 20 16:15:08 1989
  225. ***************
  226. *** 60,65 ****
  227. --- 60,67 ----
  228.   
  229.   void fold(); /* fold.c */
  230.   
  231. + Image *halftone(); /* halftone.c */
  232.   Image *loadImage(); /* imagetypes.c */
  233.   void   identifyImage();
  234.   void   goodImage();
  235. ***************
  236. *** 82,86 ****
  237. --- 84,90 ----
  238.   
  239.   unsigned long memToVal(); /* value.c */
  240.   void          valToMem();
  241. + unsigned long memToValLSB();
  242. + void          valToMemLSB();
  243.   
  244.   Image *zoom(); /* zoom.c */
  245. *** imagetypes.h.orig    Mon Nov 20 16:10:46 1989
  246. --- imagetypes.h    Mon Nov 20 16:19:13 1989
  247. ***************
  248. *** 19,24 ****
  249. --- 19,27 ----
  250.   int xbitmapIdent();
  251.   int xpixmapIdent();
  252.   
  253. + /* some of these are order-dependent
  254. +  */
  255.   struct {
  256.     int    (*identifier)(); /* print out image info if this kind of image */
  257.     Image *(*loader)();     /* load image if this kind of image */
  258. ***************
  259. *** 27,32 ****
  260. --- 30,36 ----
  261.     sunRasterIdent, sunRasterLoad, "Sun Rasterfile",
  262.     pbmIdent,       pbmLoad,       "Portable Bit Map (PBM)",
  263.     facesIdent,     facesLoad,     "Faces Project",
  264. +   xpixmapIdent,   xpixmapLoad,   "X Pixmap",
  265.     xbitmapIdent,   xbitmapLoad,   "X Bitmap",
  266.     NULL,           NULL,          NULL
  267.   };
  268. *** misc.c.orig    Mon Nov 20 16:10:47 1989
  269. --- misc.c    Mon Nov 20 16:15:09 1989
  270. ***************
  271. *** 39,44 ****
  272. --- 39,45 ----
  273.     printf("  -clip X,Y,W,H         - use clipped portion of image\n");
  274.     printf("  -dither               - dither color image to bitmap image\n");
  275.     printf("  -foreground colorname - foreground color for bitmap images\n");
  276. +   printf("  -halftone             - halftone a color image to bitmap image\n");
  277.     printf("  -name name            - force next argument to be image name\n");
  278.     printf("  -xzoom percentage     - zoom the X axis by a percentage\n");
  279.     printf("  -yzoom percentage     - zoom the Y axis by a percentage\n");
  280. ***************
  281. *** 111,117 ****
  282.     }
  283.   
  284.     if (options->dither && (image->depth > 1)) { /* image is to be dithered */
  285. !     tmpimage= dither(image, verbose);
  286.       freeImage(image);
  287.       image= tmpimage;
  288.       options->clipx *= 4;      /* image was blown up by 4 */
  289. --- 112,121 ----
  290.     }
  291.   
  292.     if (options->dither && (image->depth > 1)) { /* image is to be dithered */
  293. !     if (options->dither == 1)
  294. !       tmpimage= dither(image, verbose);
  295. !     else
  296. !       tmpimage= halftone(image, verbose);
  297.       freeImage(image);
  298.       image= tmpimage;
  299.       options->clipx *= 4;      /* image was blown up by 4 */
  300. *** value.c.orig    Mon Nov 20 16:10:59 1989
  301. --- value.c    Mon Nov 20 16:15:11 1989
  302. ***************
  303. *** 36,38 ****
  304. --- 36,64 ----
  305.       val >>= 8;
  306.     }
  307.   }
  308. + unsigned long memToValLSB(p, len)
  309. +      byte         *p;
  310. +      unsigned int  len;
  311. + { int val, a;
  312. +   val= 0;
  313. +   for (a= len - 1; a >= 0; a--)
  314. +     val= (val << 8) + *(p + a);
  315. +   return(val);
  316. + }
  317. + /* this is provided for orthagonality
  318. +  */
  319. + void valToMemLSB(val, p, len)
  320. +      byte          *p;
  321. +      unsigned long  val;
  322. +      unsigned int   len;
  323. + { int a;
  324. +   while (len--) {
  325. +     *(p++)= val & 0xff;
  326. +     val >>= 8;
  327. +   }
  328. + }
  329. *** xloadimage.c.orig    Mon Nov 20 16:11:01 1989
  330. --- xloadimage.c    Mon Nov 20 16:15:12 1989
  331. ***************
  332. *** 37,42 ****
  333. --- 37,43 ----
  334.     "colors",
  335.     "dither",
  336.     "foreground",
  337. +   "halftone",
  338.     "name",
  339.     "xzoom",
  340.     "yzoom",
  341. ***************
  342. *** 66,76 ****
  343.   #define COLORS     18
  344.   #define DITHER     19
  345.   #define FOREGROUND 20
  346. ! #define NAME       21
  347. ! #define XZOOM      22
  348. ! #define YZOOM      23
  349. ! #define ZOOM       24
  350.   
  351.   /* the real thing
  352.    */
  353.   
  354. --- 67,86 ----
  355.   #define COLORS     18
  356.   #define DITHER     19
  357.   #define FOREGROUND 20
  358. ! #define HALFTONE   21
  359. ! #define NAME       22
  360. ! #define XZOOM      23
  361. ! #define YZOOM      24
  362. ! #define ZOOM       25
  363.   
  364. + /* if an image loader needs to have our display and screen, it will get
  365. +  * them from here.  this is done to keep most of the image routines
  366. +  * clean
  367. +  */
  368. + Display *Disp= NULL;
  369. + int      Scrn= 0;
  370.   /* the real thing
  371.    */
  372.   
  373. ***************
  374. *** 246,251 ****
  375. --- 256,265 ----
  376.         images[imagecount].fg= argv[++a];
  377.         break;
  378.   
  379. +     case HALFTONE:
  380. +       images[imagecount].dither= 2;
  381. +       break;
  382.       case NAME:
  383.         if (imagecount == MAXIMAGES)
  384.       printf("%s: Too many images (ignoring)\n", argv[++a]);
  385. ***************
  386. *** 287,297 ****
  387.     /* start talking to the display
  388.      */
  389.   
  390. !   if (! (disp= XOpenDisplay(dname))) {
  391.       printf("%s: Cannot open display\n", XDisplayName(dname));
  392.       exit(1);
  393.     }
  394. !   scrn= DefaultScreen(disp);
  395.     XSetIOErrorHandler(ioErrorHandler);
  396.   
  397.     dispimage= NULL;
  398. --- 301,311 ----
  399.     /* start talking to the display
  400.      */
  401.   
  402. !   if (! (Disp= disp= XOpenDisplay(dname))) {
  403.       printf("%s: Cannot open display\n", XDisplayName(dname));
  404.       exit(1);
  405.     }
  406. !   Scrn= scrn= DefaultScreen(disp);
  407.     XSetIOErrorHandler(ioErrorHandler);
  408.   
  409.     dispimage= NULL;
  410. ***************
  411. *** 325,332 ****
  412.     for (a= 0; a < imagecount; a++) {
  413.       if (! (newimage= loadImage(images[a].name, verbose)))
  414.         continue;
  415. !     if ((dispimage && BITMAPP(dispimage)) || (DefaultDepth(disp, scrn) == 1))
  416. !       images[a].dither= 1;
  417.       newimage= processImage(disp, scrn, newimage, &images[a], verbose);
  418.       if (!images[a].clipw && !images[a].cliph) {
  419.         images[a].clipw= newimage->width;
  420. --- 339,347 ----
  421.     for (a= 0; a < imagecount; a++) {
  422.       if (! (newimage= loadImage(images[a].name, verbose)))
  423.         continue;
  424. !     if (!images[a].dither &&
  425. !     ((dispimage && BITMAPP(dispimage)) || (DefaultDepth(disp, scrn) == 1)))
  426. !       images[a].dither= 2;
  427.       newimage= processImage(disp, scrn, newimage, &images[a], verbose);
  428.       if (!images[a].clipw && !images[a].cliph) {
  429.         images[a].clipw= newimage->width;
  430. *** xloadimage.man.orig    Mon Nov 20 16:53:22 1989
  431. --- xloadimage.man    Mon Nov 20 17:06:00 1989
  432. ***************
  433. *** 13,19 ****
  434.   If the destination display cannot support the number of colors in the
  435.   image, the image will be dithered (monochrome destination) or have its
  436.   colormap reduced (color destination) as appropriate.  This can also be
  437. ! done forcibly with the \fI-dither\fR and \fI-colors\fR options.
  438.   .PP
  439.   If more than one image is to be loaded, they will be merged into a
  440.   single image.  The \fI-at\fR and \fI-center\fR options control where
  441. --- 13,19 ----
  442.   If the destination display cannot support the number of colors in the
  443.   image, the image will be dithered (monochrome destination) or have its
  444.   colormap reduced (color destination) as appropriate.  This can also be
  445. ! done forcibly with the \fI-halftone\fR and \fI-colors\fR options.
  446.   .PP
  447.   If more than one image is to be loaded, they will be merged into a
  448.   single image.  The \fI-at\fR and \fI-center\fR options control where
  449. ***************
  450. *** 128,136 ****
  451.   interpreted as the remainder of the image. 
  452.   .TP
  453.   -dither
  454. ! Force halftone dithering of a color image when displaying on a color
  455. ! display.  This happens by default when viewing color images on a
  456. ! monochrome display.  This option is ignored on monochrome images. 
  457.   .TP
  458.   -foreground \fIcolor\fR
  459.   Use \fIcolor\fR as the foreground color instead of black if you are
  460. --- 128,136 ----
  461.   interpreted as the remainder of the image. 
  462.   .TP
  463.   -dither
  464. ! Dither a color image to monochrome.  This algorithm is very trivial;
  465. ! the \fI-halftone\fR option may look better if you don't mind the
  466. ! blown-up image.
  467.   .TP
  468.   -foreground \fIcolor\fR
  469.   Use \fIcolor\fR as the foreground color instead of black if you are
  470. ***************
  471. *** 138,143 ****
  472. --- 138,151 ----
  473.   used to invert the foreground and background colors of a monochrome
  474.   image. 
  475.   .TP
  476. + -halftone
  477. + Force halftone dithering of a color image when displaying on a
  478. + monochrome display.  This happens by default when viewing color images
  479. + on a monochrome display.  This option is ignored on monochrome images.
  480. + This dithering algorithm blows an image up by sixteen times; if you
  481. + don't like this, the \fI-dither\fR option will not blow the image up
  482. + (but won't look as nice).
  483. + .TP
  484.   -name \fIimage_name\fR
  485.   Force the next argument to be treated as an image name.  This is
  486.   useful if the name of the image is \fI-dither\fR, for instance. 
  487. ***************
  488. *** 208,213 ****
  489. --- 216,222 ----
  490.     Sun color RGB rasterfiles
  491.     X10 bitmap files
  492.     X11 bitmap files
  493. +   X pixmap files
  494.   .fi
  495.   .PP
  496.   Both normal and compact PBM images are supported.  Both standard and
  497. ***************
  498. *** 219,224 ****
  499. --- 228,235 ----
  500.   madd@std.com
  501.   .fi
  502.   .SH BUGS
  503. + Zooming dithered images is UGLY.
  504. + .PP
  505.   Loading images onto the root with PseudoColor or GrayScale displays
  506.   can cause colormap problems (and may interfere with window manager
  507.   operation) if there are not enough colors in the default colormap to
  508. *** zoom.c.orig    Mon Nov 20 16:11:03 1989
  509. --- zoom.c    Mon Nov 20 16:15:13 1989
  510. ***************
  511. *** 46,53 ****
  512.     unsigned int  x, y, xsrc, ysrc;
  513.     unsigned int  pixlen;
  514.     unsigned int  srclinelen;
  515.     byte         *srcline, *srcptr;
  516. !   byte         *destptr;
  517.     byte          srcmask, destmask, bit;
  518.     Pixel         value;
  519.   
  520. --- 46,54 ----
  521.     unsigned int  x, y, xsrc, ysrc;
  522.     unsigned int  pixlen;
  523.     unsigned int  srclinelen;
  524. +   unsigned int  destlinelen;
  525.     byte         *srcline, *srcptr;
  526. !   byte         *destline, *destptr;
  527.     byte          srcmask, destmask, bit;
  528.     Pixel         value;
  529.   
  530. ***************
  531. *** 90,96 ****
  532.         *(image->rgb.blue + x)= *(oimage->rgb.blue + x);
  533.       }
  534.       image->rgb.used= oimage->rgb.used;
  535. !     destptr= image->data;
  536.       srcline= oimage->data;
  537.       srclinelen= (oimage->width / 8) + (oimage->width % 8 ? 1 : 0);
  538.       for (y= 0, ysrc= *(yindex + y); y < ywidth; y++) {
  539. --- 91,98 ----
  540.         *(image->rgb.blue + x)= *(oimage->rgb.blue + x);
  541.       }
  542.       image->rgb.used= oimage->rgb.used;
  543. !     destline= image->data;
  544. !     destlinelen= (xwidth / 8) + (xwidth % 8 ? 1 : 0);
  545.       srcline= oimage->data;
  546.       srclinelen= (oimage->width / 8) + (oimage->width % 8 ? 1 : 0);
  547.       for (y= 0, ysrc= *(yindex + y); y < ywidth; y++) {
  548. ***************
  549. *** 99,104 ****
  550. --- 101,107 ----
  551.       srcline += srclinelen;
  552.         }
  553.         srcptr= srcline;
  554. +       destptr= destline;
  555.         srcmask= 0x80;
  556.         destmask= 0x80;
  557.         bit= srcmask & *srcptr;
  558. ***************
  559. *** 120,125 ****
  560. --- 123,129 ----
  561.         destptr++;
  562.       }
  563.         }
  564. +       destline += destlinelen;
  565.       }
  566.       break;
  567.   
  568. *** README.orig    Mon Nov 20 16:10:42 1989
  569. --- README    Mon Nov 20 16:33:15 1989
  570. ***************
  571. *** 97,99 ****
  572. --- 97,104 ----
  573.   windows by typing 'q' was submitted by Chris Tengi
  574.   (tengi@idunno.princeton.edu) and was included.  The previously missing
  575.   file 'patchlevel' was included.
  576. + Patch 02 contained modifications to the Makefiles, support for the X
  577. + Pixmap image type, a different dithering algorithm that didn't blow
  578. + the image up (with the old one moved to halftone.c), and a bug fix to
  579. + zoom.c to correct problems when zooming bitmaps.
  580. *** patchlevel.orig    Mon Nov 20 16:41:17 1989
  581. --- patchlevel    Mon Nov 20 16:47:04 1989
  582. ***************
  583. *** 1 ****
  584. ! PATCHLEVEL 01
  585. --- 1 ----
  586. ! PATCHLEVEL 02
  587.