beyondscreen / node-rpi-ws281x-native

native bindings to drive WS2811 (or WS2812) LED-Controllers on a Raspberry Pi
MIT License
224 stars 101 forks source link

Gamma correction done twice if source map is set #30

Closed kunaakos closed 8 years ago

kunaakos commented 9 years ago

I think this line should be:

data[i] = _tmpData[indexMapping[i]];

Gamma correction is done in render()

usefulthink commented 9 years ago

duplicate of #28

usefulthink commented 9 years ago

the problem is, the gamma-correction is applied to the data-array that is most likely reused for rendering the next frame. Thus, if you don't write the whole data-array on every frame the initially set colors will fade to black over time (because the correction is applied over and over again).

tsuckow commented 9 years ago

I don't think render should be doing any of this stuff or at the very least there should be a "renderRaw" method that doesn't do any of these transformations.

If you do wish to do this, you should have your own buffer that is created at init time and used as the scratch space.

usefulthink commented 9 years ago

I agree. Wasn't the best Idea to have this in the core. Will be removed in the next version.

usefulthink commented 8 years ago

With the rewrite of the native part for version 0.6 this is now working properly, as the data passed by the application is not modified anymore.