Xref: utzoo comp.graphics:3937 comp.windows.x:6833 Path: utzoo!utgpu!watmath!watcgl!ksbooth From: ksbooth@watcgl.waterloo.edu (Kelly Booth) Newsgroups: comp.graphics,comp.windows.x Subject: Re: Luminance from RGB Message-ID: <7425@ In article <16960@onfcanim.UUCP> dave@onfcanim.UUCP (Dave Martindale) writes: >For shift/add to be faster than table lookup... Actually, some solutions combine BOTH techniques. If the table has two or more indices (not the case here), then the lookup requires combining those indices into a single index into the table. Some compilers do this with adds and multiplies. If machine code is written (or if the compiler is smart) shifts and adds can be substituted. This may require that the table size(s) be adjusted to the next larger powers of two. Or, recursively, the composite indices can themselves be computed using a table lookup scheme.