VTK  9.7.20260911
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
160
161#ifndef vtkWindowToImageFilter_h
162#define vtkWindowToImageFilter_h
163
164#include "vtkAlgorithm.h"
165#include "vtkImageData.h" // makes things a bit easier
166#include "vtkRenderingCoreModule.h" // For export macro
167#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
168
169// VTK_RGB and VTK_RGBA are defined in system includes
170#define VTK_ZBUFFER 5
171
172VTK_ABI_NAMESPACE_BEGIN
173class vtkWindow;
174
175class vtkWTI2DHelperClass;
176class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkWindowToImageFilter : public vtkAlgorithm
177{
178public:
180
182 void PrintSelf(ostream& os, vtkIndent indent) override;
183
187 void SetInput(vtkWindow* input);
188
190
194 vtkGetObjectMacro(Input, vtkWindow);
196
198
201 vtkSetVector2Macro(Scale, int);
202 vtkGetVector2Macro(Scale, int);
204
210 void SetScale(int scale) { this->SetScale(scale, scale); }
211
213
218 vtkSetMacro(FixBoundary, bool);
219 vtkGetMacro(FixBoundary, bool);
220 vtkBooleanMacro(FixBoundary, bool);
222
224
228 vtkBooleanMacro(ReadFrontBuffer, vtkTypeBool);
232
234
238 vtkBooleanMacro(ShouldRerender, vtkTypeBool);
242
244
248 void SetViewport(double, double, double, double);
249 void SetViewport(double*);
250 vtkGetVectorMacro(Viewport, double, 4);
252
254
260 vtkSetMacro(InputBufferType, int);
261 vtkGetMacro(InputBufferType, int);
266
271
277
278protected:
281
282 // vtkWindow is not a vtkDataObject, so we need our own ivar.
284 int Scale[2];
287 double Viewport[4];
290
292
294
295 // see algorithm for more info
296 int FillOutputPortInformation(int port, vtkInformation* info) override;
297
305 virtual void Render();
306
307 // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
309 void Shift2DActors(int x, int y);
311 vtkWTI2DHelperClass* StoredData;
312
313private:
315 void operator=(const vtkWindowToImageFilter&) = delete;
316};
317
318VTK_ABI_NAMESPACE_END
319#endif
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
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 SetScale(int, int)
Get/Set the scale (or magnification) factors in X and Y.
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.
virtual void SetInputBufferType(int)
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:62
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_RGBA
#define VTK_RGB
#define VTK_ZBUFFER
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)