Skip to content

Typed Array and Chunked image decode #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
m5p3nc3r opened this issue Feb 3, 2014 · 4 comments
Closed

Typed Array and Chunked image decode #378

m5p3nc3r opened this issue Feb 3, 2014 · 4 comments

Comments

@m5p3nc3r
Copy link

m5p3nc3r commented Feb 3, 2014

Hi Guys

I am currently working on a node binding to OpenGL ES2, and want to add a shim on top of this to give WebGL bindings. I would like to be able to use the node-canvas project to give me Canvas 2D and png/jpeg capability for GLES textures, but from looking at the currently exposed API's, there does not seem to be a suitable way to do this.

I am happy to attempt to do the work for you, but wanted to gauge how likely to be accepted upstream these modifications would be

In order of my personal priority:

1 - Modify Image to allow output to a typed array - this would allow efficient transfer of the decoded image into the GLES bindings
2 - Modify Image to allow for chunked decoding - this would allow me to create a http loader for the images that has the same API as a DOM Image.
3 - Modify Canvas to allow output to a typed array - to be uses as a texture source in the GLES bindings.

Kind regards

Matt

@piranna
Copy link
Contributor

piranna commented Aug 6, 2015

@m5p3nc3r, are you still working on this issue? I'm interested on having WebGL support for NodeOS.

@LinusU
Copy link
Collaborator

LinusU commented Aug 6, 2015

This is cool!

I think that point 3 is addressed by #604 which I want to merge next week, we just need to give some time for the other maintainers to look on it if they want to.

It then makes sense to have a similar api for Image which is your point 1.

Point 2 would also be very cool, that would allow us to do async loading of Images, right?

@zbjornson
Copy link
Collaborator

I'm not sure I understand (2) -- 2.x supports img.src = <url>. That's not "chunked" but it is an http loader that matches browsers. Is that what you mean?

@LinusU
Copy link
Collaborator

LinusU commented Jan 11, 2019

Seems like this is supported now:

  1. getBuffer('raw')
  2. img.src = <url>
  3. Replace CanvasPixelArray with Uint8ClampedArray; optimizations; bugfixes #604 which is merged

Happy to reopen if we are missing something...

@LinusU LinusU closed this as completed Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants