Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU Newsgroups: comp.windows.x Subject: Re: overlay function in X Message-ID: <9102220729.AA00513@lightning.McRCIM.McGill.EDU> Date: 22 Feb 91 07:29:49 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 29 >> In case there's anyone out there who cares, something I would really >> like in X is an overlay function of the sort >> pixel_out = (pixel_1 == 0 ? pixel_2 : pixel_1); Me too, though I'd prefer for the 0 to be variable. > Try XCopyPlane. I think it does exactly what you want. No, what that does is pixel_out = ((pixel_1 & bit) == 0) ? color_A : color_B; What I took the original posting to be asking for was something which would do the given computation *for each pixel*. That is, given two drawables, each (say) 8 bits deep, it would do the equivalent of a copy of area 1 onto area 2, except that pixels in area 1 that had value 0 would leave the corresponding pixels in area 2 unchanged, instead of copying the 0. (As I said, though, I would want the 0 to be variable.) My guess is that this would be simple to implement (in the server, as an extension, say) but without hardware assist, it would be difficult to make it run reasonably fast. Of course, I haven't looked at it in any detail, so I could well be wrong. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu