Yes, it's the case #2, I was already suspecting that ImageReaders could only deal with file-system files...<br>
<br>
Thanks for the advice :)<br>
<br>
- Mathieu -<br><br><div><span class="gmail_quote">2006/3/9, Mathieu Malaterre <<a href="mailto:mathieu.malaterre@kitware.com">mathieu.malaterre@kitware.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Salut Mathieu,<br><br> Two things:<br><br>#1 If you are trying to load a memory buffer into a vtkImageData and<br>this memory buffer is uncompressed and indeed contains something VTK can<br>deal with (RBG values for instance). Then yes they are multiple way of
<br>doing so.<br><br>#2. If you are looking for the API of the libpng to do memory file<br>decompression, then this is not the right ML for that. I'd suggest<br>posting to the libpng newsgroups or ML. The vtkPNGReader is only dealing
<br>with files.<br><br>HTH<br>Mathieu<br><br>Mathieu Bosi wrote:<br>> Hi to everyone, my name is Mathieu Bosi.<br>><br>> I'm new to vtk and currently I'm facing with this Issue:<br>> I have to load a geric image (
i.e. PNG) from a compressed archive and<br>> currently I'm able to extract the file to memory.<br>> Is it actually possible to load an image from a "memory file"?<br>><br>> More precisely I would like to achieve something like this:
<br>><br>> ----------------------------<br>><br>> int size; // how many bytes we'll have in mem_ptr[]<br>><br>> byte *mem_ptr = feedFromArchive( archive_file_name,<br>> file_name_in_archive, &size );
<br>><br>> vtkPNGReader *png_reader = vtkPNGReader::New();<br>><br>> png_reader->SetMemFile( mem_ptr, size ); // <-- Versus --> the file<br>> version: png_reader->SetFileName( img_file_name );
<br>> png_reader->Update();<br>><br>> ----------------------------<br>><br>> Actually the only (rude) way I've found is to dump from the memory to a<br>> temporary file and then passing that file name as a parameter to the
<br>> canonical "vtkPNGReader::SetFileName()" is that the only solution?<br>><br>><br>> Thanks in advance for your kind attention<br>><br>> - Mathieu Bosi -<br>><br>><br>><br>><br>
><br>><br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<br>> This is the private VTK discussion list.
<br>> Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>> Follow this link to subscribe/unsubscribe:<br>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers">
http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br></blockquote></div><br>