VTK  9.2.6
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 "vtkAlgorithm.h"
62#include "vtkImageData.h" // makes things a bit easier
63#include "vtkRenderingCoreModule.h" // For export macro
64
65// VTK_RGB and VTK_RGBA are defined in system includes
66#define VTK_ZBUFFER 5
67
68class vtkWindow;
69
70class vtkWTI2DHelperClass;
71class VTKRENDERINGCORE_EXPORT vtkWindowToImageFilter : public vtkAlgorithm
72{
73public:
75
77 void PrintSelf(ostream& os, vtkIndent indent) override;
78
82 void SetInput(vtkWindow* input);
83
85
89 vtkGetObjectMacro(Input, vtkWindow);
91
93
96 vtkSetVector2Macro(Scale, int);
97 vtkGetVector2Macro(Scale, int);
99
104 void SetScale(int scale) { this->SetScale(scale, scale); }
105
107
112 vtkSetMacro(FixBoundary, bool);
113 vtkGetMacro(FixBoundary, bool);
114 vtkBooleanMacro(FixBoundary, bool);
116
118
122 vtkBooleanMacro(ReadFrontBuffer, vtkTypeBool);
123 vtkGetMacro(ReadFrontBuffer, vtkTypeBool);
124 vtkSetMacro(ReadFrontBuffer, vtkTypeBool);
126
128
132 vtkBooleanMacro(ShouldRerender, vtkTypeBool);
133 vtkSetMacro(ShouldRerender, vtkTypeBool);
134 vtkGetMacro(ShouldRerender, vtkTypeBool);
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
165
171
172protected:
175
176 // vtkWindow is not a vtkDataObject, so we need our own ivar.
178 int Scale[2];
181 double Viewport[4];
184
186
188
189 // see algorithm for more info
190 int FillOutputPortInformation(int port, vtkInformation* info) override;
191
199 virtual void Render();
200
201 // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
203 void Shift2DActors(int x, int y);
205 vtkWTI2DHelperClass* StoredData;
206
207private:
209 void operator=(const vtkWindowToImageFilter&) = delete;
210};
211
212#endif
Superclass for all sources, filters, and sinks in VTK.
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Use a vtkWindow as input to image pipeline.
void SetViewport(double *)
Set/get the extents to be used to generate the image.
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
void SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
virtual void Render()
Allows subclasses to customize how a request for render is handled.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetViewport(double, double, double, double)
Set/get the extents to be used to generate the image.
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkWTI2DHelperClass * StoredData
void Shift2DActors(int x, int y)
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetScale(int scale)
Convenience method to set same scale factors for x and y.
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
~vtkWindowToImageFilter() override
static vtkWindowToImageFilter * New()
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_RGBA
#define VTK_RGB