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>
&nbsp;- Mathieu -<br><br><div><span class="gmail_quote">2006/3/9, Mathieu Malaterre &lt;<a href="mailto:mathieu.malaterre@kitware.com">mathieu.malaterre@kitware.com</a>&gt;:</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&gt; Hi to everyone, my name is Mathieu Bosi.<br>&gt;<br>&gt; I'm new to vtk and currently I'm facing with this Issue:<br>&gt; I have to load a geric image (
i.e. PNG) from a compressed archive and<br>&gt; currently I'm able to extract the file to memory.<br>&gt; Is it actually possible to load an image from a &quot;memory file&quot;?<br>&gt;<br>&gt; More precisely I would like to achieve something like this:
<br>&gt;<br>&gt; ----------------------------<br>&gt;<br>&gt; int size; // how many bytes we'll have in mem_ptr[]<br>&gt;<br>&gt; byte *mem_ptr = feedFromArchive( archive_file_name,<br>&gt; file_name_in_archive,&nbsp;&nbsp; &amp;size );
<br>&gt;<br>&gt; vtkPNGReader&nbsp;&nbsp;*png_reader&nbsp;&nbsp;= vtkPNGReader::New();<br>&gt;<br>&gt; png_reader-&gt;SetMemFile( mem_ptr, size ); // &lt;-- Versus --&gt; the file<br>&gt; version:&nbsp;&nbsp;png_reader-&gt;SetFileName( img_file_name );
<br>&gt; png_reader-&gt;Update();<br>&gt;<br>&gt; ----------------------------<br>&gt;<br>&gt; Actually the only (rude) way I've found is to dump from the memory to a<br>&gt; temporary file and then passing that file name as a parameter to the
<br>&gt; canonical &quot;vtkPNGReader::SetFileName()&quot; is that the only solution?<br>&gt;<br>&gt;<br>&gt; Thanks in advance for your kind attention<br>&gt;<br>&gt;&nbsp;&nbsp;- Mathieu Bosi -<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>
&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>&gt; This is the private VTK discussion list.
<br>&gt; 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>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">
http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br></blockquote></div><br>