PDA

View Full Version : displaying complex pixels from very large images



pfmaynard
09-02-2012, 11:04 PM
I've written elt's to exploit complex pixel synthetic apperture radar data using c# gui and C++ servers / dlls. I'd love to move into the WebGL world, but if I'm stuck with png, jpg, and tif how do you make this thing work? My images are 4 - 20 GB in size - I have to convert them to RSETs (image pyramids) worth of tiles, and then glTexImage2d these through a tiling scheme - loading only what I need to cover the display surface. I've spent days googling for ways to connect a C++ server (running FFTW fourier transform code) via websockets, libwebsocket, websocket++, etc. etc. and haven't found the way.

If I had to I could dynamically write thousands of 512x512 tiles as individual jpegs (after converting the floating point complex pixel to an 8 bit magnitude), but there has to be a better way. I'd like to be able to generate my tiles dynamically and send them in binary form over a socket to WebGL. That means something has to translate tcp/ip to websockets.

And from an image processing perspective, after a user has manipulated an image, how do they save it to their local machine? I'm guessing I would have to run a shadow local compiled code server on the host PC and communicate with it via sockets (again, how do you do this) and have the compiled server implement the save file commands it gets from the html5 javascript code running WebGL.

Is there anybody out there doing image processing with WebGL? Any groups / discussions, tips for how to make this work?

greggman
10-15-2012, 10:25 AM
You're asking questions to which there is no simple answer. Googling for them brings up lots of samples. Each one though with details is too much for a forum answer I think.

WebSockets
https://www.google.com/search?q=websock ... e&ie=UTF-8 (https://www.google.com/search?q=websockets+sample&oq=websockets+sample&sugexp=chrome,mod=0&sourceid=chrome&ie=UTF-8)

WebSockets is pretty easy if you use socket.io (http://socket.io) which is a node.js based library. I've heard there's WebSocket support for Python through the Tornado server. I have no idea about C++ though.

You can upload binary to WebGL using WebSockets (or XMLHttpRequest) and you can use that data directly with texImage2D.

As for saving,
http://updates.html5rocks.com/2011/08/S ... lient-side (http://updates.html5rocks.com/2011/08/Saving-generated-files-on-the-client-side)