pathfinder icon indicating copy to clipboard operation
pathfinder copied to clipboard

getImageData and putImageData

Open leoyanggit opened this issue 5 years ago • 3 comments

Hi there! I wonder if we have plan to implement getImageData and pubImageDta like what browser has. Or are there already some APIs that can do that but I'm missing them?

leoyanggit avatar Jul 07 '20 17:07 leoyanggit

You can use draw_image for pubImageData. Getting it back is a bit more involved and not even possible on WebGL.

Pathfinder renders everything at once, so you will have to finish the Scene to render it and get the texture. See here for an example

s3bk avatar Jul 08 '20 05:07 s3bk

Currently I'm using readPixels for WebGL backend. Yes I need to build and render the scene before I do that.

leoyanggit avatar Jul 08 '20 13:07 leoyanggit

I would like to implement them, yes. getImageData() will not be introspectable without consulting the Renderer, however, because the CanvasRenderingContext2D has no access to the raw pixel data.

pcwalton avatar Jul 09 '20 02:07 pcwalton