| 150 | } |
| 151 | |
| 152 | bool vtkOpenGLGL2PSExporter::RasterizeBackground(vtkImageData* image) |
| 153 | { |
| 154 | vtkNew<vtkWindowToImageFilter> windowToImage; |
| 155 | windowToImage->SetInput(this->RenderWindow); |
| 156 | windowToImage->SetInputBufferTypeToRGB(); |
| 157 | windowToImage->SetReadFrontBuffer(false); |
| 158 | |
| 159 | vtkNew<vtkImageShiftScale> byteToFloat; |
| 160 | byteToFloat->SetOutputScalarTypeToFloat(); |
| 161 | byteToFloat->SetScale(1.0 / 255.0); |
| 162 | byteToFloat->SetInputConnection(windowToImage->GetOutputPort()); |
| 163 | |
| 164 | vtkOpenGLGL2PSHelper* gl2ps = vtkOpenGLGL2PSHelper::GetInstance(); |
| 165 | gl2ps->SetActiveState(vtkOpenGLGL2PSHelper::Background); |
| 166 | // Render twice to set the backbuffer: |
| 167 | this->RenderWindow->Render(); |
| 168 | this->RenderWindow->Render(); |
| 169 | byteToFloat->Update(); |
| 170 | gl2ps->SetActiveState(vtkOpenGLGL2PSHelper::Inactive); |
| 171 | |
| 172 | image->ShallowCopy(byteToFloat->GetOutput()); |
| 173 | |
| 174 | return true; |
| 175 | } |
| 176 | |
| 177 | bool vtkOpenGLGL2PSExporter::CaptureVectorProps() |
| 178 | { |
no test coverage detected