bd40bc7c7a Please help improve this article by adding citations to reliable sources. A colour look-up table (CLUT) is a mechanism used to transform a range of input colours into another range of colours. A common example would be a palette of 256 colours (e.g. As mentioned, there are intermediate solutions that use tables in combination with a small amount of computation, often using interpolation. Statements consisting only of original research should be removed. function initsine() for x from 0 to (360/4)+1 sinetable[x] := sine(2*pi * x / 360) function lookupsine(x) x = wrap x from 0 to 360 y := mod (x, 90) if (x < 90) return sinetable[ y] if (x < 180) return sinetable[90-y] if (x < 270) return -sinetable[ y] return -sinetable[90-y] function lookupcosine(x) return lookupsine(x + 90) function lookuptan(x) return (lookupsine(x) / lookupcosine(x)) . (September 2016) (Learn how and when to remove this template message) . This section needs expansion.
References. 376399. This apparently simple algorithm can take potentially hundreds of cycles even on a modern architecture, because it makes many branches in the loop - and branching is slow. For example, the decimal number "37" is "00100101" in binary, so it contains three bits that are set to binary "1". The number of entries in the palette: determines the maximum number of colours which can appear on screen simultaneously (a subset of the wider full palette, which is to be understood as the total number of colours that a given system is able to generate or manage, e.g. Before the advent of computers, lookup tables of values were used to speed up hand calculations of complex functions, such as in trigonometry, logarithms, and statistical density functions.. Here is our example using linear interpolation:. Computing sines.