VTK
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 =========================================================================*/
58 #ifndef vtkWindowToImageFilter_h
59 #define vtkWindowToImageFilter_h
60 
61 #include "vtkRenderingCoreModule.h" // For export macro
62 #include "vtkAlgorithm.h"
63 #include "vtkImageData.h" // makes things a bit easier
64 
65 // VTK_RGB and VTK_RGBA are defined in system includes
66 #define VTK_ZBUFFER 5
67 
68 class vtkWindow;
69 
70 class vtkWTI2DHelperClass;
71 class VTKRENDERINGCORE_EXPORT vtkWindowToImageFilter : public vtkAlgorithm
72 {
73 public:
74  static vtkWindowToImageFilter *New();
75 
77  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
78 
82  void SetInput(vtkWindow *input);
83 
85 
89  vtkGetObjectMacro(Input,vtkWindow);
91 
93 
96  vtkSetClampMacro(Magnification,int,1,2048);
97  vtkGetMacro(Magnification,int);
99 
101 
106  vtkSetMacro(FixBoundary, bool);
107  vtkGetMacro(FixBoundary, bool);
108  vtkBooleanMacro(FixBoundary, bool);
110 
112 
116  vtkBooleanMacro(ReadFrontBuffer, int);
117  vtkGetMacro(ReadFrontBuffer, int);
118  vtkSetMacro(ReadFrontBuffer, int);
120 
122 
126  vtkBooleanMacro(ShouldRerender, int);
127  vtkSetMacro(ShouldRerender, int);
128  vtkGetMacro(ShouldRerender, int);
130 
132 
136  void SetViewport(double, double, double, double);
137  void SetViewport(double*);
138  vtkGetVectorMacro(Viewport,double,4);
140 
142 
148  vtkSetMacro(InputBufferType, int);
149  vtkGetMacro(InputBufferType, int);
150  void SetInputBufferTypeToRGB() {this->SetInputBufferType(VTK_RGB);};
151  void SetInputBufferTypeToRGBA() {this->SetInputBufferType(VTK_RGBA);};
152  void SetInputBufferTypeToZBuffer() {this->SetInputBufferType(VTK_ZBUFFER);};
154 
155 
159  vtkImageData* GetOutput();
160 
166  vtkInformationVector*) VTK_OVERRIDE;
167 
168 protected:
170  ~vtkWindowToImageFilter() VTK_OVERRIDE;
171 
172  // vtkWindow is not a vtkDataObject, so we need our own ivar.
177  double Viewport[4];
180 
181  void RequestData(vtkInformation *,
183 
184  virtual void RequestInformation (vtkInformation*,
187 
188  // see algorithm for more info
189  int FillOutputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
190 
198  virtual void Render();
199 
200  // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
201  void Rescale2DActors();
202  void Shift2DActors(int x, int y);
203  void Restore2DActors();
204  vtkWTI2DHelperClass *StoredData;
205 
206 private:
207  vtkWindowToImageFilter(const vtkWindowToImageFilter&) VTK_DELETE_FUNCTION;
208  void operator=(const vtkWindowToImageFilter&) VTK_DELETE_FUNCTION;
209 };
210 
211 #endif
vtkWTI2DHelperClass * StoredData
Store vtkAlgorithm input/output information.
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
#define VTK_ZBUFFER
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Use a vtkWindow as input to image pipeline.
#define VTK_RGBA
#define VTK_RGB
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.