VTK  9.3.1
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 
112  vtkImageData* GetOutput();
113 
119 
120 protected:
122  ~vtkResizingWindowToImageFilter() override;
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 
136  virtual void RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
137 
138  // see algorithm for more info
140 
148  virtual void Render();
149 
164  void GetScaleFactorsAndSize(
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
#define VTK_ZBUFFER
Store vtkAlgorithm input/output information.
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:64
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:51
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
Use a vtkWindow as input to image pipeline.
#define VTK_RGBA
#define VTK_RGB
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()