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 "vtkAlgorithm.h"
66 #include "vtkImageData.h" // makes things a bit easier
67 
68 // VTK_RGB and VTK_RGBA are defined in system includes
69 #define VTK_ZBUFFER 5
70 
71 class vtkWindow;
72 
73 class vtkWTI2DHelperClass;
75 {
76 public:
77  static vtkWindowToImageFilter *New();
78 
80  void PrintSelf(ostream& os, vtkIndent indent);
81 
84  void SetInput(vtkWindow *input);
85 
87 
89  vtkGetObjectMacro(Input,vtkWindow);
91 
93 
94  vtkSetClampMacro(Magnification,int,1,2048);
95  vtkGetMacro(Magnification,int);
97 
99 
102  vtkSetMacro(FixBoundary, bool);
103  vtkGetMacro(FixBoundary, bool);
104  vtkBooleanMacro(FixBoundary, bool);
106 
108 
110  vtkBooleanMacro(ReadFrontBuffer, int);
111  vtkGetMacro(ReadFrontBuffer, int);
112  vtkSetMacro(ReadFrontBuffer, int);
114 
116 
118  vtkBooleanMacro(ShouldRerender, int);
119  vtkSetMacro(ShouldRerender, int);
120  vtkGetMacro(ShouldRerender, int);
122 
124 
126  vtkSetVector4Macro(Viewport,double);
127  vtkGetVectorMacro(Viewport,double,4);
129 
131 
135  vtkSetMacro(InputBufferType, int);
136  vtkGetMacro(InputBufferType, int);
137  void SetInputBufferTypeToRGB() {this->SetInputBufferType(VTK_RGB);};
138  void SetInputBufferTypeToRGBA() {this->SetInputBufferType(VTK_RGBA);};
139  void SetInputBufferTypeToZBuffer() {this->SetInputBufferType(VTK_ZBUFFER);};
141 
142 
144  vtkImageData* GetOutput();
145 
147 
148  virtual int ProcessRequest(vtkInformation*,
152 
153 protected:
156 
157  // vtkWindow is not a vtkDataObject, so we need our own ivar.
162  double Viewport[4];
165 
166  void RequestData(vtkInformation *,
168 
169  virtual void RequestInformation (vtkInformation*,
172 
173  // see algorithm for more info
175 
176  // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
177  void Rescale2DActors();
178  void Shift2DActors(int x, int y);
179  void Restore2DActors();
180  vtkWTI2DHelperClass *StoredData;
181 
182 private:
183  vtkWindowToImageFilter(const vtkWindowToImageFilter&); // Not implemented.
184  void operator=(const vtkWindowToImageFilter&); // Not implemented.
185 };
186 
187 #endif