Added gamma correction to tcl server.#14
Conversation
|
Hi Chris, thanks for writing this. Could you make the gamma values configurable on the command line? I think the default should be 1, so that existing lighting projects aren't affected by this change. Also, some style nits: one space after commas and semicolons, one space before and after low-precedence binary operators (+, -, and anything of lower precedence). Thanks! |
|
OK, makes sense. I will work on the changes in my repo and submit them to you, but probably not before burning man. |
|
I tried this out with the latest build of OPC. It compiled fine on my mac, but threw errors on the BeagleBoneBlack. gcc -o bin/tcl_server src/tcl_server.c src/opc_server.c src/spi.c ... update ... I had to add the -lm flag to gcc on the BBB. Huh, wonder why it isn't necessary in OSX. |
|
Re: the compiling errors, I need to include the math.h library and add -lm to link to it in the gcc line. I saw that you typedefed u8 to unsigned 8-bit int. I used it on several of the values I added, but I notice I didn't modify it on the casting calls. I'll set up a test bed after burning man, but right now I don't have a system I can debug on, so I'll defer the changes. |
|
No rush! Thanks! On Thu, Aug 15, 2013 at 6:56 AM, Christopher De Vries <
|
|
Thanks @SolidGold! I merged another pull request that added the missing -lm flag. |
|
hi all, this is exactly what I was looking to implement. Is there anything I can do to help it along? |
|
@devries @mbustosorg I made this configurable using the environment variable TCL_GAMMA. The merged change is in the branch |
|
Unfortunately I don't have a working Beaglebone at the moment to do any testing. I had a similar routine in another piece of code I wrote, and it had an issue writing a 257th byte to a 256 byte long buffer. I think this one was simpler so it might not include that bug. |
|
I have one available that I can test with this weekend. |
|
Hey sorry for the delay. The gamma correction works. Please add Let me know if you need anything else. |
I decided to try to address the gamma correction issue with TCL pixels the way I had in the elinux-tcl library. I basically create a lookup table for each color (right now that's not really used, but it could potentially come in handy) and I create the gamma correction table before the server starts.
I'm working on some other arduino based LED projects, so I don't have a test harness set up for this at the moment, but I hope it's not buggy.