VTK  9.3.0
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 
52 VTK_ABI_NAMESPACE_BEGIN
53 class vtkWindow;
54 
55 class vtkWTI2DHelperClass;
56 class VTKRENDERINGCORE_EXPORT vtkResizingWindowToImageFilter : public vtkAlgorithm
57 {
58 public:
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 
120 protected:
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
140 
148  virtual void Render();
149 
165  const int requestedSize[2], int actualSize[2], int scale[2], bool* approximate);
166 
167 private:
169  void operator=(const vtkResizingWindowToImageFilter&) = delete;
170 };
171 
172 VTK_ABI_NAMESPACE_END
173 #endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:52
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Use a vtkWindow as input to image pipeline.
static vtkResizingWindowToImageFilter * New()
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 *)
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
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 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
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:28
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ scale
Definition: vtkX3D.h:229
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_ZBUFFER
#define VTK_RGBA
#define VTK_RGB