[prev in list] [next in list] [prev in thread] [next in thread]
List: vtkusers
Subject: Re: [vtkusers] Loading images from memory *not files*
From: Robert Haines <rhaines () manchester ! ac ! uk>
Date: 2010-02-24 13:35:39
Message-ID: 3B33433B-A53C-4E37-B10C-6CF5043B7C44 () manchester ! ac ! uk
[Download RAW message or body]
> PNG is a file format and PNGReader implements it. Nothing crazy here.
No, PNG is a data format. A PNG file is simply a file with that data format in it. I \
have some PNG data in memory that I would like to decode and use rather than load it \
from a file. Given that when you load a PNG file you would load it into memory to \
decode it I was hoping that you could do that with PNGReader or similar, that's why I \
thought I was going crazy when I thought that the only way of loading PNG data into \
vtk was to have it in a file on disk.
So my question was, can I do this with vtk?
> You need to create a vtkImage and populate its data via write pointer.
I can't see a vtkImage class (5.4.0) but if I was to use something like that \
(vtkImageData?) then it looks like I would have to do the PNG decode myself. Is that \
right? Even when vtk already links libpng and can do this if it's in a file?
Cheers,
Rob
> Robert Haines wrote:
> > Hi all,
> >
> > 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?
> > Thank you,
> > Rob
_______________________________________________
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