pixels property

  1. @override
PCanvasPixels get pixels
override

Returns the pixels of this canvas. See PCanvasPixels.

Implementation

@override
PCanvasPixels get pixels {
  var w = _canvas.width ?? 0;
  var h = _canvas.height ?? 0;

  var imageData = _ctx.getImageData(0, 0, w, h);

  return PCanvasPixelsABGR.fromBytes(
      imageData.width, imageData.height, imageData.data);
}