-
-
Save AndrewRayCode/4456d69f2582d28df7f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function copyUIntToImageData( uint, imageData ) { | |
| for( let i = 0; i < uint.length; i += 4 ) { | |
| let index = uint.length - i; // flip how data is read | |
| imageData.data[ index ] = uint[ i ]; //red | |
| imageData.data[ index + 1 ] = uint[ i + 1 ]; //green | |
| imageData.data[ index + 2 ] = uint[ i + 2 ]; //blue | |
| imageData.data[ index + 3 ] = uint[ i + 3 ]; //alpha | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment