VTK  9.3.0
vtkWindowToImageFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
61#ifndef vtkWindowToImageFilter_h
62#define vtkWindowToImageFilter_h
63
64#include "vtkAlgorithm.h"
65#include "vtkImageData.h" // makes things a bit easier
66#include "vtkRenderingCoreModule.h" // For export macro
67
68// VTK_RGB and VTK_RGBA are defined in system includes
69#define VTK_ZBUFFER 5
70
71VTK_ABI_NAMESPACE_BEGIN
72class vtkWindow;
73
74class vtkWTI2DHelperClass;
75class VTKRENDERINGCORE_EXPORT vtkWindowToImageFilter : public vtkAlgorithm
76{
77public:
79
81 void PrintSelf(ostream& os, vtkIndent indent) override;
82
86 void SetInput(vtkWindow* input);
87
89
93 vtkGetObjectMacro(Input, vtkWindow);
95
97
100 vtkSetVector2Macro(Scale, int);
101 vtkGetVector2Macro(Scale, int);
103
108 void SetScale(int scale) { this->SetScale(scale, scale); }
109
111
116 vtkSetMacro(FixBoundary, bool);
117 vtkGetMacro(FixBoundary, bool);
118 vtkBooleanMacro(FixBoundary, bool);
120
122
126 vtkBooleanMacro(ReadFrontBuffer, vtkTypeBool);
127 vtkGetMacro(ReadFrontBuffer, vtkTypeBool);
128 vtkSetMacro(ReadFrontBuffer, vtkTypeBool);
130
132
136 vtkBooleanMacro(ShouldRerender, vtkTypeBool);
137 vtkSetMacro(ShouldRerender, vtkTypeBool);
138 vtkGetMacro(ShouldRerender, vtkTypeBool);
140
142
146 void SetViewport(double, double, double, double);
147 void SetViewport(double*);
148 vtkGetVectorMacro(Viewport, double, 4);
150
152
158 vtkSetMacro(InputBufferType, int);
159 vtkGetMacro(InputBufferType, int);
160 void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
161 void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
162 void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
164
169
175
176protected:
179
180 // vtkWindow is not a vtkDataObject, so we need our own ivar.
182 int Scale[2];
185 double Viewport[4];
188
190
192
193 // see algorithm for more info
194 int FillOutputPortInformation(int port, vtkInformation* info) override;
195
203 virtual void Render();
204
205 // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
207 void Shift2DActors(int x, int y);
209 vtkWTI2DHelperClass* StoredData;
210
211private:
213 void operator=(const vtkWindowToImageFilter&) = delete;
214};
215
216VTK_ABI_NAMESPACE_END
217#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:38
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:34
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_RGBA
#define VTK_RGB