VTK  9.2.6
vtkResizingWindowToImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkResizingWindowToImageFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
54 #ifndef vtkResizingWindowToImageFilter_h
55 #define vtkResizingWindowToImageFilter_h
56 
57 #include "vtkAlgorithm.h"
58 #include "vtkImageData.h" // makes things a bit easier
59 #include "vtkRenderingCoreModule.h" // For export macro
60 
61 // VTK_RGB and VTK_RGBA are defined in system includes
62 #define VTK_ZBUFFER 5
63 
64 class vtkWindow;
65 
66 class vtkWTI2DHelperClass;
67 class VTKRENDERINGCORE_EXPORT vtkResizingWindowToImageFilter : public vtkAlgorithm
68 {
69 public:
71 
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
78  void SetInput(vtkWindow* input);
79 
81 
85  vtkGetObjectMacro(Input, vtkWindow);
87 
89 
92  vtkGetVector2Macro(Size, int);
93  vtkSetVector2Macro(Size, int);
95 
97 
102  vtkGetMacro(SizeLimit, int);
103  vtkSetMacro(SizeLimit, int);
105 
107 
113  vtkSetMacro(InputBufferType, int);
114  vtkGetMacro(InputBufferType, int);
115  void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
116  void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
117  void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
119 
123  vtkImageData* GetOutput();
124 
130 
131 protected:
133  ~vtkResizingWindowToImageFilter() override;
134 
135  // vtkWindow is not a vtkDataObject, so we need our own ivar.
137  // requested size of the screenshot in pixels.
138  int Size[2];
139  // window size limit for using this filter. If the target resolution is higher we switch to
140  // vtkWindowToImageFilter with tiling
142 
144 
146 
147  virtual void RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
148 
149  // see algorithm for more info
151 
159  virtual void Render();
160 
175  void GetScaleFactorsAndSize(
176  const int requestedSize[2], int actualSize[2], int scale[2], bool* approximate);
177 
178 private:
180  void operator=(const vtkResizingWindowToImageFilter&) = delete;
181 };
182 
183 #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:69
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:38
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
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:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
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()