https://github.com/dy/flip-pixels
Flip pixel data after readPixels
https://github.com/dy/flip-pixels
Last synced: 9 months ago
JSON representation
Flip pixel data after readPixels
- Host: GitHub
- URL: https://github.com/dy/flip-pixels
- Owner: dy
- Created: 2018-09-24T11:22:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-23T11:49:03.000Z (over 7 years ago)
- Last Synced: 2025-08-27T20:39:54.369Z (10 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
[](https://travis-ci.org/dy/flip-pixels)
Flip pixels after `gl.readTexture`:
```js
var flip = require('flip-pixels')
var w = gl.drawingBufferWidth;
var h = gl.drawingBufferHeight
var pixels = new Uint8Array(w * h * 4);
gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
flip(pixels, w, h)
```
Based on [this question](https://stackoverflow.com/questions/41969562/how-can-i-flip-the-result-of-webglrenderingcontext-readpixels).
See also [clip-pixels](https://ghub.io/clip-pixels).