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 =========================================================================*/
64 #ifndef vtkWindowToImageFilter_h
65 #define vtkWindowToImageFilter_h
66 
67 #include "vtkRenderingCoreModule.h" // For export macro
68 #include "vtkAlgorithm.h"
69 #include "vtkImageData.h" // makes things a bit easier
70 
71 // VTK_RGB and VTK_RGBA are defined in system includes
72 #define VTK_ZBUFFER 5
73 
74 class vtkWindow;
75 
76 class vtkWTI2DHelperClass;
77 class VTKRENDERINGCORE_EXPORT vtkWindowToImageFilter : public vtkAlgorithm
78 {
79 public:
80  static vtkWindowToImageFilter *New();
81 
83  void PrintSelf(ostream& os, vtkIndent indent);
84 
88  void SetInput(vtkWindow *input);
89 
91 
95  vtkGetObjectMacro(Input,vtkWindow);
97 
99 
102  vtkSetClampMacro(Magnification,int,1,2048);
103  vtkGetMacro(Magnification,int);
105 
107 
112  vtkSetMacro(FixBoundary, bool);
113  vtkGetMacro(FixBoundary, bool);
114  vtkBooleanMacro(FixBoundary, bool);
116 
118 
122  vtkBooleanMacro(ReadFrontBuffer, int);
123  vtkGetMacro(ReadFrontBuffer, int);
124  vtkSetMacro(ReadFrontBuffer, int);
126 
128 
132  vtkBooleanMacro(ShouldRerender, int);
133  vtkSetMacro(ShouldRerender, int);
134  vtkGetMacro(ShouldRerender, int);
136 
138 
142  void SetViewport(double, double, double, double);
143  void SetViewport(double*);
144  vtkGetVectorMacro(Viewport,double,4);
146 
148 
154  vtkSetMacro(InputBufferType, int);
155  vtkGetMacro(InputBufferType, int);
156  void SetInputBufferTypeToRGB() {this->SetInputBufferType(VTK_RGB);};
157  void SetInputBufferTypeToRGBA() {this->SetInputBufferType(VTK_RGBA);};
158  void SetInputBufferTypeToZBuffer() {this->SetInputBufferType(VTK_ZBUFFER);};
160 
161 
165  vtkImageData* GetOutput();
166 
170  virtual int ProcessRequest(vtkInformation*,
173 
174 protected:
177 
178  // vtkWindow is not a vtkDataObject, so we need our own ivar.
183  double Viewport[4];
186 
187  void RequestData(vtkInformation *,
189 
190  virtual void RequestInformation (vtkInformation*,
193 
194  // see algorithm for more info
196 
197  // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
198  void Rescale2DActors();
199  void Shift2DActors(int x, int y);
200  void Restore2DActors();
201  vtkWTI2DHelperClass *StoredData;
202 
203 private:
204  vtkWindowToImageFilter(const vtkWindowToImageFilter&) VTK_DELETE_FUNCTION;
205  void operator=(const vtkWindowToImageFilter&) VTK_DELETE_FUNCTION;
206 };
207 
208 #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:37
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:59
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:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
#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.