VTK  9.3.20240420
vtkResizingWindowToImageFilter.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
42#ifndef vtkResizingWindowToImageFilter_h
43#define vtkResizingWindowToImageFilter_h
44
45#include "vtkAlgorithm.h"
46#include "vtkImageData.h" // makes things a bit easier
47#include "vtkRenderingCoreModule.h" // For export macro
48
49// VTK_RGB and VTK_RGBA are defined in system includes
50#define VTK_ZBUFFER 5
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkWindow;
54
55class vtkWTI2DHelperClass;
56class VTKRENDERINGCORE_EXPORT vtkResizingWindowToImageFilter : public vtkAlgorithm
57{
58public:
60
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
67 void SetInput(vtkWindow* input);
68
70
74 vtkGetObjectMacro(Input, vtkWindow);
76
78
81 vtkGetVector2Macro(Size, int);
82 vtkSetVector2Macro(Size, int);
84
86
91 vtkGetMacro(SizeLimit, int);
92 vtkSetMacro(SizeLimit, int);
94
96
102 vtkSetMacro(InputBufferType, int);
103 vtkGetMacro(InputBufferType, int);
104 void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
105 void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
106 void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
108
113
119
120protected:
123
124 // vtkWindow is not a vtkDataObject, so we need our own ivar.
126 // requested size of the screenshot in pixels.
127 int Size[2];
128 // window size limit for using this filter. If the target resolution is higher we switch to
129 // vtkWindowToImageFilter with tiling
131
133
135
137
138 // see algorithm for more info
139 int FillOutputPortInformation(int port, vtkInformation* info) override;
140
148 virtual void Render();
149
165 const int requestedSize[2], int actualSize[2], int scale[2], bool* approximate);
166
167private:
169 void operator=(const vtkResizingWindowToImageFilter&) = delete;
170};
171
172VTK_ABI_NAMESPACE_END
173#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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Use a vtkWindow as input to image pipeline.
void SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
void GetScaleFactorsAndSize(const int requestedSize[2], int actualSize[2], int scale[2], bool *approximate)
Compute scale factors and new size for target resolution.
virtual void Render()
Allows subclasses to customize how a request for render is handled.
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkResizingWindowToImageFilter() override
static vtkResizingWindowToImageFilter * New()
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_RGBA
#define VTK_RGB