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 =========================================================================*/
73 #ifndef vtkWindowToImageFilter_h
74 #define vtkWindowToImageFilter_h
75 
76 #include "vtkAlgorithm.h"
77 #include "vtkImageData.h" // makes things a bit easier
78 #include "vtkRenderingCoreModule.h" // For export macro
79 
80 // VTK_RGB and VTK_RGBA are defined in system includes
81 #define VTK_ZBUFFER 5
82 
83 class vtkWindow;
84 
85 class vtkWTI2DHelperClass;
86 class VTKRENDERINGCORE_EXPORT vtkWindowToImageFilter : public vtkAlgorithm
87 {
88 public:
90 
92  void PrintSelf(ostream& os, vtkIndent indent) override;
93 
97  void SetInput(vtkWindow* input);
98 
100 
104  vtkGetObjectMacro(Input, vtkWindow);
106 
108 
111  vtkSetVector2Macro(Scale, int);
112  vtkGetVector2Macro(Scale, int);
114 
119  void SetScale(int scale) { this->SetScale(scale, scale); }
120 
122 
127  vtkSetMacro(FixBoundary, bool);
128  vtkGetMacro(FixBoundary, bool);
129  vtkBooleanMacro(FixBoundary, bool);
131 
133 
137  vtkBooleanMacro(ReadFrontBuffer, vtkTypeBool);
138  vtkGetMacro(ReadFrontBuffer, vtkTypeBool);
139  vtkSetMacro(ReadFrontBuffer, vtkTypeBool);
141 
143 
147  vtkBooleanMacro(ShouldRerender, vtkTypeBool);
148  vtkSetMacro(ShouldRerender, vtkTypeBool);
149  vtkGetMacro(ShouldRerender, vtkTypeBool);
151 
153 
157  void SetViewport(double, double, double, double);
158  void SetViewport(double*);
159  vtkGetVectorMacro(Viewport, double, 4);
161 
163 
169  vtkSetMacro(InputBufferType, int);
170  vtkGetMacro(InputBufferType, int);
171  void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
172  void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
173  void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
175 
180 
186 
187 protected:
190 
191  // vtkWindow is not a vtkDataObject, so we need our own ivar.
193  int Scale[2];
196  double Viewport[4];
199 
201 
203 
204  // see algorithm for more info
206 
214  virtual void Render();
215 
216  // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
218  void Shift2DActors(int x, int y);
220  vtkWTI2DHelperClass* StoredData;
221 
222 private:
224  void operator=(const vtkWindowToImageFilter&) = delete;
225 };
226 
227 #endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:72
topologically and geometrically regular array of data
Definition: vtkImageData.h:63
a simple class to control print indentation
Definition: vtkIndent.h:49
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.
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
static vtkWindowToImageFilter * New()
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
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48
@ 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