VTK  9.1.0
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=========================================================================*/
51#ifndef vtkResizingWindowToImageFilter_h
52#define vtkResizingWindowToImageFilter_h
53
54#include "vtkAlgorithm.h"
55#include "vtkImageData.h" // makes things a bit easier
56#include "vtkRenderingCoreModule.h" // For export macro
57
58// VTK_RGB and VTK_RGBA are defined in system includes
59#define VTK_ZBUFFER 5
60
61class vtkWindow;
62
63class vtkWTI2DHelperClass;
64class VTKRENDERINGCORE_EXPORT vtkResizingWindowToImageFilter : public vtkAlgorithm
65{
66public:
68
70 void PrintSelf(ostream& os, vtkIndent indent) override;
71
75 void SetInput(vtkWindow* input);
76
78
82 vtkGetObjectMacro(Input, vtkWindow);
84
86
89 vtkGetVector2Macro(Size, int);
90 vtkSetVector2Macro(Size, int);
92
94
99 vtkGetMacro(SizeLimit, int);
100 vtkSetMacro(SizeLimit, int);
102
104
110 vtkSetMacro(InputBufferType, int);
111 vtkGetMacro(InputBufferType, int);
112 void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
113 void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
114 void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
116
121
127
128protected:
131
132 // vtkWindow is not a vtkDataObject, so we need our own ivar.
134 // requested size of the screenshot in pixels.
135 int Size[2];
136 // window size limit for using this filter. If the target resolution is higher we switch to
137 // vtkWindowToImageFilter with tiling
139
141
143
145
146 // see algorithm for more info
147 int FillOutputPortInformation(int port, vtkInformation* info) override;
148
156 virtual void Render();
157
173 const int requestedSize[2], int actualSize[2], int scale[2], bool* approximate);
174
175private:
177 void operator=(const vtkResizingWindowToImageFilter&) = delete;
178};
179
180#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:123
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
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:39
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_ZBUFFER
#define VTK_RGBA
#define VTK_RGB