c - Fast 3D Lut lookups -


i'm trying write fast 3d lut lookup function , noticed luts either 33x33x33 or 17x17x17.

why 33 or 17? wouldn't math quicker 32 or 16 instead? shifts instead of divides? or maybe i'm not understanding why.

anyone?

this because colour values typically stored 8-bit or 10-bit integers (8 bits in systems each r, g , b value stored in single byte, , 10 bits in systems store 30 bits of rgb data in 32-bit long word).

to achieve spread of rgb values across entire range, need choose lut size evenly covers range 0 255 or 0 1023.

since 255 = 17x15, lookup table 15 or 17 values you:

15 values: [0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255] 17 values: [0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210, 225, 240, 255] 

for 10-bit values, i'll note 1023 divisible 33. can maths :-)


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -