I am using VTK to render an depth image, and have set up the connections. However, when it comes to saving the output of the renderer as png file I get the warning, that the PngWriter only supports unsigned char and unsigned short inputs.
vtkSmartPointer<vtkPNGWriter> imageWriter = vtkSmartPointer<vtkPNGWriter>::New();
imageWriter->SetInputConnection(zFilter->GetOutputPort());
imageWriter->SetFileName( qPrintable(QString("outdepth_%1.png").arg(i)) );
imageWriter->Write();
This is my code (inside a loop) , basically I need sth like (unsigned short) zFilter->GetOutputPort()
- which of course does not makye any sense at all, it is just for clarification what should be casted