3 ms·
For future readers, this is the code that is being referred: https://github.com/ern0/howto-wasm-minimal/blob/master/inc.cpp#L31-L35 https://github.com/ern0/how
by syrusakbary 5y ago
For future readers, this is the code that is being referred:
https://github.com/ern0/howto-wasm-minimal/blob/master/inc.cpp#L31-L35 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;
- ern0 5y agoI know it (see: https://github.com/ern0/kolorwheel.js https://github.com/ern0/kolorwheel.js ), but I did not wanted use floats.