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 =========================================================================*/
62 #ifndef vtkWindowToImageFilter_h
63 #define vtkWindowToImageFilter_h
64 
65 #include "vtkRenderingCoreModule.h" // For export macro
66 #include "vtkAlgorithm.h"
67 #include "vtkImageData.h" // makes things a bit easier
68 
69 // VTK_RGB and VTK_RGBA are defined in system includes
70 #define VTK_ZBUFFER 5
71 
72 class vtkWindow;
73 
74 class vtkWTI2DHelperClass;
76 {
77 public:
78  static vtkWindowToImageFilter *New();
79 
81  void PrintSelf(ostream& os, vtkIndent indent);
82 
85  void SetInput(vtkWindow *input);
86 
88 
90  vtkGetObjectMacro(Input,vtkWindow);
92 
94 
95  vtkSetClampMacro(Magnification,int,1,2048);
96  vtkGetMacro(Magnification,int);
98 
100 
103  vtkSetMacro(FixBoundary, bool);
104  vtkGetMacro(FixBoundary, bool);
105  vtkBooleanMacro(FixBoundary, bool);
107 
109 
111  vtkBooleanMacro(ReadFrontBuffer, int);
112  vtkGetMacro(ReadFrontBuffer, int);
113  vtkSetMacro(ReadFrontBuffer, int);
115 
117 
119  vtkBooleanMacro(ShouldRerender, int);
120  vtkSetMacro(ShouldRerender, int);
121  vtkGetMacro(ShouldRerender, int);
123 
125 
127  vtkSetVector4Macro(Viewport,double);
128  vtkGetVectorMacro(Viewport,double,4);
130 
132 
136  vtkSetMacro(InputBufferType, int);
137  vtkGetMacro(InputBufferType, int);
138  void SetInputBufferTypeToRGB() {this->SetInputBufferType(VTK_RGB);};
139  void SetInputBufferTypeToRGBA() {this->SetInputBufferType(VTK_RGBA);};
140  void SetInputBufferTypeToZBuffer() {this->SetInputBufferType(VTK_ZBUFFER);};
142 
143 
145  vtkImageData* GetOutput();
146 
148 
149  virtual int ProcessRequest(vtkInformation*,
153 
154 protected:
157 
158  // vtkWindow is not a vtkDataObject, so we need our own ivar.
163  double Viewport[4];
166 
167  void RequestData(vtkInformation *,
169 
170  virtual void RequestInformation (vtkInformation*,
173 
174  // see algorithm for more info
176 
177  // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
178  void Rescale2DActors();
179  void Shift2DActors(int x, int y);
180  void Restore2DActors();
181  vtkWTI2DHelperClass *StoredData;
182 
183 private:
184  vtkWindowToImageFilter(const vtkWindowToImageFilter&); // Not implemented.
185  void operator=(const vtkWindowToImageFilter&); // Not implemented.
186 };
187 
188 #endif
vtkWTI2DHelperClass * StoredData
Store vtkAlgorithm input/output information.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
virtual int FillOutputPortInformation(int port, vtkInformation *info)
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
#define VTK_ZBUFFER
Use a vtkWindow as input to image pipeline.
#define VTK_RGBA
#define VTK_RGB
#define VTKRENDERINGCORE_EXPORT
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)