VTK  9.2.6
vtkWindowToImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkWindowToImageFilter.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
173#ifndef vtkWindowToImageFilter_h
174#define vtkWindowToImageFilter_h
175
176#include "vtkAlgorithm.h"
177#include "vtkImageData.h" // makes things a bit easier
178#include "vtkRenderingCoreModule.h" // For export macro
179
180// VTK_RGB and VTK_RGBA are defined in system includes
181#define VTK_ZBUFFER 5
182
183class vtkWindow;
184
185class vtkWTI2DHelperClass;
186class VTKRENDERINGCORE_EXPORT vtkWindowToImageFilter : public vtkAlgorithm
187{
188public:
190
192 void PrintSelf(ostream& os, vtkIndent indent) override;
193
197 void SetInput(vtkWindow* input);
198
200
204 vtkGetObjectMacro(Input, vtkWindow);
206
208
211 vtkSetVector2Macro(Scale, int);
212 vtkGetVector2Macro(Scale, int);
214
219 void SetScale(int scale) { this->SetScale(scale, scale); }
220
222
227 vtkSetMacro(FixBoundary, bool);
228 vtkGetMacro(FixBoundary, bool);
229 vtkBooleanMacro(FixBoundary, bool);
231
233
237 vtkBooleanMacro(ReadFrontBuffer, vtkTypeBool);
238 vtkGetMacro(ReadFrontBuffer, vtkTypeBool);
239 vtkSetMacro(ReadFrontBuffer, vtkTypeBool);
241
243
247 vtkBooleanMacro(ShouldRerender, vtkTypeBool);
248 vtkSetMacro(ShouldRerender, vtkTypeBool);
249 vtkGetMacro(ShouldRerender, vtkTypeBool);
251
253
257 void SetViewport(double, double, double, double);
258 void SetViewport(double*);
259 vtkGetVectorMacro(Viewport, double, 4);
261
263
269 vtkSetMacro(InputBufferType, int);
270 vtkGetMacro(InputBufferType, int);
271 void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
272 void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
273 void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
275
280
286
287protected:
290
291 // vtkWindow is not a vtkDataObject, so we need our own ivar.
293 int Scale[2];
296 double Viewport[4];
299
301
303
304 // see algorithm for more info
306
314 virtual void Render();
315
316 // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
318 void Shift2DActors(int x, int y);
320 vtkWTI2DHelperClass* StoredData;
321
322private:
324 void operator=(const vtkWindowToImageFilter&) = delete;
325};
326
327#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:119
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Use a vtkWindow as input to image pipeline.
void SetViewport(double *)
Set/get the extents to be used to generate the image.
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
void SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
virtual void Render()
Allows subclasses to customize how a request for render is handled.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetViewport(double, double, double, double)
Set/get the extents to be used to generate the image.
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkWTI2DHelperClass * StoredData
void Shift2DActors(int x, int y)
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetScale(int scale)
Convenience method to set same scale factors for x and y.
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
~vtkWindowToImageFilter() override
static vtkWindowToImageFilter * New()
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ scale
Definition: vtkX3D.h:235
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_RGBA
#define VTK_RGB
#define VTK_ZBUFFER