Shop OBEX P1 Docs P2 Docs Learn Events
Need help with using built in log table for gamma correction — Parallax Forums

Need help with using built in log table for gamma correction

jstjohnzjstjohnz Posts: 91
edited 2011-04-13 23:17 in Propeller 1
I'm trying to figure out how to use the prop's built in log table to generate a 256-byte array (256 8-bit values) that will translate a linear 8-bit input value (0-255) into a logarithmic output value (0-255). Mathematically, for a specified value of G, I want to be able, in spin code, to generate an array such that array[N]=INT((N/255)^G*255). For G=1, array[N] would = N.
For G values >1 the array values would still span the range of 0-255, but the changes would be smaller at the beginning (ie same value duplicated multiple times), and larger at the end (ie increments>1). If that makes any sense...

This will be used to gamma-correct an LED intensity value to make it's dimming response more compatible with the human eye.

.

Comments

Sign In or Register to comment.