Hacker News new | ask | show | jobs
by syrusakbary 1528 days ago
For future readers, this is the code that is being referred:

https://github.com/ern0/howto-wasm-minimal/blob/master/inc.c...

It should be:

    uint32_t gray = 0.299 * ptr[i] + 0.587 * ptr[i+1] + 0.114 * ptr[i+2];
    ptr[i] = gray;
    ptr[i+1] = gray;
    ptr[i+2] = gray;
1 comments

I know it (see: https://github.com/ern0/kolorwheel.js ), but I did not wanted use floats.