[vtkusers] Read PNG from in-memory buffer?

Elvis Stansvik elvis.stansvik at orexplore.com
Thu Sep 29 05:35:57 EDT 2016


2016-09-29 9:29 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
> I'd like to read a PNG from an in-memory buffer. Looking at
> vtkPNGReader, it seems it only works with files in the file system. In
> general, is there some way to use the reader classes in VTK with
> in-memory data, or would I have to write my own custom reader?
>
> My need for this is not great, I was simply hoping to be able to keep
> this particular PNG in the Qt resource system (so in the end, embedded
> in my executable), load it using Qt file facilities, and use VTK on
> the read in-memory data.

I realize now that I can probable use QImage to load/decompress the
image, and pass the uncompressed data to a vtkImageImport, but I can't
find any docs on what format vtkImageImport expects for the pixels.
Anyone know?

Elvis

>
> Elvis


More information about the vtkusers mailing list