VTK  9.0.20210926
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 =========================================================================*/
167 #ifndef vtkWindowToImageFilter_h
168 #define vtkWindowToImageFilter_h
169 
170 #include "vtkAlgorithm.h"
171 #include "vtkImageData.h" // makes things a bit easier
172 #include "vtkRenderingCoreModule.h" // For export macro
173 
174 // VTK_RGB and VTK_RGBA are defined in system includes
175 #define VTK_ZBUFFER 5
176 
177 class vtkWindow;
178 
179 class vtkWTI2DHelperClass;
180 class VTKRENDERINGCORE_EXPORT vtkWindowToImageFilter : public vtkAlgorithm
181 {
182 public:
184 
186  void PrintSelf(ostream& os, vtkIndent indent) override;
187 
191  void SetInput(vtkWindow* input);
192 
194 
198  vtkGetObjectMacro(Input, vtkWindow);
200 
202 
205  vtkSetVector2Macro(Scale, int);
206  vtkGetVector2Macro(Scale, int);
208 
213  void SetScale(int scale) { this->SetScale(scale, scale); }
214 
216 
221  vtkSetMacro(FixBoundary, bool);
222  vtkGetMacro(FixBoundary, bool);
223  vtkBooleanMacro(FixBoundary, bool);
225 
227 
231  vtkBooleanMacro(ReadFrontBuffer, vtkTypeBool);
232  vtkGetMacro(ReadFrontBuffer, vtkTypeBool);
233  vtkSetMacro(ReadFrontBuffer, vtkTypeBool);
235 
237 
241  vtkBooleanMacro(ShouldRerender, vtkTypeBool);
242  vtkSetMacro(ShouldRerender, vtkTypeBool);
243  vtkGetMacro(ShouldRerender, vtkTypeBool);
245 
247 
251  void SetViewport(double, double, double, double);
252  void SetViewport(double*);
253  vtkGetVectorMacro(Viewport, double, 4);
255 
257 
263  vtkSetMacro(InputBufferType, int);
264  vtkGetMacro(InputBufferType, int);
265  void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
266  void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
267  void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
269 
274 
280 
281 protected:
284 
285  // vtkWindow is not a vtkDataObject, so we need our own ivar.
287  int Scale[2];
290  double Viewport[4];
293 
295 
297 
298  // see algorithm for more info
300 
308  virtual void Render();
309 
310  // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
312  void Shift2DActors(int x, int y);
314  vtkWTI2DHelperClass* StoredData;
315 
316 private:
318  void operator=(const vtkWindowToImageFilter&) = delete;
319 };
320 
321 #endif
vtkWindowToImageFilter::RequestInformation
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageData.h
vtkWindowToImageFilter::SetInputBufferTypeToZBuffer
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
Definition: vtkWindowToImageFilter.h:267
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkWindowToImageFilter::GetOutput
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
vtkWindowToImageFilter::ReadFrontBuffer
vtkTypeBool ReadFrontBuffer
Definition: vtkWindowToImageFilter.h:288
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:123
vtkWindowToImageFilter::SetInputBufferTypeToRGBA
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
Definition: vtkWindowToImageFilter.h:266
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkWindowToImageFilter::FixBoundary
bool FixBoundary
Definition: vtkWindowToImageFilter.h:292
vtkWindowToImageFilter
Use a vtkWindow as input to image pipeline.
Definition: vtkWindowToImageFilter.h:181
vtkWindowToImageFilter::SetScale
void SetScale(int scale)
Convenience method to set same scale factors for x and y.
Definition: vtkWindowToImageFilter.h:213
vtkWindowToImageFilter::SetInput
void SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
vtkWindowToImageFilter::Input
vtkWindow * Input
Definition: vtkWindowToImageFilter.h:286
vtkWindowToImageFilter::~vtkWindowToImageFilter
~vtkWindowToImageFilter() override
vtkWindowToImageFilter::Shift2DActors
void Shift2DActors(int x, int y)
vtkWindowToImageFilter::Rescale2DActors
void Rescale2DActors()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkAlgorithm.h
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkWindowToImageFilter::Render
virtual void Render()
Allows subclasses to customize how a request for render is handled.
vtkWindowToImageFilter::SetViewport
void SetViewport(double, double, double, double)
Set/get the extents to be used to generate the image.
vtkWindowToImageFilter::SetViewport
void SetViewport(double *)
Set/get the extents to be used to generate the image.
VTK_ZBUFFER
#define VTK_ZBUFFER
Definition: vtkWindowToImageFilter.h:175
VTK_RGB
#define VTK_RGB
Definition: vtkSystemIncludes.h:86
vtkWindowToImageFilter::RequestData
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkWindowToImageFilter::Restore2DActors
void Restore2DActors()
vtkWindowToImageFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWindowToImageFilter::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
vtkWindowToImageFilter::ShouldRerender
vtkTypeBool ShouldRerender
Definition: vtkWindowToImageFilter.h:289
vtkWindowToImageFilter::vtkWindowToImageFilter
vtkWindowToImageFilter()
vtkWindowToImageFilter::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkWindowToImageFilter::InputBufferType
int InputBufferType
Definition: vtkWindowToImageFilter.h:291
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
VTK_RGBA
#define VTK_RGBA
Definition: vtkSystemIncludes.h:87
vtkWindowToImageFilter::StoredData
vtkWTI2DHelperClass * StoredData
Definition: vtkWindowToImageFilter.h:314
vtkWindowToImageFilter::New
static vtkWindowToImageFilter * New()
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkWindowToImageFilter::SetInputBufferTypeToRGB
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
Definition: vtkWindowToImageFilter.h:265