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:
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 
166 
173 
174 protected:
177 
178  // vtkWindow is not a vtkDataObject, so we need our own ivar.
183  double Viewport[4];
186 
189 
193 
194  // see algorithm for more info
196 
197  // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
199  void Shift2DActors(int x, int y);
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
vtkWindowToImageFilter::RequestInformation
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageData.h
vtkWindowToImageFilter::SetInputBufferTypeToZBuffer
void SetInputBufferTypeToZBuffer()
Definition: vtkWindowToImageFilter.h:158
vtkWindowToImageFilter::GetOutput
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
vtkWindowToImageFilter::~vtkWindowToImageFilter
~vtkWindowToImageFilter()
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
vtkWindowToImageFilter::SetInputBufferTypeToRGBA
void SetInputBufferTypeToRGBA()
Definition: vtkWindowToImageFilter.h:157
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkWindowToImageFilter::FixBoundary
bool FixBoundary
Definition: vtkWindowToImageFilter.h:185
vtkWindowToImageFilter::ReadFrontBuffer
int ReadFrontBuffer
Definition: vtkWindowToImageFilter.h:181
vtkWindowToImageFilter
Use a vtkWindow as input to image pipeline.
Definition: vtkWindowToImageFilter.h:78
vtkWindowToImageFilter::ProcessRequest
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
see vtkAlgorithm for details
vtkWindowToImageFilter::SetInput
void SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
vtkWindowToImageFilter::Input
vtkWindow * Input
Definition: vtkWindowToImageFilter.h:179
vtkWindowToImageFilter::Shift2DActors
void Shift2DActors(int x, int y)
vtkWindowToImageFilter::Rescale2DActors
void Rescale2DActors()
vtkWindowToImageFilter::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkAlgorithm.h
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkWindowToImageFilter::SetViewport
void SetViewport(double, double, double, double)
Set/get the extents to be used to generate the image.
vtkWindowToImageFilter::ShouldRerender
int ShouldRerender
Definition: vtkWindowToImageFilter.h:182
vtkWindowToImageFilter::SetViewport
void SetViewport(double *)
VTK_ZBUFFER
#define VTK_ZBUFFER
Definition: vtkWindowToImageFilter.h:72
VTK_RGB
#define VTK_RGB
Definition: vtkSystemIncludes.h:99
vtkWindowToImageFilter::RequestData
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkWindowToImageFilter::Restore2DActors
void Restore2DActors()
vtkWindowToImageFilter::vtkWindowToImageFilter
vtkWindowToImageFilter()
vtkWindowToImageFilter::InputBufferType
int InputBufferType
Definition: vtkWindowToImageFilter.h:184
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
VTK_RGBA
#define VTK_RGBA
Definition: vtkSystemIncludes.h:100
vtkWindowToImageFilter::StoredData
vtkWTI2DHelperClass * StoredData
Definition: vtkWindowToImageFilter.h:201
vtkWindowToImageFilter::New
static vtkWindowToImageFilter * New()
vtkWindowToImageFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkWindowToImageFilter::SetInputBufferTypeToRGB
void SetInputBufferTypeToRGB()
Definition: vtkWindowToImageFilter.h:156
vtkWindowToImageFilter::Magnification
int Magnification
Definition: vtkWindowToImageFilter.h:180