[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    Re: [vtkusers] Loading images from memory *not files*
From:       Kenneth Porter <shiva () sewingwitch ! com>
Date:       2010-02-24 14:03:19
Message-ID: 6ECBF6A8E0D2A858079CFAB2 () [10 ! 170 ! 7 ! 6]
[Download RAW message or body]

--On Wednesday, February 24, 2010 10:06 AM +0000 Robert Haines 
<rhaines@manchester.ac.uk> wrote:

> Subject says it all really. I have an image (a PNG in this case but I'd
> like to be general here really) in memory and I'd like to use it in the
> normal VTK way - as if it had been read in by vtkPNGReader, for example.
> Is this possible? I've looked at the code for vtkPNGReader and it looks
> like the only way to read a PNG is from a file, which seems crazy! Have I
> missed something? Is there another way to do what I want?

vtkPNGReader under the hood uses libpng. You can hook directly into that. 
It supports reading from sources other than files, but you have to supply a 
suitable "input" routine. Search for "png_init_io" on this page:

<http://www.libpng.org/pub/png/libpng-manual.txt>


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic