/usr/lib/vtk-5.8/tcl/vtktesting/grab.tcl is in tcl-vtk 5.8.0-14.1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | package require -exact vtkrendering 5.8
namespace eval ::vtk {
proc grab_screenshot {renderer basename} {
$renderer Render
set rs \
[::vtk::new_widget_object "_${renderer}" vtkRendererSource rs]
$rs SetInput $renderer
$rs DepthValuesOff
$rs DepthValuesInScalarsOn
set pw \
[::vtk::new_widget_object "_${renderer}" vtkPNGWriter pw]
$pw SetInput [$rs GetOutput]
$pw SetFileName "$basename-rgbz.png"
$pw Write
set iec \
[::vtk::new_widget_object "_${renderer}" vtkImageExtractComponents iec]
$iec SetInput [$rs GetOutput]
$iec SetComponents 3
$pw SetInput [$iec GetOutput]
$pw SetFileName "$basename-z.png"
$pw Write
$iec SetComponents 0 1 2
$pw SetFileName "$basename-rgb.png"
$pw Write
$rs Delete
$pw Delete
$iec Delete
}
}
|