Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!rice!sun-spots-request From: falk@peregrine.eng.sun.com (Ed Falk) Newsgroups: comp.sys.sun Subject: Re: Colormap segments whose size is not a power of two Keywords: Windows Message-ID: <1990Aug13.235446.25995@rice.edu> Date: 13 Aug 90 07:56:57 GMT Sender: sun-spots-request@rice.edu Organization: Sun-Spots Lines: 30 Approved: Sun-Spots@rice.edu Originator: spots@titan.rice.edu X-Sun-Spots-Digest: Volume 9, Issue 301, message 7 X-Refs: Original: v9n301 In article <1990Aug13.011000.5497@rice.edu> mlandau@diamond.bbn.com (Matthew Landau) writes: >In any case, I seem to recall that someone a couple of months >back posted an article on how to get the low-level colormap >routines in SunView to allow colormap segments whose size is >not a power of two. Does anyone have a copy of that posting, >or details on how to do this? Please reply be email, and I'll >summarize if there are enough requests. Normally, for reasons better left to historians, the pixwin package assumes that colormaps are a power of two in length, and limits your write masks accordingly. To override this limitation, you add this line: pw->pw_clipdata->pwcd_flags |= PWCD_SET_CMAP_SIZE ; After which, pixwins will let you set any write mask you want, whether or not it makes sense. To calculate the maximum reasonable write mask for any arbitrary colormap length, do int i,maxmask ; i = len - 1 ; maxmask = 1 ; while( i ) { i >>= 1 ; maxmask <<= 1 ; } --maxmask ; -ed falk, sun microsystems -- sun!falk, falk@sun.com