flip-pixels
Flip pixel data after readPixels
Last updated 7 years ago by dy .
MIT · Repository · Bugs · Original npm
$ cnpm install flip-pixels 
SYNC missed versions from official npm registry.

Build Status

Flip pixels after gl.readTexture:

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.

See also clip-pixels.

Current Tags

  • 1.0.2                                ...           latest (7 years ago)

1 Versions

  • 1.0.2                                ...           7 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org