From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] colormap From: okamoto@granite.cias.osakafu-u.ac.jp MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20010301093616.0850E199EA@mail.cse.psu.edu> Date: Thu, 1 Mar 2001 18:35:41 +0900 Topicbox-Message-UUID: 6b7b7f04-eac9-11e9-9e20-41e7f4b1d025 >Your m8 image shows colors on the true-color display because >you've lied about the channel format, saying it's color. Yes, we lied the Plan 9 kernel. However, isn't it posssible to use another colormap to change colormap to rgb by cmap2rgb(), which assumes only rgbv colormap? Without this lie, we have no chance to see 256 greyscale images on 8 bit display... I found some codes in /sys/src/libdraw/rgb.c assuming only 16 shades of greyscale, which made us disappointed. Our local "lie and broken promise" method is as follows: ^_^ To check what display depth we are in, and (1) if we are on 8 bit display, make m8 'greyscale' data, and change colormap to one having 256 grey shades, such as /lib/cmap/c7291.56. (2) if we are on truecolor display, make k8 'greyscale' data. We tried (r8g8b8) with same three bytes data, but it's just waste of memory. :-) Kenji