Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!vsi1!daver!athsys!jim From: jim@athsys.uucp (Jim Becker) Newsgroups: comp.windows.x Subject: Re: XRdBitF.c: faster bitmap reading code for libX11.a Message-ID: <132@tityus.UUCP> Date: 3 Sep 88 00:56:21 GMT References: <13842@agate.BERKELEY.EDU> Organization: Athena Systems, Inc., Sunnyvale, CA Lines: 26 From article <13842@agate.BERKELEY.EDU>, by jkh@violet.berkeley.edu (Jordan K. Hubbard): > In article <129@tityus.UUCP> jim@athsys.uucp (Jim Becker) writes: > > Great. Do the plans for R3 also provide a routine for getting just the bits > from a bitmap image, so that one can then convert it into a pixmap > of arbitraty depth and color(s)? > Jordan This is the primary reason that I had to originally get into this code, as it builds you a pixmap rather than letting you get to the bits. (This was a change that was put in with the X10->X11 changes.) By cloning this routine, renaming it and modifying the logic not to create the pixmap from the data you can get what you want. If you return the "data" pointer instead of a pixmap XID you can then get at the bits. Also, there was a minor bug to this that causes it not to be reentrant. The "fstream" variable should be local to the XReadBitmapFile routine, and passed to the routine NextInt. Otherwise there could be problems. Otherwise, it seems fine. Email me if this is not clear, as I want to keep net clutter down. -Jim Becker