MCPcopy Index your code
hub / github.com/processing/p5.js / loadPixels

Method loadPixels

src/webgl/p5.RendererGL.js:537–562  ·  view source on GitHub ↗

* Loads the pixels data for this canvas into the pixels[] attribute. * Note that set() does not work. * Any pixel manipulation must be done directly to the pixels[] array. * * @private

()

Source from the content-addressed store, hash-verified

535 * @private
536 */
537 loadPixels() {
538 //@todo_FES
539 if (this._pInst._glAttributes.preserveDrawingBuffer !== true) {
540 console.log(
541 "loadPixels only works in WebGL when preserveDrawingBuffer " +
542 "is true."
543 );
544 return;
545 }
546
547 const pd = this._pixelDensity;
548 const gl = this.GL;
549
550 this.pixels = readPixelsWebGL(
551 this.pixels,
552 gl,
553 null,
554 0,
555 0,
556 this.width * pd,
557 this.height * pd,
558 gl.RGBA,
559 gl.UNSIGNED_BYTE,
560 this.height * pd
561 );
562 }
563
564 updatePixels() {
565 const fbo = this._getTempFramebuffer();

Callers

nothing calls this directly

Calls 1

readPixelsWebGLFunction · 0.90

Tested by

no test coverage detected