Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Elliott Lee Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: TIM Date: Tue, 15 Sep 1998 13:51:32 -0700 Organization: Bwahaha Lines: 59 Message-ID: <35FED354.368F7092@shell.jps.net> References: <35FE90A1.C741958C@augsburg.baynet.de> Reply-To: tenchi@shell.jps.net NNTP-Posting-Host: dhcp-m-62-237.cisco.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.03 [en] (Win95; U) Somewhat echoing James R., the way things are set up is: # of bits per TIM uses CLUT? table size ----------------------- ---------- ---------- 4 yup 16 entr: 32 bytes 8 yup 256 entr: 512 bytes 16 nope --- 24 nope --- For CLUT-based TIMs, you can think of them like GIFs. Your image will have 4 or 8-bit integers, and each of those numbers maps to a color index, or the Color Look-Up Table. For 4 bits, there's 16 entries, for 8-bits 256 entries. Each of the entries is 2 bytes wide and is structured something like: 15 14-10 9-5 4-0 +---------------------------+ | t | b | g | r | +---------------------------+ One of the bits it a transparency flag. The other 3 parts are the RGB values, 5 bits each. So that gives you 32 levels of R, G, and B for a total of 32K colors. When you take an image (e.g. BMP) and convert it to 4 or 8 bit format (with the TimUtil or through another program), the RGB colors are adjusted to fit for the 5-bits-per-color-channel scheme. So when a sprite is rendered to the frame buffer, each pixel undergoes a CLUT lookup and the final color is written to memory. Of course, you're only limited to 16 or 256 colors. As for 16-bit images, they don't have CLUTs. Each pixel is its own 16-bit value following the CLUT entry scheme above. This let's you get the full 32K possible colors on screen at once. And, if you want REALLY high color, then try the 24-bit images. 8-bits per color channel. loonybit wrote: > > Hi everyone, > > maybe a simple question, but can someone tell me: > How is an 8 bit CLUT constructed or represented in memory? > Are there three 8bit values (RGB) per color in the table (so 768 bytes > for the complete table)? Are the values in the TIM file indexes for the > table (0 is first entry)? > > Thanks, > > Andy -- Mata ne, ... ... - e! ::' tenchi@shell.jps.net ':: (Protocol) :: ACiD -/- ACS -/- pHluid -/- Yaroze -/- Nemesis :: (Tenchikun) ::. http://www.jps.net/tenchi .:: ''' '''